[Fix] Payment terms validation issue (#12092)
This commit is contained in:
parent
33c9da9ab1
commit
9b8e1cb10e
@ -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"))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user