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 bc184ed76f9a476e7ed320a012b1f80af3627aa5..8cd282c8bf9332e87fe5f6aa1acdbd4888612606 100644 --- a/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py +++ b/erpnext/accounts/doctype/tax_withholding_category/tax_withholding_category.py @@ -354,12 +354,14 @@ def get_invoice_vouchers(parties, tax_details, company, party_type="Supplier"): AND ja.party in %s AND j.apply_tds = 1 AND j.tax_withholding_category = %s + AND j.company = %s """, ( tax_details.from_date, tax_details.to_date, tuple(parties), tax_details.get("tax_withholding_category"), + company, ), as_dict=1, ) @@ -477,6 +479,7 @@ def get_tds_amount(ldc, parties, inv, tax_details, vouchers): "unallocated_amount": (">", 0), "posting_date": ["between", (tax_details.from_date, tax_details.to_date)], "tax_withholding_category": tax_details.get("tax_withholding_category"), + "company": inv.company, } field = "sum(tax_withholding_net_total)"