Merge pull request #41876 from frappe/mergify/bp/version-15-hotfix/pr-41817

fix: use invoice outstanding on Dunning (backport #41817)
This commit is contained in:
ruthra kumar
2024-06-12 16:42:08 +05:30
committed by GitHub

View File

@@ -2678,6 +2678,10 @@ 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
if source.payment_schedule and len(source.payment_schedule) == 1:
target.overdue_payments[0].outstanding = source.get("outstanding_amount")
target.validate()
return get_mapped_doc(