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,6 +46,9 @@ erpnext.taxes_and_totals = erpnext.stock.StockController.extend({
var company_currency = this.get_company_currency(); var company_currency = this.get_company_currency();
if(!this.frm.doc.conversion_rate) { if(!this.frm.doc.conversion_rate) {
if(this.frm.doc.currency == company_currency) {
this.frm.set_value("conversion_rate", 1);
} else {
frappe.throw(repl('%(conversion_rate_label)s' + frappe.throw(repl('%(conversion_rate_label)s' +
__(' is mandatory. Maybe Currency Exchange record is not created for ') + __(' is mandatory. Maybe Currency Exchange record is not created for ') +
'%(from_currency)s' + __(" to ") + '%(to_currency)s', '%(from_currency)s' + __(" to ") + '%(to_currency)s',
@ -55,6 +58,8 @@ erpnext.taxes_and_totals = erpnext.stock.StockController.extend({
"to_currency": company_currency "to_currency": company_currency
})); }));
} }
}
}, },
calculate_item_values: function() { calculate_item_values: function() {

View File

@ -75,7 +75,6 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
callback: function(r) { callback: function(r) {
if(!r.exc) { if(!r.exc) {
me.frm.set_value("taxes", r.message); me.frm.set_value("taxes", r.message);
me.calculate_taxes_and_totals();
} }
} }
}); });