From 3c10d809b0f88d372793c5dd8be218c0dc01be73 Mon Sep 17 00:00:00 2001 From: Lakshit Jain <108322669+ljain112@users.noreply.github.com> Date: Fri, 17 Jan 2025 16:50:15 +0530 Subject: [PATCH] fix: round off tax withholding amount (#45271) (cherry picked from commit ada272a29bf5b0c1ab2115a3d72b3d8a80bec11a) --- .../tax_withholding_category/tax_withholding_category.py | 3 +++ erpnext/controllers/taxes_and_totals.py | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py index ace139ce15a..53a2e279a4d 100644 --- a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py +++ b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py @@ -156,6 +156,9 @@ def get_party_tax_withholding_details(inv, tax_withholding_category=None): } ) + if cint(tax_details.round_off_tax_amount): + inv.round_off_applicable_accounts_for_tax_withholding = tax_details.account_head + if inv.doctype == "Purchase Invoice": return tax_row, tax_deducted_on_advances, voucher_wise_amount else: diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py index 8fecb177295..b6315df3246 100644 --- a/erpnext/controllers/taxes_and_totals.py +++ b/erpnext/controllers/taxes_and_totals.py @@ -30,6 +30,11 @@ class calculate_taxes_and_totals: "Accounts Settings", "round_row_wise_tax" ) + if doc.get("round_off_applicable_accounts_for_tax_withholding"): + frappe.flags.round_off_applicable_accounts.append( + doc.round_off_applicable_accounts_for_tax_withholding + ) + self._items = self.filter_rows() if self.doc.doctype == "Quotation" else self.doc.get("items") get_round_off_applicable_accounts(self.doc.company, frappe.flags.round_off_applicable_accounts)