From c2e67599f5708efe72f5b6f4a8f0b2258b867b63 Mon Sep 17 00:00:00 2001 From: ljain112 Date: Mon, 9 Mar 2026 19:14:21 +0530 Subject: [PATCH] fix: refactor GL entry mapping to include voucher type --- .../tax_withholding_details/tax_withholding_details.py | 5 ++--- 1 file changed, 2 insertions(+), 3 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 bf6d67c6d98..d93c60b2cf4 100644 --- a/erpnext/accounts/report/tax_withholding_details/tax_withholding_details.py +++ b/erpnext/accounts/report/tax_withholding_details/tax_withholding_details.py @@ -46,13 +46,12 @@ def get_result(filters, tds_accounts, tax_category_map, net_total_map): precision = get_currency_precision() entries = {} - for name, details in gle_map.items(): + for (voucher_type, name), details in gle_map.items(): for entry in details: 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 = "", "" posting_date = entry.posting_date - voucher_type = entry.voucher_type values = net_total_map.get((voucher_type, name)) party = values.party if values else (entry.party or entry.against) @@ -197,7 +196,7 @@ def get_gle_map(net_total_map): gle_map = {} for d in rows: - gle_map.setdefault(d.voucher_no, []).append(d) + gle_map.setdefault((d.voucher_type, d.voucher_no), []).append(d) return gle_map