fix: Update condition

This commit is contained in:
Deepesh Garg 2022-03-27 19:20:37 +05:30
parent fc09377de2
commit 18c5b24ac1

View File

@ -840,7 +840,7 @@ erpnext.taxes_and_totals = class TaxesAndTotals extends erpnext.payments {
}
calculate_write_off_amount() {
if(this.frm.doc.paid_amount > this.frm.doc.grand_total) {
if(this.frm.doc.write_off_outstanding_amount_automatically) {
this.frm.doc.write_off_amount = flt(this.frm.doc.outstanding_amount, precision("write_off_amount"));
this.frm.doc.base_write_off_amount = flt(this.frm.doc.write_off_amount * this.frm.doc.conversion_rate,
precision("base_write_off_amount"));