From e30ab141f4bc51b1378eb80d1bf3885453afbcfe Mon Sep 17 00:00:00 2001 From: Imesha Sudasingha Date: Mon, 28 Oct 2024 03:43:56 +0000 Subject: [PATCH] fix: add parenttype clause to invoice tax query in sales_register report --- erpnext/accounts/report/sales_register/sales_register.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/report/sales_register/sales_register.py b/erpnext/accounts/report/sales_register/sales_register.py index 6c0bf91e3f8..34d53238f50 100644 --- a/erpnext/accounts/report/sales_register/sales_register.py +++ b/erpnext/accounts/report/sales_register/sales_register.py @@ -526,7 +526,8 @@ def get_invoice_tax_map(invoice_list, invoice_income_map, income_accounts, inclu tax_details = frappe.db.sql( """select parent, account_head, sum(base_tax_amount_after_discount_amount) as tax_amount - from `tabSales Taxes and Charges` where parent in (%s) group by parent, account_head""" + from `tabSales Taxes and Charges` where parent in (%s) and parenttype = 'Sales Invoice' + group by parent, account_head""" % ", ".join(["%s"] * len(invoice_list)), tuple(inv.name for inv in invoice_list), as_dict=1,