From fc2b42ed2477604968009512816f712f18dda9e2 Mon Sep 17 00:00:00 2001 From: Ninad1306 Date: Mon, 12 Aug 2024 11:22:24 +0530 Subject: [PATCH] fix: multiple taxes table appended --- .../gst_india/overrides/subcontracting_transaction.py | 9 +++++++++ india_compliance/hooks.py | 1 + 2 files changed, 10 insertions(+) diff --git a/india_compliance/gst_india/overrides/subcontracting_transaction.py b/india_compliance/gst_india/overrides/subcontracting_transaction.py index 390e4d1a9..52a3aa276 100644 --- a/india_compliance/gst_india/overrides/subcontracting_transaction.py +++ b/india_compliance/gst_india/overrides/subcontracting_transaction.py @@ -35,6 +35,7 @@ SUBCONTRACTING_ORDER_RECEIPT_FIELD_MAP = {"total_taxable_value": "total"} +# Functions to perform operations before and after mapping of transactions def after_mapping_subcontracting_order(doc, method, source_doc): if source_doc.doctype != "Purchase Order": return @@ -75,6 +76,13 @@ def after_mapping_stock_entry(doc, method, source_doc): doc.taxes = [] +def before_mapping_subcontracting_receipt(doc, method, source_doc, table_maps): + table_maps["India Compliance Taxes and Charges"] = { + "doctype": "India Compliance Taxes and Charges", + "add_if_empty": True, + } + + def set_taxes(doc): accounts = get_gst_accounts_by_type(doc.company, "Output", throw=False) if not accounts: @@ -116,6 +124,7 @@ def set_taxes(doc): ) +# Common Functions for Suncontracting Transactions def get_dashboard_data(data): doctype = ( "Subcontracting Receipt" diff --git a/india_compliance/hooks.py b/india_compliance/hooks.py index aa54bd893..a570caead 100644 --- a/india_compliance/hooks.py +++ b/india_compliance/hooks.py @@ -243,6 +243,7 @@ "Subcontracting Receipt": { "onload": "india_compliance.gst_india.overrides.subcontracting_transaction.onload", "validate": "india_compliance.gst_india.overrides.subcontracting_transaction.validate", + "before_mapping": "india_compliance.gst_india.overrides.subcontracting_transaction.before_mapping_subcontracting_receipt", }, "Supplier": { "validate": [