From 5bfdc010f3392d8df3e7b3841218df8456a84e62 Mon Sep 17 00:00:00 2001 From: Sagar Vora <16315650+sagarvora@users.noreply.github.com> Date: Thu, 11 Dec 2025 22:37:59 +0530 Subject: [PATCH] fix: re-calculate outstanding / write-off amount during submission (cherry picked from commit 09c9ac1b6636a850349c5710c1c07077f873cf3e) --- erpnext/controllers/taxes_and_totals.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py index f059f2908bd..571f9ad4b14 100644 --- a/erpnext/controllers/taxes_and_totals.py +++ b/erpnext/controllers/taxes_and_totals.py @@ -853,12 +853,11 @@ class calculate_taxes_and_totals: ) ) - if self.doc.docstatus.is_draft(): - if self.doc.get("write_off_outstanding_amount_automatically"): - self.doc.write_off_amount = 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() + self.calculate_outstanding_amount() + self.calculate_write_off_amount() def is_internal_invoice(self): """