fix: Drop Shipping address based on customer shopping address
(cherry picked from commit c7499f3528)
This commit is contained in:
@@ -956,9 +956,14 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
|
|||||||
|
|
||||||
if (frappe.meta.get_docfield(this.frm.doctype, "shipping_address") &&
|
if (frappe.meta.get_docfield(this.frm.doctype, "shipping_address") &&
|
||||||
['Purchase Order', 'Purchase Receipt', 'Purchase Invoice'].includes(this.frm.doctype)) {
|
['Purchase Order', 'Purchase Receipt', 'Purchase Invoice'].includes(this.frm.doctype)) {
|
||||||
erpnext.utils.get_shipping_address(this.frm, function() {
|
let is_drop_ship = me.frm.doc.items.some(item => item.delivered_by_supplier);
|
||||||
set_party_account(set_pricing);
|
|
||||||
});
|
if (!is_drop_ship) {
|
||||||
|
console.log('get_shipping_address');
|
||||||
|
erpnext.utils.get_shipping_address(this.frm, function() {
|
||||||
|
set_party_account(set_pricing);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
set_party_account(set_pricing);
|
set_party_account(set_pricing);
|
||||||
|
|||||||
@@ -1402,9 +1402,17 @@ def make_purchase_order(source_name, selected_items=None, target_doc=None):
|
|||||||
target.payment_schedule = []
|
target.payment_schedule = []
|
||||||
|
|
||||||
if is_drop_ship_order(target):
|
if is_drop_ship_order(target):
|
||||||
target.customer = source.customer
|
if source.shipping_address_name:
|
||||||
target.customer_name = source.customer_name
|
target.shipping_address = source.shipping_address_name
|
||||||
target.shipping_address = source.shipping_address_name
|
target.shipping_address_display = source.shipping_address
|
||||||
|
else:
|
||||||
|
target.shipping_address = source.customer_address
|
||||||
|
target.shipping_address_display = source.address_display
|
||||||
|
|
||||||
|
target.customer_contact_person = source.contact_person
|
||||||
|
target.customer_contact_display = source.contact_display
|
||||||
|
target.customer_contact_mobile = source.contact_mobile
|
||||||
|
target.customer_contact_email = source.contact_email
|
||||||
else:
|
else:
|
||||||
target.customer = target.customer_name = target.shipping_address = None
|
target.customer = target.customer_name = target.shipping_address = None
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user