Payment schedule total amount validation considering write off amount

This commit is contained in:
Nabin Hait 2017-12-21 11:46:30 +05:30
parent a5cc84f8af
commit e591c85f7c

View File

@ -695,6 +695,8 @@ class AccountsController(TransactionBase):
total = flt(total, self.precision("grand_total"))
grand_total = flt(self.get("rounded_total") or self.grand_total, self.precision('grand_total'))
if self.doctype in ("Sales Invoice", "Purchase Invoice"):
grand_total = grand_total - flt(self.write_off_amount)
if total != grand_total:
frappe.throw(_("Total Payment Amount in Payment Schedule must be equal to Grand / Rounded Total"))