Skip to content

Commit

Permalink
fix: multiple taxes table appended
Browse files Browse the repository at this point in the history
  • Loading branch information
Ninad1306 committed Aug 12, 2024
1 parent 5c17534 commit fc2b42e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -116,6 +124,7 @@ def set_taxes(doc):
)


# Common Functions for Suncontracting Transactions
def get_dashboard_data(data):
doctype = (
"Subcontracting Receipt"
Expand Down
1 change: 1 addition & 0 deletions india_compliance/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down

0 comments on commit fc2b42e

Please sign in to comment.