diff --git a/erpnext/regional/saudi_arabia/wizard/operations/setup_ksa_vat_setting.py b/erpnext/regional/saudi_arabia/wizard/operations/setup_ksa_vat_setting.py index 4bccdc35bf..c30fcffc37 100644 --- a/erpnext/regional/saudi_arabia/wizard/operations/setup_ksa_vat_setting.py +++ b/erpnext/regional/saudi_arabia/wizard/operations/setup_ksa_vat_setting.py @@ -1,11 +1,13 @@ -import frappe -import os import json +import os + +import frappe + from erpnext.setup.setup_wizard.operations.taxes_setup import setup_taxes_and_charges + def create_ksa_vat_setting(company): - """ - On creation of first company. Creates KSA VAT Setting""" + """On creation of first company. Creates KSA VAT Setting""" company = frappe.get_doc('Company', company) setup_taxes_and_charges(company.name, company.country) @@ -13,14 +15,14 @@ def create_ksa_vat_setting(company): file_path = os.path.join(os.path.dirname(__file__), '..', 'data', 'ksa_vat_settings.json') with open(file_path, 'r') as json_file: account_data = json.load(json_file) - + # Creating KSA VAT Setting ksa_vat_setting = frappe.get_doc({ 'doctype': 'KSA VAT Setting', 'company': company.name }) - + for data in account_data: if data['type'] == 'Sales Account': for row in data['accounts']: @@ -31,7 +33,7 @@ def create_ksa_vat_setting(company): 'item_tax_template': f'{item_tax_template} - {company.abbr}', 'account': f'{account} - {company.abbr}' }) - + elif data['type'] == 'Purchase Account': for row in data['accounts']: item_tax_template = row['item_tax_template']