From 1cb8c64c94858134c4765f2c21ebbce7394ec795 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 19 Sep 2023 19:44:29 +0530 Subject: [PATCH] fix: after applying coupon code, field in_words not updated (#37133) fix: after applying coupon code, field in_words not updated (#37133) * fix: after applying coupon code, field in_words not updated * fix: changed the order of the function set_total_in_words (cherry picked from commit 03f0abf6ded44021583041b53355737bf385660b) Co-authored-by: RitvikSardana <65544983+RitvikSardana@users.noreply.github.com> --- erpnext/controllers/accounts_controller.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index df77e5260f5d..bd2354e74522 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -168,7 +168,6 @@ def validate(self): self.validate_value("base_grand_total", ">=", 0) validate_return(self) - self.set_total_in_words() self.validate_all_documents_schedule() @@ -207,6 +206,8 @@ def validate(self): if self.doctype != "Material Request" and not self.ignore_pricing_rule: apply_pricing_rule_on_transaction(self) + self.set_total_in_words() + def before_cancel(self): validate_einvoice_fields(self)