fix: System was allowing to save payment schedule amount less than grand total (backport #45322) (#45381)
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
(cherry picked from commit b26f0b6633)
Co-authored-by: Diógenes Souza <103958767+devdiogenes@users.noreply.github.com>
This commit is contained in:
@@ -2413,10 +2413,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(
|
||||
|
||||
Reference in New Issue
Block a user