diff --git a/erpnext/selling/doctype/sales_common/sales_common.js b/erpnext/selling/doctype/sales_common/sales_common.js index 8876fa48f7..5039fcdc23 100644 --- a/erpnext/selling/doctype/sales_common/sales_common.js +++ b/erpnext/selling/doctype/sales_common/sales_common.js @@ -168,6 +168,13 @@ cur_frm.cscript.basic_rate = function(doc, cdt, cdn) { // ************************ EXPORT RATE ************************* cur_frm.cscript.export_rate = function(doc,cdt,cdn) { + var cur_rec = locals[cdt][cdn]; + var fname = cur_frm.cscript.fname; + var tname = cur_frm.cscript.tname; + if(flt(cur_rec.ref_rate)>0 && flt(cur_rec.export_rate)>0 && !flt(cur_rec.adj_rate)) { + var adj_rate = 100 * (1 - (flt(cur_rec.export_rate) / flt(cur_rec.ref_rate))); + set_multiple(tname, cur_rec.name, { 'adj_rate': adj_rate }, fname); + } doc = locals[doc.doctype][doc.name]; cur_frm.cscript.recalc(doc, 1); } diff --git a/version.num b/version.num index c2807f7f3c..acfba60953 100644 --- a/version.num +++ b/version.num @@ -1 +1 @@ -140 \ No newline at end of file +141 \ No newline at end of file