mirror of
https://github.com/frappe/erpnext.git
synced 2026-02-15 07:35:00 +00:00
fix: correct outstanding amount for invoice in dunning
(cherry picked from commit c2bdd30e6d)
This commit is contained in:
@@ -2720,9 +2720,11 @@ def create_dunning(source_name, target_doc=None, ignore_permissions=False):
|
||||
target.closing_text = letter_text.get("closing_text")
|
||||
target.language = letter_text.get("language")
|
||||
|
||||
# update outstanding
|
||||
# update outstanding from doc
|
||||
if source.payment_schedule and len(source.payment_schedule) == 1:
|
||||
target.overdue_payments[0].outstanding = source.get("outstanding_amount")
|
||||
for row in target.overdue_payments:
|
||||
if row.payment_schedule == source.payment_schedule[0].name:
|
||||
row.outstanding = source.get("outstanding_amount")
|
||||
|
||||
target.validate()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user