From 9b8e1cb10e1a3a6a2d865c2cd906c47635e52dfc Mon Sep 17 00:00:00 2001 From: rohitwaghchaure Date: Tue, 19 Dec 2017 11:20:29 +0530 Subject: [PATCH] [Fix] Payment terms validation issue (#12092) --- erpnext/controllers/accounts_controller.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index c8d30c8e0b..c26715af55 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -692,9 +692,11 @@ class AccountsController(TransactionBase): if self.get("payment_schedule"): total = 0 for d in self.get("payment_schedule"): - total += flt(d.payment_amount) + total += flt(d.payment_amount, d.precision("payment_amount")) + + grand_total = flt(self.get("rounded_total"), self.precision("rounded_total")) \ + or flt(self.grand_total, self.precision("grand_total")) - grand_total = self.get("rounded_total") or self.grand_total if total != grand_total: frappe.throw(_("Total Payment Amount in Payment Schedule must be equal to Grand / Rounded Total"))