fix: Correct company address not getting copied from Purchase Order to Invoice (#27217)
* fix: Correct company adderess not getting copied from Purchase Order to Invoice * fix: Linting issues
This commit is contained in:
parent
9de0f7538f
commit
fd467e6d32
@ -866,21 +866,25 @@ 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") &&
|
||||||
in_list(['Purchase Order', 'Purchase Receipt', 'Purchase Invoice'], this.frm.doctype)) {
|
in_list(['Purchase Order', 'Purchase Receipt', 'Purchase Invoice'], this.frm.doctype)) {
|
||||||
erpnext.utils.get_shipping_address(this.frm, function(){
|
erpnext.utils.get_shipping_address(this.frm, function() {
|
||||||
set_party_account(set_pricing);
|
set_party_account(set_pricing);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Get default company billing address in Purchase Invoice, Order and Receipt
|
// Get default company billing address in Purchase Invoice, Order and Receipt
|
||||||
frappe.call({
|
if (this.frm.doc.company && frappe.meta.get_docfield(this.frm.doctype, "billing_address")) {
|
||||||
'method': 'frappe.contacts.doctype.address.address.get_default_address',
|
frappe.call({
|
||||||
'args': {
|
method: "erpnext.setup.doctype.company.company.get_default_company_address",
|
||||||
'doctype': 'Company',
|
args: {name: this.frm.doc.company, existing_address: this.frm.doc.billing_address || ""},
|
||||||
'name': this.frm.doc.company
|
debounce: 2000,
|
||||||
},
|
callback: function(r) {
|
||||||
'callback': function(r) {
|
if (r.message) {
|
||||||
me.frm.set_value('billing_address', r.message);
|
me.frm.set_value("billing_address", r.message);
|
||||||
}
|
} else {
|
||||||
});
|
me.frm.set_value("company_address", "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
set_party_account(set_pricing);
|
set_party_account(set_pricing);
|
||||||
|
@ -289,8 +289,8 @@ erpnext.utils.get_shipping_address = function(frm, callback) {
|
|||||||
company: frm.doc.company,
|
company: frm.doc.company,
|
||||||
address: frm.doc.shipping_address
|
address: frm.doc.shipping_address
|
||||||
},
|
},
|
||||||
callback: function(r){
|
callback: function(r) {
|
||||||
if (r.message){
|
if (r.message) {
|
||||||
frm.set_value("shipping_address", r.message[0]) //Address title or name
|
frm.set_value("shipping_address", r.message[0]) //Address title or name
|
||||||
frm.set_value("shipping_address_display", r.message[1]) //Address to be displayed on the page
|
frm.set_value("shipping_address_display", r.message[1]) //Address to be displayed on the page
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user