manipulate diff only if diff <= 0.02

This commit is contained in:
Anand Doshi
2015-03-13 18:59:01 +05:30
parent d6822ddd7c
commit ead48094b6
2 changed files with 2 additions and 2 deletions

View File

@@ -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):