From 5825dedf7c7948db5bcd1c501a0e2c47c14cf042 Mon Sep 17 00:00:00 2001 From: tundebabzy Date: Tue, 19 Dec 2017 07:09:20 +0100 Subject: [PATCH] Payment schedule error #12057 (#12096) * use 12 places precision for sums * use high float precision, fix decimal place late * Update accounts_controller.py --- erpnext/controllers/accounts_controller.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index c8d30c8e0b6..10e1d9270f3 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -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"))