mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-14 07:47:12 +00:00
fix: move code from purchase invoice to buying controller
(cherry picked from commit cb197fd01f)
This commit is contained in:
@@ -719,14 +719,6 @@ frappe.ui.form.on("Purchase Invoice", {
|
|||||||
if (response) frm.set_value("credit_to", response.message);
|
if (response) frm.set_value("credit_to", response.message);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
frappe.call({
|
|
||||||
method: "erpnext.setup.doctype.company.company.get_default_company_address",
|
|
||||||
args: { name: frm.doc.company },
|
|
||||||
callback: (r) => {
|
|
||||||
frm.set_value("billing_address", r.message || "");
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -145,6 +145,18 @@ erpnext.buying = {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
company(){
|
||||||
|
if(this.frm.doc.doctype == "Material Request") 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() {
|
supplier_address() {
|
||||||
erpnext.utils.get_address_display(this.frm);
|
erpnext.utils.get_address_display(this.frm);
|
||||||
erpnext.utils.set_taxes_from_address(this.frm, "supplier_address", "supplier_address", "supplier_address");
|
erpnext.utils.set_taxes_from_address(this.frm, "supplier_address", "supplier_address", "supplier_address");
|
||||||
|
|||||||
Reference in New Issue
Block a user