manipulate diff only if diff <= 0.02
This commit is contained in:
parent
d6822ddd7c
commit
ead48094b6
@ -364,7 +364,7 @@ class AccountsController(TransactionBase):
|
||||
diff = self.net_total_export - flt(last_tax.total / self.conversion_rate,
|
||||
self.precision("grand_total_export"))
|
||||
|
||||
if diff:
|
||||
if diff and abs(diff) <= (2.0 / 10**(self.precision("total", last_tax))):
|
||||
last_tax.total = last_tax.total + flt(diff * self.conversion_rate, self.precision("total", last_tax))
|
||||
|
||||
def calculate_total_advance(self, parenttype, advance_parentfield):
|
||||
|
@ -471,7 +471,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({
|
||||
var diff = this.frm.doc.net_total_export
|
||||
- flt(last_tax.total / this.frm.doc.conversion_rate, precision("grand_total_export"));
|
||||
|
||||
if (diff) {
|
||||
if ( diff && Math.abs(diff) <= (2.0 / Math.pow(10, precision("total", last_tax)) ) {
|
||||
last_tax.total += flt(diff * this.frm.doc.conversion_rate, precision("total", last_tax));
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user