address now not in dialog, added slideshows in products and groups and removed transaction history from customer / supplier / sales partner

This commit is contained in:
Rushabh Mehta
2012-12-27 14:05:02 +05:30
parent 7285a720a0
commit 5f1d57ecb7
30 changed files with 528 additions and 764 deletions

View File

@@ -17,17 +17,7 @@
wn.require('app/setup/doctype/contact_control/contact_control.js');
cur_frm.cscript.onload = function(doc,dt,dn){
// history doctypes and scripts
cur_frm.history_dict = {
'Purchase Order' : 'cur_frm.cscript.make_po_list(this.body, this.doc)',
'Purchase Receipt' : 'cur_frm.cscript.make_pr_list(this.body, this.doc)',
'Purchase Invoice' : 'cur_frm.cscript.make_pi_list(this.body, this.doc)'
}
// make contact, history list body
//cur_frm.cscript.make_cl_body();
cur_frm.cscript.make_hl_body();
}
cur_frm.cscript.refresh = function(doc,dt,dn) {
@@ -44,7 +34,6 @@ cur_frm.cscript.refresh = function(doc,dt,dn) {
// make lists
cur_frm.cscript.make_address(doc,dt,dn);
cur_frm.cscript.make_contact(doc,dt,dn);
cur_frm.cscript.make_history(doc,dt,dn);
cur_frm.communication_view = new wn.views.CommunicationList({
list: wn.model.get("Communication", {"supplier": doc.name}),
@@ -60,6 +49,15 @@ cur_frm.cscript.make_address = function() {
parent: cur_frm.fields_dict['address_html'].wrapper,
page_length: 2,
new_doctype: "Address",
custom_new_doc: function(doctype) {
var address = wn.model.make_new_doc_and_get_name('Address');
address = locals['Address'][address];
address.supplier = cur_frm.doc.name;
address.supplier_name = cur_frm.doc.supplier_name;
address.address_title = cur_frm.doc.supplier_name;
address.address_type = "Office";
wn.set_route("Form", "Address", address.name);
},
get_query: function() {
return "select name, address_type, address_line1, address_line2, city, state, country, pincode, fax, email_id, phone, is_primary_address, is_shipping_address from tabAddress where supplier='"+cur_frm.docname+"' and docstatus != 2 order by is_primary_address desc"
},
@@ -95,94 +93,4 @@ cur_frm.cscript.make_contact = function() {
// note: render_contact_row is defined in contact_control.js
}
cur_frm.contact_list.run();
}
// Transaction History
cur_frm.cscript.make_po_list = function(parent, doc) {
var ListView = wn.views.ListView.extend({
init: function(doclistview) {
this._super(doclistview);
this.fields = this.fields.concat([
"`tabPurchase Order`.status",
"`tabPurchase Order`.currency",
"ifnull(`tabPurchase Order`.grand_total_import, 0) as grand_total_import",
]);
},
prepare_data: function(data) {
this._super(data);
data.grand_total_import = data.currency + " " + fmt_money(data.grand_total_import);
},
columns: [
{width: '3%', content: 'docstatus'},
{width: '20%', content: 'name'},
{width: '30%', content: 'status',
css: {'text-align': 'right', 'color': '#777'}},
{width: '35%', content: 'grand_total_import', css: {'text-align': 'right'}},
{width: '12%', content:'modified', css: {'text-align': 'right'}}
],
});
cur_frm.cscript.render_list(doc, 'Purchase Order', parent, ListView);
}
cur_frm.cscript.make_pr_list = function(parent, doc) {
var ListView = wn.views.ListView.extend({
init: function(doclistview) {
this._super(doclistview);
this.fields = this.fields.concat([
"`tabPurchase Receipt`.status",
"`tabPurchase Receipt`.currency",
"ifnull(`tabPurchase Receipt`.grand_total_import, 0) as grand_total_import",
"ifnull(`tabPurchase Receipt`.per_billed, 0) as per_billed",
]);
},
prepare_data: function(data) {
this._super(data);
data.grand_total_import = data.currency + " " + fmt_money(data.grand_total_import);
},
columns: [
{width: '3%', content: 'docstatus'},
{width: '20%', content: 'name'},
{width: '20%', content: 'status',
css: {'text-align': 'right', 'color': '#777'}},
{width: '35%', content: 'grand_total_import', css: {'text-align': 'right'}},
{width: '10%', content: 'per_billed', type: 'bar-graph', label: 'Billed'},
{width: '12%', content:'modified', css: {'text-align': 'right'}}
],
});
cur_frm.cscript.render_list(doc, 'Purchase Receipt', parent, ListView);
}
cur_frm.cscript.make_pi_list = function(parent, doc) {
var ListView = wn.views.ListView.extend({
init: function(doclistview) {
this._super(doclistview);
this.fields = this.fields.concat([
"`tabPurchase Invoice`.currency",
"ifnull(`tabPurchase Invoice`.grand_total_import, 0) as grand_total_import",
]);
},
prepare_data: function(data) {
this._super(data);
data.grand_total_import = data.currency + " " + fmt_money(data.grand_total_import);
},
columns: [
{width: '3%', content: 'docstatus'},
{width: '30%', content: 'name'},
{width: '55%', content: 'grand_total_import', css: {'text-align': 'right'}},
{width: '12%', content:'modified', css: {'text-align': 'right'}}
],
});
cur_frm.cscript.render_list(doc, 'Purchase Invoice', parent, ListView);
}

View File

@@ -2,9 +2,9 @@
{
"owner": "Administrator",
"docstatus": 0,
"creation": "2012-12-03 10:31:02",
"creation": "2012-12-07 15:15:23",
"modified_by": "Administrator",
"modified": "2012-12-03 17:10:41"
"modified": "2012-12-27 14:02:18"
},
{
"autoname": "naming_series:",
@@ -38,7 +38,6 @@
{
"description": "Note: You Can Manage Multiple Address or Contacts via Addresses & Contacts",
"oldfieldtype": "Section Break",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Basic Info",
"fieldname": "basic_info",
@@ -95,7 +94,6 @@
},
{
"depends_on": "eval:doc.__islocal",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Address Desc",
"options": "<em>Addresses will appear only when you save the supplier</em>",
@@ -104,7 +102,6 @@
"permlevel": 0
},
{
"colour": "White:FFF",
"doctype": "DocField",
"label": "Address HTML",
"fieldname": "address_html",
@@ -120,7 +117,6 @@
},
{
"depends_on": "eval:doc.__islocal",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Contact Desc",
"options": "<em>Contact Details will appear only when you save the supplier</em>",
@@ -159,7 +155,6 @@
{
"description": "Enter the company name under which Account Head will be created for this Supplier",
"oldfieldtype": "Link",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Company",
"oldfieldname": "company",
@@ -174,7 +169,6 @@
{
"description": "This currency will get fetched in Purchase transactions of this supplier",
"no_copy": 1,
"colour": "White:FFF",
"doctype": "DocField",
"label": "Default Currency",
"options": "link:Currency",
@@ -185,7 +179,6 @@
{
"description": "Statutory info and other general information about your Supplier",
"oldfieldtype": "Code",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Supplier Details",
"oldfieldname": "supplier_details",
@@ -216,35 +209,6 @@
"fieldtype": "Data",
"permlevel": 0
},
{
"oldfieldtype": "Section Break",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Transaction History",
"fieldname": "transaction_history",
"fieldtype": "Section Break",
"depends_on": "eval:!doc.__islocal",
"permlevel": 0
},
{
"oldfieldtype": "HTML",
"colour": "White:FFF",
"doctype": "DocField",
"label": "History HTML",
"fieldname": "history_html",
"fieldtype": "HTML",
"depends_on": "eval:!doc.__islocal",
"permlevel": 0
},
{
"oldfieldtype": "Small Text",
"doctype": "DocField",
"label": "Trash Reason",
"oldfieldname": "trash_reason",
"fieldname": "trash_reason",
"fieldtype": "Small Text",
"permlevel": 1
},
{
"amend": 0,
"create": 0,