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 ce82fb2325d3ed18aa86018789e56558d39c120d..7382aaabb16313685a29eff33966976428557b80 100644 --- a/erpnext/accounts/report/tax_withholding_details/tax_withholding_details.py +++ b/erpnext/accounts/report/tax_withholding_details/tax_withholding_details.py @@ -12,7 +12,7 @@ def execute(filters=None): else: party_naming_by = frappe.db.get_single_value("Buying Settings", "supp_master_name") - filters.update({"naming_series": party_naming_by}) + filters["naming_series"] = party_naming_by validate_filters(filters) ( @@ -65,21 +65,23 @@ def get_result( tax_withholding_category = tds_accounts.get(entry.account) # or else the consolidated value from the voucher document if not tax_withholding_category: - tax_withholding_category = tax_category_map.get(name) + tax_withholding_category = tax_category_map.get((voucher_type, name)) # or else from the party default if not tax_withholding_category: tax_withholding_category = party_map.get(party, {}).get("tax_withholding_category") rate = tax_rate_map.get(tax_withholding_category) - if net_total_map.get(name): + if net_total_map.get((voucher_type, name)): if voucher_type == "Journal Entry" and tax_amount and rate: # back calcalute total amount from rate and tax_amount if rate: total_amount = grand_total = base_total = tax_amount / (rate / 100) elif voucher_type == "Purchase Invoice": - total_amount, grand_total, base_total, bill_no, bill_date = net_total_map.get(name) + total_amount, grand_total, base_total, bill_no, bill_date = net_total_map.get( + (voucher_type, name) + ) else: - total_amount, grand_total, base_total = net_total_map.get(name) + total_amount, grand_total, base_total = net_total_map.get((voucher_type, name)) else: total_amount += entry.credit @@ -99,7 +101,7 @@ def get_result( } if filters.naming_series == "Naming Series": - row.update({"party_name": party_map.get(party, {}).get(party_name)}) + row["party_name"] = party_map.get(party, {}).get(party_name) row.update( { @@ -418,7 +420,7 @@ def get_doc_info(vouchers, doctype, tax_category_map, net_total_map=None): ) for entry in entries: - tax_category_map.update({entry.name: entry.tax_withholding_category}) + tax_category_map[(doctype, entry.name)] = entry.tax_withholding_category if doctype == "Purchase Invoice": value = [ entry.base_tax_withholding_net_total, @@ -433,7 +435,8 @@ def get_doc_info(vouchers, doctype, tax_category_map, net_total_map=None): value = [entry.paid_amount, entry.paid_amount_after_tax, entry.base_paid_amount] else: value = [entry.total_amount] * 3 - net_total_map.update({entry.name: value}) + + net_total_map[(doctype, entry.name)] = value def get_tax_rate_map(filters):