Update erpnext/selling/doctype/sales_common/sales_common.js

This commit is contained in:
Nabin Hait 2012-04-05 16:54:19 +05:30
parent 758eed555c
commit 9ba2e49468

View File

@ -160,11 +160,12 @@ cur_frm.cscript.hide_price_list_currency = function(doc, cdt, cdn, callback1) {
unhide_field(['price_list_currency', 'plc_conversion_rate']); unhide_field(['price_list_currency', 'plc_conversion_rate']);
if (pl_currency.length==1) { if (pl_currency.length==1) {
set_multiple(cdt, cdn, {price_list_currency:pl_currency[0]});
if (pl_currency[0] == doc.currency) { if (pl_currency[0] == doc.currency) {
set_multiple(cdt, cdn, {price_list_currency:doc.currency, plc_conversion_rate:doc.conversion_rate}); set_multiple(cdt, cdn, {plc_conversion_rate:doc.conversion_rate});
hide_field(['price_list_currency', 'plc_conversion_rate']); hide_field(['price_list_currency', 'plc_conversion_rate']);
} else if (pl_currency[0] == r.message[1]) { } else if (pl_currency[0] == r.message[1]) {
set_multiple(cdt, cdn, {price_list_currency:pl_currency[0], plc_conversion_rate:1}) set_multiple(cdt, cdn, {plc_conversion_rate:1})
hide_field(['price_list_currency', 'plc_conversion_rate']); hide_field(['price_list_currency', 'plc_conversion_rate']);
} }
} }