From b26f0b6633829405a5cbb884ceec7b5352291850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Di=C3=B3genes=20Souza?= <103958767+devdiogenes@users.noreply.github.com> Date: Wed, 22 Jan 2025 09:22:26 -0300 Subject: [PATCH] fix: System was allowing to save payment schedule amount less than grand total (#45322) * fix: System was allowing to save payment schedule amount less than grand_total * style: After run pre-commit --- erpnext/controllers/accounts_controller.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 8628fe647bf..bab56b8b1ce 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -2435,10 +2435,15 @@ class AccountsController(TransactionBase): ) if ( - flt(total, self.precision("grand_total")) - flt(grand_total, self.precision("grand_total")) + abs( + flt(total, self.precision("grand_total")) + - flt(grand_total, self.precision("grand_total")) + ) > 0.1 - or flt(base_total, self.precision("base_grand_total")) - - flt(base_grand_total, self.precision("base_grand_total")) + or abs( + flt(base_total, self.precision("base_grand_total")) + - flt(base_grand_total, self.precision("base_grand_total")) + ) > 0.1 ): frappe.throw(