Skip to content

Commit

Permalink
Merge pull request #44906 from Sanket322/company_address_in_purchase_…
Browse files Browse the repository at this point in the history
…invoice

fix: set/update billing address on change of company
  • Loading branch information
ruthra-kumar authored Dec 30, 2024
2 parents 784a62e + 187c74a commit 93b70b9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
12 changes: 12 additions & 0 deletions erpnext/public/js/controllers/buying.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,18 @@ erpnext.buying = {
});
}

company(){
if(!frappe.meta.has_field(this.frm.doc.doctype, "billing_address")) return;

frappe.call({
method: "erpnext.setup.doctype.company.company.get_default_company_address",
args: { name: this.frm.doc.company, existing_address:this.frm.doc.billing_address },
callback: (r) => {
this.frm.set_value("billing_address", r.message || "");
},
});
}

supplier_address() {
erpnext.utils.get_address_display(this.frm);
erpnext.utils.set_taxes_from_address(this.frm, "supplier_address", "supplier_address", "supplier_address");
Expand Down
1 change: 0 additions & 1 deletion erpnext/public/js/controllers/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -983,7 +983,6 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe
let is_drop_ship = me.frm.doc.items.some(item => item.delivered_by_supplier);

if (!is_drop_ship) {
console.log('get_shipping_address');
erpnext.utils.get_shipping_address(this.frm, function() {
set_party_account(set_pricing);
});
Expand Down

0 comments on commit 93b70b9

Please sign in to comment.