fix: company filter added again
This commit is contained in:
parent
410db04b48
commit
cd05b34691
@ -160,7 +160,7 @@ def get_regional_address_details(party_details, doctype, company, return_taxes=N
|
|||||||
if is_internal_transfer(party_details, doctype):
|
if is_internal_transfer(party_details, doctype):
|
||||||
party_details.taxes_and_charges = ''
|
party_details.taxes_and_charges = ''
|
||||||
party_details.taxes = ''
|
party_details.taxes = ''
|
||||||
return
|
return party_details
|
||||||
|
|
||||||
if doctype in ("Sales Invoice", "Delivery Note", "Sales Order"):
|
if doctype in ("Sales Invoice", "Delivery Note", "Sales Order"):
|
||||||
master_doctype = "Sales Taxes and Charges Template"
|
master_doctype = "Sales Taxes and Charges Template"
|
||||||
@ -168,26 +168,26 @@ def get_regional_address_details(party_details, doctype, company, return_taxes=N
|
|||||||
get_tax_template_for_sez(party_details, master_doctype, company, 'Customer')
|
get_tax_template_for_sez(party_details, master_doctype, company, 'Customer')
|
||||||
get_tax_template_based_on_category(master_doctype, company, party_details)
|
get_tax_template_based_on_category(master_doctype, company, party_details)
|
||||||
|
|
||||||
if party_details.get('taxes_and_charges') and return_taxes:
|
if party_details.get('taxes_and_charges'):
|
||||||
return party_details
|
return party_details
|
||||||
|
|
||||||
if not party_details.company_gstin:
|
if not party_details.company_gstin:
|
||||||
return
|
return party_details
|
||||||
|
|
||||||
elif doctype in ("Purchase Invoice", "Purchase Order", "Purchase Receipt"):
|
elif doctype in ("Purchase Invoice", "Purchase Order", "Purchase Receipt"):
|
||||||
master_doctype = "Purchase Taxes and Charges Template"
|
master_doctype = "Purchase Taxes and Charges Template"
|
||||||
get_tax_template_for_sez(party_details, master_doctype, company, 'Supplier')
|
get_tax_template_for_sez(party_details, master_doctype, company, 'Supplier')
|
||||||
get_tax_template_based_on_category(master_doctype, company, party_details)
|
get_tax_template_based_on_category(master_doctype, company, party_details)
|
||||||
|
|
||||||
if party_details.get('taxes_and_charges') and return_taxes:
|
if party_details.get('taxes_and_charges'):
|
||||||
return party_details
|
return party_details
|
||||||
|
|
||||||
if not party_details.supplier_gstin:
|
if not party_details.supplier_gstin:
|
||||||
return
|
return party_details
|
||||||
|
|
||||||
if not party_details.place_of_supply: return
|
if not party_details.place_of_supply: return party_details
|
||||||
|
|
||||||
if not party_details.company_gstin: return
|
if not party_details.company_gstin: return party_details
|
||||||
|
|
||||||
if ((doctype in ("Sales Invoice", "Delivery Note", "Sales Order") and party_details.company_gstin
|
if ((doctype in ("Sales Invoice", "Delivery Note", "Sales Order") and party_details.company_gstin
|
||||||
and party_details.company_gstin[:2] != party_details.place_of_supply[:2]) or (doctype in ("Purchase Invoice",
|
and party_details.company_gstin[:2] != party_details.place_of_supply[:2]) or (doctype in ("Purchase Invoice",
|
||||||
@ -197,12 +197,11 @@ def get_regional_address_details(party_details, doctype, company, return_taxes=N
|
|||||||
default_tax = get_tax_template(master_doctype, company, 0, party_details.company_gstin[:2])
|
default_tax = get_tax_template(master_doctype, company, 0, party_details.company_gstin[:2])
|
||||||
|
|
||||||
if not default_tax:
|
if not default_tax:
|
||||||
return
|
return party_details
|
||||||
party_details["taxes_and_charges"] = default_tax
|
party_details["taxes_and_charges"] = default_tax
|
||||||
party_details.taxes = get_taxes_and_charges(master_doctype, default_tax)
|
party_details.taxes = get_taxes_and_charges(master_doctype, default_tax)
|
||||||
|
|
||||||
if return_taxes:
|
return party_details
|
||||||
return party_details
|
|
||||||
|
|
||||||
def is_internal_transfer(party_details, doctype):
|
def is_internal_transfer(party_details, doctype):
|
||||||
if doctype in ("Sales Invoice", "Delivery Note", "Sales Order"):
|
if doctype in ("Sales Invoice", "Delivery Note", "Sales Order"):
|
||||||
@ -236,7 +235,7 @@ def get_tax_template(master_doctype, company, is_inter_state, state_code):
|
|||||||
if tax_category.gst_state == number_state_mapping[state_code] or \
|
if tax_category.gst_state == number_state_mapping[state_code] or \
|
||||||
(not default_tax and not tax_category.gst_state):
|
(not default_tax and not tax_category.gst_state):
|
||||||
default_tax = frappe.db.get_value(master_doctype,
|
default_tax = frappe.db.get_value(master_doctype,
|
||||||
{'disabled': 0, 'tax_category': tax_category.name}, 'name')
|
{'company': company, 'disabled': 0, 'tax_category': tax_category.name}, 'name')
|
||||||
return default_tax
|
return default_tax
|
||||||
|
|
||||||
def get_tax_template_for_sez(party_details, master_doctype, company, party_type):
|
def get_tax_template_for_sez(party_details, master_doctype, company, party_type):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user