mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-25 16:04:46 +00:00
fix: place of supply change when address changes
This commit is contained in:
@@ -304,6 +304,21 @@ $.extend(erpnext.utils, {
|
|||||||
}
|
}
|
||||||
frappe.ui.form.make_quick_entry(doctype, null, null, new_doc);
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -135,6 +135,7 @@ def test_method():
|
|||||||
'''test function'''
|
'''test function'''
|
||||||
return 'overridden'
|
return 'overridden'
|
||||||
|
|
||||||
|
@frappe.whitelist()
|
||||||
def get_place_of_supply(party_details, doctype):
|
def get_place_of_supply(party_details, doctype):
|
||||||
if not frappe.get_meta('Address').has_field('gst_state'): return
|
if not frappe.get_meta('Address').has_field('gst_state'): return
|
||||||
|
|
||||||
|
|||||||
@@ -117,6 +117,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({
|
|||||||
customer_address: function() {
|
customer_address: function() {
|
||||||
erpnext.utils.get_address_display(this.frm, "customer_address");
|
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_taxes_from_address(this.frm, "customer_address", "customer_address", "shipping_address_name");
|
||||||
|
erpnext.utils.set_place_of_supply(this.frm)
|
||||||
},
|
},
|
||||||
|
|
||||||
shipping_address_name: function() {
|
shipping_address_name: function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user