fix: merge conflict

This commit is contained in:
Nabin Hait
2021-07-16 15:58:50 +05:30
24 changed files with 462 additions and 1149 deletions

View File

@@ -26,7 +26,7 @@ def setup_taxes_and_charges(company_name: str, country: str):
if 'chart_of_accounts' not in country_wise_tax:
country_wise_tax = simple_to_detailed(country_wise_tax)
from_detailed_data(company_name, country_wise_tax.get('chart_of_accounts'))
from_detailed_data(company_name, country_wise_tax)
update_regional_tax_settings(country, company_name)
@@ -78,11 +78,12 @@ def simple_to_detailed(templates):
def from_detailed_data(company_name, data):
"""Create Taxes and Charges Templates from detailed data."""
coa_name = frappe.db.get_value('Company', company_name, 'chart_of_accounts')
tax_templates = data.get(coa_name) or data.get('*')
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')
coa_data = data.get('chart_of_accounts', {})
tax_templates = coa_data.get(coa_name) or coa_data.get('*', {})
tax_categories = data.get('tax_categories')
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('*', {})
if tax_categories:
for tax_category in tax_categories: