test: test for auto write-off amount

This commit is contained in:
Deepesh Garg
2022-03-25 18:02:14 +05:30
parent 665bd4c510
commit 6a50f36b31
3 changed files with 37 additions and 5 deletions

View File

@@ -580,6 +580,9 @@ class calculate_taxes_and_totals(object):
.format(self.doc.party_account_currency, invoice_total))
if self.doc.docstatus == 0:
if self.doc.get('write_off_outstanding_amount_automatically'):
self.doc.write_off_amount = 0
self.calculate_outstanding_amount()
self.calculate_write_off_amount()