mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-23 15:09:20 +00:00
fix: Tax template update on supplier
This commit is contained in:
@@ -19,6 +19,7 @@ erpnext.setup_auto_gst_taxation = (doctype) => {
|
|||||||
'shipping_address': frm.doc.shipping_address || '',
|
'shipping_address': frm.doc.shipping_address || '',
|
||||||
'shipping_address_name': frm.doc.shipping_address_name || '',
|
'shipping_address_name': frm.doc.shipping_address_name || '',
|
||||||
'customer_address': frm.doc.customer_address || '',
|
'customer_address': frm.doc.customer_address || '',
|
||||||
|
'supplier_address': frm.doc.supplier_address,
|
||||||
'customer': frm.doc.customer,
|
'customer': frm.doc.customer,
|
||||||
'supplier': frm.doc.supplier,
|
'supplier': frm.doc.supplier,
|
||||||
'supplier_gstin': frm.doc.supplier_gstin,
|
'supplier_gstin': frm.doc.supplier_gstin,
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ from erpnext.regional.india import number_state_mapping
|
|||||||
from six import string_types
|
from six import string_types
|
||||||
from erpnext.accounts.general_ledger import make_gl_entries
|
from erpnext.accounts.general_ledger import make_gl_entries
|
||||||
from erpnext.accounts.utils import get_account_currency
|
from erpnext.accounts.utils import get_account_currency
|
||||||
|
from frappe.model.utils import get_fetch_values
|
||||||
|
|
||||||
def validate_gstin_for_india(doc, method):
|
def validate_gstin_for_india(doc, method):
|
||||||
if hasattr(doc, 'gst_state') and doc.gst_state:
|
if hasattr(doc, 'gst_state') and doc.gst_state:
|
||||||
@@ -161,6 +162,8 @@ def get_regional_address_details(party_details, doctype, company):
|
|||||||
party_details = json.loads(party_details)
|
party_details = json.loads(party_details)
|
||||||
party_details = frappe._dict(party_details)
|
party_details = frappe._dict(party_details)
|
||||||
|
|
||||||
|
update_party_details(party_details, doctype)
|
||||||
|
|
||||||
party_details.place_of_supply = get_place_of_supply(party_details, doctype)
|
party_details.place_of_supply = get_place_of_supply(party_details, doctype)
|
||||||
|
|
||||||
if is_internal_transfer(party_details, doctype):
|
if is_internal_transfer(party_details, doctype):
|
||||||
@@ -209,6 +212,11 @@ def get_regional_address_details(party_details, doctype, company):
|
|||||||
|
|
||||||
return party_details
|
return party_details
|
||||||
|
|
||||||
|
def update_party_details(party_details, doctype):
|
||||||
|
for address_field in ['shipping_address', 'company_address', 'supplier_address', 'shipping_address_name', 'customer_address']:
|
||||||
|
if party_details.get(address_field):
|
||||||
|
party_details.update(get_fetch_values(doctype, address_field, party_details.get(address_field)))
|
||||||
|
|
||||||
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"):
|
||||||
destination_gstin = party_details.company_gstin
|
destination_gstin = party_details.company_gstin
|
||||||
|
|||||||
Reference in New Issue
Block a user