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": [