From 18c5b24ac12204e5d7ce47e767f39386fd42808c Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Sun, 27 Mar 2022 19:20:37 +0530 Subject: [PATCH] fix: Update condition --- erpnext/public/js/controllers/taxes_and_totals.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/public/js/controllers/taxes_and_totals.js b/erpnext/public/js/controllers/taxes_and_totals.js index 15d62cd3cb..047ec814b6 100644 --- a/erpnext/public/js/controllers/taxes_and_totals.js +++ b/erpnext/public/js/controllers/taxes_and_totals.js @@ -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"));