Place of Supply set on save Delivery Note if Customer Address Present (#13492)
This commit is contained in:
parent
d5f9ebd008
commit
2505c74d64
@ -204,7 +204,7 @@ doc_events = {
|
|||||||
'Address': {
|
'Address': {
|
||||||
'validate': 'erpnext.regional.india.utils.validate_gstin_for_india'
|
'validate': 'erpnext.regional.india.utils.validate_gstin_for_india'
|
||||||
},
|
},
|
||||||
('Sales Invoice', 'Purchase Invoice'): {
|
('Sales Invoice', 'Purchase Invoice', 'Delivery Note'): {
|
||||||
'validate': 'erpnext.regional.india.utils.set_place_of_supply'
|
'validate': 'erpnext.regional.india.utils.set_place_of_supply'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,7 +64,7 @@ def get_itemised_tax_breakup_data(doc):
|
|||||||
def set_place_of_supply(doc, method):
|
def set_place_of_supply(doc, method):
|
||||||
if not frappe.get_meta('Address').has_field('gst_state'): return
|
if not frappe.get_meta('Address').has_field('gst_state'): return
|
||||||
|
|
||||||
if doc.doctype == "Sales Invoice":
|
if doc.doctype in ("Sales Invoice", "Delivery Note"):
|
||||||
address_name = doc.shipping_address_name or doc.customer_address
|
address_name = doc.shipping_address_name or doc.customer_address
|
||||||
elif doc.doctype == "Purchase Invoice":
|
elif doc.doctype == "Purchase Invoice":
|
||||||
address_name = doc.shipping_address or doc.supplier_address
|
address_name = doc.shipping_address or doc.supplier_address
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user