test: test for auto write-off amount

(cherry picked from commit 6a50f36b31)

# Conflicts:
#	erpnext/public/js/controllers/taxes_and_totals.js
This commit is contained in:
Deepesh Garg
2022-03-25 18:02:14 +05:30
committed by mergify-bot
parent b2ac773cca
commit 19b1b1f4ba
3 changed files with 40 additions and 3 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()