From 16b638664866826cd91ed1927f4ab0fbd47011c1 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 3 May 2012 14:41:35 +0530 Subject: [PATCH 1/2] fixes in quotation --- erpnext/selling/doctype/quotation/quotation.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/erpnext/selling/doctype/quotation/quotation.js b/erpnext/selling/doctype/quotation/quotation.js index eb1cfe455d..29eb4cc8c3 100644 --- a/erpnext/selling/doctype/quotation/quotation.js +++ b/erpnext/selling/doctype/quotation/quotation.js @@ -65,7 +65,7 @@ cur_frm.cscript.lead_cust_show = function(doc,cdt,cdn){ if(doc.quotation_to == 'Lead') unhide_field(['lead']); else if(doc.quotation_to == 'Customer') unhide_field(['customer']); - doc.lead = doc.lead_name = doc.customer = doc.customer_address = doc.contact_person = doc.address_display = doc.contact_display = doc.contact_mobile = doc.contact_email = doc.territory = doc.customer_group = doc.organization = ""; + doc.lead = doc.lead_name = doc.customer = doc.customer_name = doc.customer_address = doc.contact_person = doc.address_display = doc.contact_display = doc.contact_mobile = doc.contact_email = doc.territory = doc.customer_group = doc.organization = ""; } @@ -144,8 +144,10 @@ cur_frm.fields_dict['lead'].get_query = function(doc,cdt,cdn){ } cur_frm.cscript.lead = function(doc, cdt, cdn) { - if(doc.lead) get_server_fields('get_lead_details', doc.lead,'', doc, cdt, cdn, 1); - if(doc.lead) unhide_field('territory'); + if(doc.lead) { + get_server_fields('get_lead_details', doc.lead,'', doc, cdt, cdn, 1, callback); + unhide_field('territory'); + } } From dc7ffe47b2b41a638ac889494834766ef5277e83 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 3 May 2012 14:55:21 +0530 Subject: [PATCH 2/2] fixes in quotation --- erpnext/selling/doctype/quotation/quotation.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/selling/doctype/quotation/quotation.js b/erpnext/selling/doctype/quotation/quotation.js index 29eb4cc8c3..285c2d1763 100644 --- a/erpnext/selling/doctype/quotation/quotation.js +++ b/erpnext/selling/doctype/quotation/quotation.js @@ -42,7 +42,7 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) { if(doc.quotation_to) { if(doc.quotation_to == 'Customer') { - hide_field(['lead', 'lead_name', 'organization']); + hide_field(['lead', 'lead_name']); } else if (doc.quotation_to == 'Lead') { hide_field(['customer','customer_address','contact_person', 'customer_name','contact_display', 'customer_group']); @@ -61,11 +61,11 @@ cur_frm.cscript.onload_post_render = function(doc, dt, dn) { // hide - unhide fields based on lead or customer.. // ======================================================================================================================= cur_frm.cscript.lead_cust_show = function(doc,cdt,cdn){ - hide_field(['lead', 'lead_name','customer','customer_address','contact_person','customer_name','address_display','contact_display','contact_mobile','contact_email','territory','customer_group', 'organization']); + hide_field(['lead', 'lead_name','customer','customer_address','contact_person','customer_name','address_display','contact_display','contact_mobile','contact_email','territory','customer_group']); if(doc.quotation_to == 'Lead') unhide_field(['lead']); else if(doc.quotation_to == 'Customer') unhide_field(['customer']); - doc.lead = doc.lead_name = doc.customer = doc.customer_name = doc.customer_address = doc.contact_person = doc.address_display = doc.contact_display = doc.contact_mobile = doc.contact_email = doc.territory = doc.customer_group = doc.organization = ""; + doc.lead = doc.lead_name = doc.customer = doc.customer_name = doc.customer_address = doc.contact_person = doc.address_display = doc.contact_display = doc.contact_mobile = doc.contact_email = doc.territory = doc.customer_group = ""; }