diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 3a8ddb59278..be55406ce2b 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -527,12 +527,23 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ if(this.frm.doc.ignore_pricing_rule) { this.calculate_taxes_and_totals(); } else if (!this.in_apply_price_list){ + this.set_actual_charges_based_on_currency(); this.apply_price_list(); } } }, + set_actual_charges_based_on_currency: function() { + var me = this; + $.each(this.frm.doc.taxes || [], function(i, d) { + if(d.charge_type == "Actual") { + frappe.model.set_value(d.doctype, d.name, "tax_amount", + flt(d.tax_amount) / flt(me.frm.doc.conversion_rate)); + } + }); + }, + get_exchange_rate: function(transaction_date, from_currency, to_currency, callback) { if (!transaction_date || !from_currency || !to_currency) return; return frappe.call({