conversion rate fixes
This commit is contained in:
parent
1a1ba38e95
commit
f59d3a4e07
@ -46,14 +46,19 @@ erpnext.taxes_and_totals = erpnext.stock.StockController.extend({
|
||||
var company_currency = this.get_company_currency();
|
||||
|
||||
if(!this.frm.doc.conversion_rate) {
|
||||
frappe.throw(repl('%(conversion_rate_label)s' +
|
||||
__(' is mandatory. Maybe Currency Exchange record is not created for ') +
|
||||
'%(from_currency)s' + __(" to ") + '%(to_currency)s',
|
||||
{
|
||||
"conversion_rate_label": conversion_rate_label,
|
||||
"from_currency": this.frm.doc.currency,
|
||||
"to_currency": company_currency
|
||||
}));
|
||||
if(this.frm.doc.currency == company_currency) {
|
||||
this.frm.set_value("conversion_rate", 1);
|
||||
} else {
|
||||
frappe.throw(repl('%(conversion_rate_label)s' +
|
||||
__(' is mandatory. Maybe Currency Exchange record is not created for ') +
|
||||
'%(from_currency)s' + __(" to ") + '%(to_currency)s',
|
||||
{
|
||||
"conversion_rate_label": conversion_rate_label,
|
||||
"from_currency": this.frm.doc.currency,
|
||||
"to_currency": company_currency
|
||||
}));
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -75,7 +75,6 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
||||
callback: function(r) {
|
||||
if(!r.exc) {
|
||||
me.frm.set_value("taxes", r.message);
|
||||
me.calculate_taxes_and_totals();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user