mirror of
https://github.com/frappe/erpnext.git
synced 2026-10-29 22:57:42 +00:00
fix(accounts): skip discount settled terms in zero portion outstanding patch
This commit is contained in:
@@ -6,7 +6,8 @@ def execute():
|
||||
ps = DocType("Payment Schedule")
|
||||
for parenttype in ("Sales Invoice", "Purchase Invoice", "Sales Order", "Purchase Order"):
|
||||
parent = DocType(parenttype)
|
||||
outstanding = ps.payment_amount - ps.paid_amount
|
||||
settled = ps.paid_amount + ps.discounted_amount
|
||||
outstanding = ps.payment_amount - settled
|
||||
|
||||
(
|
||||
frappe.qb.update(ps)
|
||||
@@ -20,6 +21,6 @@ def execute():
|
||||
& (parent.docstatus == 1)
|
||||
& (ps.invoice_portion == 0)
|
||||
& (ps.outstanding == 0)
|
||||
& (ps.paid_amount < ps.payment_amount)
|
||||
& (settled < ps.payment_amount)
|
||||
)
|
||||
).run()
|
||||
|
||||
Reference in New Issue
Block a user