feat(india): e-invoicing for intra-state union territory transactions
This commit is contained in:
parent
8e425252c4
commit
45fca6bed7
@ -10,6 +10,7 @@
|
|||||||
"sgst_account",
|
"sgst_account",
|
||||||
"igst_account",
|
"igst_account",
|
||||||
"cess_account",
|
"cess_account",
|
||||||
|
"utgst_account",
|
||||||
"is_reverse_charge_account"
|
"is_reverse_charge_account"
|
||||||
],
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
@ -64,12 +65,18 @@
|
|||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Is Reverse Charge Account"
|
"label": "Is Reverse Charge Account"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "utgst_account",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"label": "UTGST Account",
|
||||||
|
"options": "Account"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"istable": 1,
|
"istable": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2021-04-09 12:30:25.889993",
|
"modified": "2022-04-07 12:59:14.039768",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Accounts",
|
"module": "Accounts",
|
||||||
"name": "GST Account",
|
"name": "GST Account",
|
||||||
@ -78,5 +85,6 @@
|
|||||||
"quick_entry": 1,
|
"quick_entry": 1,
|
||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
|
"states": [],
|
||||||
"track_changes": 1
|
"track_changes": 1
|
||||||
}
|
}
|
||||||
@ -314,9 +314,13 @@ def update_item_taxes(invoice, item):
|
|||||||
item.cess_rate += item_tax_rate
|
item.cess_rate += item_tax_rate
|
||||||
item.cess_amount += abs(item_tax_amount_after_discount)
|
item.cess_amount += abs(item_tax_amount_after_discount)
|
||||||
|
|
||||||
for tax_type in ["igst", "cgst", "sgst"]:
|
for tax_type in ["igst", "cgst", "sgst", "utgst"]:
|
||||||
if t.account_head in gst_accounts[f"{tax_type}_account"]:
|
if t.account_head in gst_accounts[f"{tax_type}_account"]:
|
||||||
item.tax_rate += item_tax_rate
|
item.tax_rate += item_tax_rate
|
||||||
|
if tax_type == "utgst":
|
||||||
|
# utgst taxes are reported same as sgst tax
|
||||||
|
item["sgst_amount"] += abs(item_tax_amount)
|
||||||
|
else:
|
||||||
item[f"{tax_type}_amount"] += abs(item_tax_amount)
|
item[f"{tax_type}_amount"] += abs(item_tax_amount)
|
||||||
else:
|
else:
|
||||||
# TODO: other charges per item
|
# TODO: other charges per item
|
||||||
@ -359,11 +363,15 @@ def update_invoice_taxes(invoice, invoice_value_details):
|
|||||||
# using after discount amt since item also uses after discount amt for cess calc
|
# using after discount amt since item also uses after discount amt for cess calc
|
||||||
invoice_value_details.total_cess_amt += abs(t.base_tax_amount_after_discount_amount)
|
invoice_value_details.total_cess_amt += abs(t.base_tax_amount_after_discount_amount)
|
||||||
|
|
||||||
for tax_type in ["igst", "cgst", "sgst"]:
|
for tax_type in ["igst", "cgst", "sgst", "utgst"]:
|
||||||
if t.account_head in gst_accounts[f"{tax_type}_account"]:
|
if t.account_head in gst_accounts[f"{tax_type}_account"]:
|
||||||
|
if tax_type == "utgst":
|
||||||
|
invoice_value_details["total_sgst_amt"] += abs(tax_amount)
|
||||||
|
else:
|
||||||
invoice_value_details[f"total_{tax_type}_amt"] += abs(tax_amount)
|
invoice_value_details[f"total_{tax_type}_amt"] += abs(tax_amount)
|
||||||
|
|
||||||
update_other_charges(t, invoice_value_details, gst_accounts_list, invoice, considered_rows)
|
update_other_charges(t, invoice_value_details, gst_accounts_list, invoice, considered_rows)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
invoice_value_details.total_other_charges += abs(tax_amount)
|
invoice_value_details.total_other_charges += abs(tax_amount)
|
||||||
|
|
||||||
|
|||||||
@ -824,7 +824,7 @@ def get_gst_accounts(
|
|||||||
gst_settings_accounts = frappe.get_all(
|
gst_settings_accounts = frappe.get_all(
|
||||||
"GST Account",
|
"GST Account",
|
||||||
filters=filters,
|
filters=filters,
|
||||||
fields=["cgst_account", "sgst_account", "igst_account", "cess_account"],
|
fields=["cgst_account", "sgst_account", "igst_account", "cess_account", "utgst_account"],
|
||||||
)
|
)
|
||||||
|
|
||||||
if not gst_settings_accounts and not frappe.flags.in_test and not frappe.flags.in_migrate:
|
if not gst_settings_accounts and not frappe.flags.in_test and not frappe.flags.in_migrate:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user