Change actual charges based on exchange rate (#10619)
* Change actual charges based on exchange rate * Update transaction.js
This commit is contained in:
parent
d112ee5244
commit
a9c9b69c22
@ -527,12 +527,23 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
if(this.frm.doc.ignore_pricing_rule) {
|
if(this.frm.doc.ignore_pricing_rule) {
|
||||||
this.calculate_taxes_and_totals();
|
this.calculate_taxes_and_totals();
|
||||||
} else if (!this.in_apply_price_list){
|
} else if (!this.in_apply_price_list){
|
||||||
|
this.set_actual_charges_based_on_currency();
|
||||||
this.apply_price_list();
|
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) {
|
get_exchange_rate: function(transaction_date, from_currency, to_currency, callback) {
|
||||||
if (!transaction_date || !from_currency || !to_currency) return;
|
if (!transaction_date || !from_currency || !to_currency) return;
|
||||||
return frappe.call({
|
return frappe.call({
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user