From 280e0ce263fe2402cdd733cbb3ee8c90f520b12c Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 6 Aug 2012 18:23:45 +0530 Subject: [PATCH] added function to hide/unhide contact section of a buying form --- erpnext/buying/doctype/purchase_common/purchase_common.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.js b/erpnext/buying/doctype/purchase_common/purchase_common.js index 81d5fbf813d..68dc8c73d46 100644 --- a/erpnext/buying/doctype/purchase_common/purchase_common.js +++ b/erpnext/buying/doctype/purchase_common/purchase_common.js @@ -122,7 +122,6 @@ var set_dynamic_label_child = function(doc, cdt, cdn, base_curr) { cur_frm.cscript.dynamic_label = function(doc, cdt, cdn, callback1) { var base_currency = wn.boot.company[doc.company].default_currency || sys_defaults['currency']; - if (doc.currency === base_currency) { set_multiple(cdt, cdn, {conversion_rate:1}); hide_field(['conversion_rate', 'net_total_import','grand_total_import', @@ -634,3 +633,7 @@ cur_frm.cscript.check_charge_type_and_get_tax_amount = function(doc, tax, t, cl, } } } + +cur_frm.cscript.toggle_contact_section = function(doc) { + doc.supplier ? unhide_field("contact_section") : hide_field("contact_section"); +} \ No newline at end of file