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,6 @@
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 = {
'Quotation' : 'cur_frm.cscript.make_qtn_list(this.body, this.doc)',
'Sales Order' : 'cur_frm.cscript.make_so_list(this.body, this.doc)',
'Delivery Note' : 'cur_frm.cscript.make_dn_list(this.body, this.doc)',
'Sales Invoice' : 'cur_frm.cscript.make_si_list(this.body, this.doc)'
}
// make address, contact, shipping, history list body
cur_frm.cscript.make_hl_body();
//cur_frm.cscript.make_sl_body();
cur_frm.cscript.load_defaults(doc, dt, dn);
}
@@ -55,7 +44,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", {"customer": doc.name}),
@@ -71,6 +59,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.customer = cur_frm.doc.name;
address.customer_name = cur_frm.doc.customer_name;
address.address_title = cur_frm.doc.customer_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 customer='"+cur_frm.docname+"' and docstatus != 2 order by is_primary_address desc"
},
@@ -117,85 +114,4 @@ cur_frm.fields_dict['customer_group'].get_query = function(doc,dt,dn) {
}
cur_frm.fields_dict.lead_name.get_query = erpnext.utils.lead_query;
cur_frm.cscript.make_qtn_list = function(parent, doc) {
cur_frm.cscript.get_common_list_view(parent, doc, 'Quotation');
}
cur_frm.cscript.make_so_list = function(parent, doc) {
cur_frm.cscript.get_common_list_view(parent, doc, 'Sales Order');
}
cur_frm.cscript.make_dn_list = function(parent, doc) {
cur_frm.cscript.get_common_list_view(parent, doc, 'Delivery Note');
}
cur_frm.cscript.get_common_list_view = function(parent, doc, doctype) {
var ListView = wn.views.ListView.extend({
init: function(doclistview) {
this._super(doclistview);
this.fields = this.fields.concat([
"`tab" + doctype + "`.status",
"`tab" + doctype + "`.currency",
"ifnull(`tab" + doctype + "`.grand_total_export, 0) as grand_total_export",
]);
},
prepare_data: function(data) {
this._super(data);
data.grand_total_export = data.currency + " " + fmt_money(data.grand_total_export)
},
columns: [
{width: '3%', content: 'docstatus'},
{width: '25%', content: 'name'},
{width: '25%', content: 'status'},
{width: '35%', content: 'grand_total_export', css: {'text-align': 'right'}},
{width: '12%', content:'modified', css: {'text-align': 'right'}}
],
});
cur_frm.cscript.render_list(doc, doctype, parent, ListView);
}
cur_frm.cscript.make_si_list = function(parent, doc) {
var ListView = wn.views.ListView.extend({
init: function(doclistview) {
this._super(doclistview);
this.fields = this.fields.concat([
"ifnull(`tabSales Invoice`.outstanding_amount, 0) as outstanding_amount",
"`tabSales Invoice`.currency",
"ifnull(`tabSales Invoice`.conversion_rate, 0) as conversion_rate",
"ifnull(`tabSales Invoice`.grand_total_export, 0) as grand_total_export",
]);
},
prepare_data: function(data) {
this._super(data);
if (data.outstanding_amount) {
data.outstanding_amount = data.currency + " " +
fmt_money(flt(data.outstanding_amount)/flt(data.conversion_rate)) +
" [outstanding]";
} else {
data.outstanding_amount = '';
}
data.grand_total_export = data.currency + " " + fmt_money(data.grand_total_export);
},
columns: [
{width: '3%', content: 'docstatus'},
{width: '25%', content: 'name'},
{width: '25%', content: 'outstanding_amount',
css: {'text-align': 'right', 'color': '#777'}},
{width: '35%', content: 'grand_total_export', css: {'text-align': 'right'}},
{width: '12%', content:'modified', css: {'text-align': 'right'}}
],
});
cur_frm.cscript.render_list(doc, 'Sales Invoice', parent, ListView);
}
cur_frm.fields_dict.lead_name.get_query = erpnext.utils.lead_query;

View File

@@ -2,20 +2,20 @@
{
"owner": "Administrator",
"docstatus": 0,
"creation": "2012-12-03 10:31:05",
"creation": "2012-12-07 15:15:26",
"modified_by": "Administrator",
"modified": "2012-12-03 17:10:41"
"modified": "2012-12-27 14:02:01"
},
{
"autoname": "naming_series:",
"description": "Buyer of Goods and Services.",
"allow_rename": 1,
"allow_print": 0,
"search_fields": "customer_name,customer_group,country,territory",
"module": "Selling",
"doctype": "DocType",
"document_type": "Master",
"autoname": "naming_series:",
"name": "__common__",
"allow_rename": 1,
"doctype": "DocType"
"name": "__common__"
},
{
"name": "__common__",
@@ -39,7 +39,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",
@@ -89,12 +88,10 @@
"description": "Fetch lead which will be converted into customer.",
"no_copy": 1,
"oldfieldtype": "Link",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Lead Ref",
"oldfieldname": "lead_name",
"permlevel": 0,
"trigger": "Client",
"fieldname": "lead_name",
"fieldtype": "Link",
"hidden": 0,
@@ -113,12 +110,10 @@
"print_hide": 0,
"description": "<a href=\"#!Sales Browser/Customer Group\">To manage Customer Groups, click here</a>",
"oldfieldtype": "Link",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Customer Group",
"oldfieldname": "customer_group",
"permlevel": 0,
"trigger": "Client",
"fieldname": "customer_group",
"fieldtype": "Link",
"search_index": 1,
@@ -131,19 +126,16 @@
"print_hide": 1,
"description": "<a href=\"#!Sales Browser/Territory\">To manage Territory, click here</a>",
"oldfieldtype": "Link",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Territory",
"oldfieldname": "territory",
"permlevel": 0,
"trigger": "Client",
"options": "Territory",
"fieldname": "territory",
"fieldtype": "Link",
"reqd": 1,
"options": "Territory"
"permlevel": 0
},
{
"colour": "White:FFF",
"doctype": "DocField",
"label": "Address & Contacts",
"fieldname": "address_contacts",
@@ -152,7 +144,6 @@
},
{
"depends_on": "eval:doc.__islocal",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Address Desc",
"options": "<em>Addresses will appear only when you save the customer</em>",
@@ -161,7 +152,6 @@
"permlevel": 0
},
{
"colour": "White:FFF",
"doctype": "DocField",
"label": "Address HTML",
"fieldname": "address_html",
@@ -177,7 +167,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 customer</em>",
@@ -187,7 +176,6 @@
},
{
"oldfieldtype": "HTML",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Contact HTML",
"fieldname": "contact_html",
@@ -209,7 +197,6 @@
},
{
"oldfieldtype": "Section Break",
"colour": "White:FFF",
"doctype": "DocField",
"label": "More Info",
"fieldname": "more_info",
@@ -226,7 +213,6 @@
{
"description": "To create an Account Head under a different company, select the company and save customer.",
"oldfieldtype": "Link",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Company",
"oldfieldname": "company",
@@ -249,7 +235,6 @@
{
"description": "This currency will get fetched in Sales transactions of this customer",
"no_copy": 1,
"colour": "White:FFF",
"doctype": "DocField",
"label": "Default Currency",
"options": "link:Currency",
@@ -260,7 +245,6 @@
{
"description": "Your Customer's TAX registration numbers (if applicable) or any general information",
"oldfieldtype": "Code",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Customer Details",
"oldfieldname": "customer_details",
@@ -337,34 +321,6 @@
"fieldtype": "Table",
"permlevel": 0
},
{
"depends_on": "eval:!doc.__islocal",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Transaction History",
"fieldname": "transaction_history",
"fieldtype": "Section Break",
"permlevel": 0
},
{
"depends_on": "eval:!doc.__islocal",
"colour": "White:FFF",
"doctype": "DocField",
"label": "History HTML",
"fieldname": "history_html",
"fieldtype": "HTML",
"permlevel": 0
},
{
"oldfieldtype": "Small Text",
"colour": "White:FFF",
"doctype": "DocField",
"label": "Trash Reason",
"oldfieldname": "trash_reason",
"fieldname": "trash_reason",
"fieldtype": "Small Text",
"permlevel": 1
},
{
"amend": 0,
"create": 0,