Payment schedule error #12057 (#12096)

* use 12 places precision for sums

* use high float precision, fix decimal place late

* Update accounts_controller.py
This commit is contained in:
tundebabzy 2017-12-19 07:09:20 +01:00 committed by Nabin Hait
parent f592f2c9a9
commit 5825dedf7c

View File

@ -693,8 +693,9 @@ class AccountsController(TransactionBase):
total = 0
for d in self.get("payment_schedule"):
total += flt(d.payment_amount)
total = flt(total, self.precision("grand_total"))
grand_total = self.get("rounded_total") or self.grand_total
grand_total = flt(self.get("rounded_total") or self.grand_total, self.precision('grand_total'))
if total != grand_total:
frappe.throw(_("Total Payment Amount in Payment Schedule must be equal to Grand / Rounded Total"))