Change actual charges based on exchange rate (#10619)

* Change actual charges based on exchange rate

* Update transaction.js
This commit is contained in:
Nabin Hait 2017-08-31 19:40:09 +05:30 committed by Makarand Bauskar
parent d112ee5244
commit a9c9b69c22

View File

@ -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({