conversion rate fixes

This commit is contained in:
Nabin Hait 2015-05-19 12:29:56 +05:30
parent 1a1ba38e95
commit f59d3a4e07
2 changed files with 13 additions and 9 deletions

View File

@ -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
}));
}
}
},

View File

@ -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();
}
}
});