fix: place of supply change when address changes

This commit is contained in:
pateljannat 2020-11-17 09:47:10 +05:30
parent da878c43fc
commit 642819b955
3 changed files with 17 additions and 0 deletions

View File

@ -304,6 +304,21 @@ $.extend(erpnext.utils, {
}
frappe.ui.form.make_quick_entry(doctype, null, null, new_doc);
});
},
set_place_of_supply: function(frm){
frappe.call({
method: "erpnext.regional.india.utils.get_place_of_supply",
args: {
"party_details": frm.doc,
"doctype": frm.doc.doctype
},
callback: function(r){
if(r.message){
frm.set_value("place_of_supply", r.message)
}
}
})
}
});

View File

@ -135,6 +135,7 @@ def test_method():
'''test function'''
return 'overridden'
@frappe.whitelist()
def get_place_of_supply(party_details, doctype):
if not frappe.get_meta('Address').has_field('gst_state'): return

View File

@ -117,6 +117,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({
customer_address: function() {
erpnext.utils.get_address_display(this.frm, "customer_address");
erpnext.utils.set_taxes_from_address(this.frm, "customer_address", "customer_address", "shipping_address_name");
erpnext.utils.set_place_of_supply(this.frm)
},
shipping_address_name: function() {