From bbc705860b9bfbb94c02bcba1995dcf9a92aa5eb Mon Sep 17 00:00:00 2001 From: Smit Vora Date: Fri, 11 Aug 2023 18:26:11 +0530 Subject: [PATCH] fix: exclude cess rate in hsn summary table --- .../hsn_wise_summary_of_outward_supplies.py | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/india_compliance/gst_india/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_outward_supplies.py b/india_compliance/gst_india/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_outward_supplies.py index 5f3cd6db6..eb123e478 100644 --- a/india_compliance/gst_india/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_outward_supplies.py +++ b/india_compliance/gst_india/report/hsn_wise_summary_of_outward_supplies/hsn_wise_summary_of_outward_supplies.py @@ -10,6 +10,7 @@ from frappe.utils import cstr, flt, getdate import erpnext +from india_compliance.gst_india.constants import GST_ACCOUNT_FIELDS from india_compliance.gst_india.report.gstr_1.gstr_1 import get_company_gstin_number from india_compliance.gst_india.utils import get_gst_accounts_by_type, get_gst_uom @@ -19,12 +20,17 @@ def execute(filters=None): filters = {} columns = get_columns() + output_gst_accounts_dict = get_gst_accounts_by_type(filters.company, "Output") - output_gst_accounts = { - account - for account in get_gst_accounts_by_type(filters.company, "Output").values() - if account - } + output_gst_accounts = set() + non_cess_accounts = set() + for account_type, account_name in output_gst_accounts_dict.items(): + if not account_name: + continue + + output_gst_accounts.add(account_name) + if account_type in GST_ACCOUNT_FIELDS[:3]: + non_cess_accounts.add(account_name) company_currency = erpnext.get_company_currency(filters.company) item_list = get_items(filters) @@ -53,8 +59,9 @@ def execute(filters=None): item_tax = itemised_tax.get((d.parent, d.item_code), {}) for tax in tax_columns: tax_data = item_tax.get(tax, {}) - tax_rate += flt(tax_data.get("tax_rate", 0)) total_tax += flt(tax_data.get("tax_amount", 0)) + if tax in non_cess_accounts: + tax_rate += flt(tax_data.get("tax_rate", 0)) row = [ d.gst_hsn_code,