fix: Add tax categories on company setup
diff --git a/erpnext/setup/setup_wizard/data/country_wise_tax.json b/erpnext/setup/setup_wizard/data/country_wise_tax.json
index 3119eee..e3fde60 100644
--- a/erpnext/setup/setup_wizard/data/country_wise_tax.json
+++ b/erpnext/setup/setup_wizard/data/country_wise_tax.json
@@ -818,6 +818,28 @@
"India": {
"chart_of_accounts": {
"*": {
+ "tax_categories": [
+ {
+ "title": "In-Sate",
+ "is_inter_state": 0,
+ "gst_state": ""
+ },
+ {
+ "title": "Out-Sate",
+ "is_inter_state": 1,
+ "gst_state": ""
+ },
+ {
+ "title": "Reverse Charge",
+ "is_inter_state": 0,
+ "gst_state": ""
+ },
+ {
+ "title": "Registered Composition",
+ "is_inter_state": 0,
+ "gst_state": ""
+ }
+ ],
"item_tax_templates": [
{
"title": "GST 9%",
diff --git a/erpnext/setup/setup_wizard/operations/taxes_setup.py b/erpnext/setup/setup_wizard/operations/taxes_setup.py
index 429a558..578a270 100644
--- a/erpnext/setup/setup_wizard/operations/taxes_setup.py
+++ b/erpnext/setup/setup_wizard/operations/taxes_setup.py
@@ -78,6 +78,7 @@
sales_tax_templates = tax_templates.get('sales_tax_templates') or tax_templates.get('*')
purchase_tax_templates = tax_templates.get('purchase_tax_templates') or tax_templates.get('*')
item_tax_templates = tax_templates.get('item_tax_templates') or tax_templates.get('*')
+ tax_categories = tax_templates.get('tax_categories')
if sales_tax_templates:
for template in sales_tax_templates:
@@ -91,6 +92,10 @@
for template in item_tax_templates:
make_item_tax_template(company_name, template)
+ if tax_categories:
+ for tax_category in tax_categories:
+ make_tax_category(tax_category)
+
def make_taxes_and_charges_template(company_name, doctype, template):
template['company'] = company_name
@@ -146,6 +151,11 @@
return frappe.get_doc(template).insert(ignore_permissions=True)
+def make_tax_category(tax_category):
+ """ Make tax category based on title if not already created """
+ doctype = 'Tax Category'
+ if not frappe.db.exists(doctype, tax_category)
+ frappe.get_doc(tax_category).insert(ignore_permissions=True)
def get_or_create_account(company_name, account):
"""