From f77c940fcfc8a0c459d53a12a2dd6111ae59137e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 5 Apr 2012 16:29:02 +0530 Subject: [PATCH] fixed price list currency issue --- .../selling/doctype/sales_common/sales_common.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/erpnext/selling/doctype/sales_common/sales_common.js b/erpnext/selling/doctype/sales_common/sales_common.js index cad8ec16f7d..a3470ec4600 100644 --- a/erpnext/selling/doctype/sales_common/sales_common.js +++ b/erpnext/selling/doctype/sales_common/sales_common.js @@ -157,11 +157,17 @@ cur_frm.cscript.hide_price_list_currency = function(doc, cdt, cdn, callback1) { args: {'price_list':doc.price_list_name, 'company': doc.company}, callback: function(r, rt) { pl_currency = r.message[0]?r.message[0]:[]; + unhide_field(['price_list_currency', 'plc_conversion_rate']); + if (pl_currency.length==1) { - if (pl_currency[0] == doc.currency) set_multiple(cdt, cdn, {price_list_currency:doc.currency, plc_conversion_rate:doc.conversion_rate}); - else if (pl_currency[0] = r.message[1]) set_multiple(cdt, cdn, {price_list_currency:pl_currency[0], plc_conversion_rate:1}) - hide_field(['price_list_currency', 'plc_conversion_rate']); - } else unhide_field(['price_list_currency', 'plc_conversion_rate']); + if (pl_currency[0] == doc.currency) { + set_multiple(cdt, cdn, {price_list_currency:doc.currency, plc_conversion_rate:doc.conversion_rate}); + hide_field(['price_list_currency', 'plc_conversion_rate']); + } else if (pl_currency[0] = r.message[1]) { + set_multiple(cdt, cdn, {price_list_currency:pl_currency[0], plc_conversion_rate:1}) + hide_field(['price_list_currency', 'plc_conversion_rate']); + } + } if (r.message[1] == doc.currency) { set_multiple(cdt, cdn, {conversion_rate:1});