From b740846b68dd0220b3f59bbfdff0ac048f5ce9c4 Mon Sep 17 00:00:00 2001 From: ljain112 Date: Tue, 10 Feb 2026 13:08:35 +0530 Subject: [PATCH 1/4] refactor: update labels for tax withholding reports columns to improve clarity --- .../tax_withholding_details.py | 18 +++++++++--------- .../tds_computation_summary.py | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/erpnext/accounts/report/tax_withholding_details/tax_withholding_details.py b/erpnext/accounts/report/tax_withholding_details/tax_withholding_details.py index 78fc08614f2..b6ca8bc60ec 100644 --- a/erpnext/accounts/report/tax_withholding_details/tax_withholding_details.py +++ b/erpnext/accounts/report/tax_withholding_details/tax_withholding_details.py @@ -252,17 +252,11 @@ def get_columns(filters): "width": 60, }, { - "label": _("Total Amount"), + "label": _("Taxable Amount"), "fieldname": "total_amount", "fieldtype": "Float", "width": 120, }, - { - "label": _("Base Total"), - "fieldname": "base_total", - "fieldtype": "Float", - "width": 120, - }, { "label": _("TDS Amount") if filters.get("party_type") == "Supplier" else _("TCS Amount"), "fieldname": "tax_amount", @@ -270,10 +264,16 @@ def get_columns(filters): "width": 120, }, { - "label": _("Grand Total"), + "label": _("Grand Total (Company Currency)"), + "fieldname": "base_total", + "fieldtype": "Float", + "width": 150, + }, + { + "label": _("Grand Total (Transaction Currency)"), "fieldname": "grand_total", "fieldtype": "Float", - "width": 120, + "width": 170, }, {"label": _("Transaction Type"), "fieldname": "transaction_type", "width": 130}, { diff --git a/erpnext/accounts/report/tds_computation_summary/tds_computation_summary.py b/erpnext/accounts/report/tds_computation_summary/tds_computation_summary.py index e14d9320fa2..1b5292f6bde 100644 --- a/erpnext/accounts/report/tds_computation_summary/tds_computation_summary.py +++ b/erpnext/accounts/report/tds_computation_summary/tds_computation_summary.py @@ -128,7 +128,7 @@ def get_columns(filters): "width": 120, }, { - "label": _("Total Amount"), + "label": _("Total Taxable Amount"), "fieldname": "total_amount", "fieldtype": "Float", "width": 120, From ed42d5498912966a32e8a1999d062c85c4288d1d Mon Sep 17 00:00:00 2001 From: ljain112 Date: Tue, 10 Feb 2026 13:30:12 +0530 Subject: [PATCH 2/4] fix: add base_tax_withholding_net_total to tax withholding report --- .../tax_withholding_details.py | 13 ++++++++++++- .../test_tax_withholding_details.py | 15 ++++++++------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/erpnext/accounts/report/tax_withholding_details/tax_withholding_details.py b/erpnext/accounts/report/tax_withholding_details/tax_withholding_details.py index b6ca8bc60ec..81278211d36 100644 --- a/erpnext/accounts/report/tax_withholding_details/tax_withholding_details.py +++ b/erpnext/accounts/report/tax_withholding_details/tax_withholding_details.py @@ -51,7 +51,7 @@ def get_result(filters, tds_docs, tds_accounts, tax_category_map, journal_entry_ entries = {} for name, details in gle_map.items(): for entry in details: - tax_amount, total_amount, grand_total, base_total = 0, 0, 0, 0 + tax_amount, total_amount, grand_total, base_total, base_tax_withholding_net_total = 0, 0, 0, 0, 0 tax_withholding_category, rate = None, None bill_no, bill_date = "", "" party = entry.party or entry.against @@ -93,12 +93,16 @@ def get_result(filters, tds_docs, tds_accounts, tax_category_map, journal_entry_ grand_total = values[1] base_total = values[2] + base_tax_withholding_net_total = total_amount if voucher_type == "Purchase Invoice": + base_tax_withholding_net_total = values[0] bill_no = values[3] bill_date = values[4] + else: total_amount += entry.credit + base_tax_withholding_net_total = total_amount if tax_amount: if party_map.get(party, {}).get("party_type") == "Supplier": @@ -125,6 +129,7 @@ def get_result(filters, tds_docs, tds_accounts, tax_category_map, journal_entry_ "rate": rate, "total_amount": total_amount, "grand_total": grand_total, + "base_tax_withholding_net_total": base_tax_withholding_net_total, "base_total": base_total, "tax_amount": tax_amount, "transaction_date": posting_date, @@ -251,6 +256,12 @@ def get_columns(filters): "fieldtype": "Percent", "width": 60, }, + { + "label": _("Tax Withholding Net Total"), + "fieldname": "base_tax_withholding_net_total", + "fieldtype": "Float", + "width": 150, + }, { "label": _("Taxable Amount"), "fieldname": "total_amount", diff --git a/erpnext/accounts/report/tax_withholding_details/test_tax_withholding_details.py b/erpnext/accounts/report/tax_withholding_details/test_tax_withholding_details.py index 853ae71abe3..33666c912b2 100644 --- a/erpnext/accounts/report/tax_withholding_details/test_tax_withholding_details.py +++ b/erpnext/accounts/report/tax_withholding_details/test_tax_withholding_details.py @@ -35,9 +35,9 @@ class TestTaxWithholdingDetails(AccountsTestMixin, FrappeTestCase): result = execute(filters)[1] expected_values = [ # Check for JV totals using back calculation logic - [jv.name, "TCS", 0.075, -10000.0, -7.5, -10000.0], - [pe.name, "TCS", 0.075, 2550, 0.53, 2550.53], - [si.name, "TCS", 0.075, 1000, 0.52, 1000.52], + [jv.name, "TCS", 0.075, -10000.0, -10000.0, -7.5, -10000.0], + [pe.name, "TCS", 0.075, 2550, 2550, 0.53, 2550.53], + [si.name, "TCS", 0.075, 1000, 1000, 0.52, 1000.52], ] self.check_expected_values(result, expected_values) @@ -55,8 +55,8 @@ class TestTaxWithholdingDetails(AccountsTestMixin, FrappeTestCase): frappe._dict(company="_Test Company", party_type="Supplier", from_date=today(), to_date=today()) )[1] expected_values = [ - [inv_1.name, "TDS - 1", 10, 5000, 500, 5500], - [inv_2.name, "TDS - 2", 20, 5000, 1000, 6000], + [inv_1.name, "TDS - 1", 10, 5000, 5000, 500, 5500], + [inv_2.name, "TDS - 2", 20, 5000, 5000, 1000, 6000], ] self.check_expected_values(result, expected_values) @@ -107,8 +107,8 @@ class TestTaxWithholdingDetails(AccountsTestMixin, FrappeTestCase): )[1] expected_values = [ - [inv_1.name, "TDS - 3", 10.0, 5000, 500, 4500], - [inv_2.name, "TDS - 3", 20.0, 5000, 1000, 4000], + [inv_1.name, "TDS - 3", 10.0, 5000, 5000, 500, 4500], + [inv_2.name, "TDS - 3", 20.0, 5000, 5000, 1000, 4000], ] self.check_expected_values(result, expected_values) @@ -120,6 +120,7 @@ class TestTaxWithholdingDetails(AccountsTestMixin, FrappeTestCase): voucher.ref_no, voucher.section_code, voucher.rate, + voucher.base_tax_withholding_net_total, voucher.base_total, voucher.tax_amount, voucher.grand_total, From 68099a9b5c5be97036d42b11c7cd6e97b16fa69f Mon Sep 17 00:00:00 2001 From: ljain112 Date: Tue, 10 Feb 2026 13:53:31 +0530 Subject: [PATCH 3/4] fix: set base_tax_withholding_net_total for jv in tds report --- .../report/tax_withholding_details/tax_withholding_details.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/accounts/report/tax_withholding_details/tax_withholding_details.py b/erpnext/accounts/report/tax_withholding_details/tax_withholding_details.py index 81278211d36..9fb40938d59 100644 --- a/erpnext/accounts/report/tax_withholding_details/tax_withholding_details.py +++ b/erpnext/accounts/report/tax_withholding_details/tax_withholding_details.py @@ -83,6 +83,7 @@ def get_result(filters, tds_docs, tds_accounts, tax_category_map, journal_entry_ # back calculate total amount from rate and tax_amount base_total = min(flt(tax_amount / (rate / 100), precision=precision), values[0]) total_amount = grand_total = base_total + base_tax_withholding_net_total = total_amount else: if tax_amount and rate: From e57f3fe727e52d3879bd4dfdbd8d9e0228c7fd7c Mon Sep 17 00:00:00 2001 From: ljain112 Date: Tue, 10 Feb 2026 14:40:53 +0530 Subject: [PATCH 4/4] test: update expected values for tax withholding calculations in tests --- .../tax_withholding_details/test_tax_withholding_details.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/report/tax_withholding_details/test_tax_withholding_details.py b/erpnext/accounts/report/tax_withholding_details/test_tax_withholding_details.py index 33666c912b2..56dba9d86d3 100644 --- a/erpnext/accounts/report/tax_withholding_details/test_tax_withholding_details.py +++ b/erpnext/accounts/report/tax_withholding_details/test_tax_withholding_details.py @@ -36,8 +36,8 @@ class TestTaxWithholdingDetails(AccountsTestMixin, FrappeTestCase): expected_values = [ # Check for JV totals using back calculation logic [jv.name, "TCS", 0.075, -10000.0, -10000.0, -7.5, -10000.0], - [pe.name, "TCS", 0.075, 2550, 2550, 0.53, 2550.53], - [si.name, "TCS", 0.075, 1000, 1000, 0.52, 1000.52], + [pe.name, "TCS", 0.075, 706.67, 2550.0, 0.53, 2550.53], + [si.name, "TCS", 0.075, 693.33, 1000.0, 0.52, 1000.52], ] self.check_expected_values(result, expected_values)