Hi All,
I have created a new “Price List” and want to link the “Rate” of an specific “Item Code” into another DocType. Hierarchy will look like Item Price > Price List Name > Item Code > Rate.
Can anyone help URGENTly.
BR/Mijan
May be this code will help you to figure out the way.
if (this.frm.doc.posting_date) {
this.frm.posting_date = this.frm.doc.posting_date;
if ((this.frm.doc.doctype == "Sales Invoice" && this.frm.doc.customer) ||
(this.frm.doc.doctype == "Purchase Invoice" && this.frm.doc.supplier)) {
return frappe.call({
method: "erpnext.accounts.party.get_due_date",
args: {
"posting_date": me.frm.doc.posting_date,
"party_type": me.frm.doc.doctype == "Sales Invoice" ? "Customer" : "Supplier",
"bill_date": me.frm.doc.bill_date,
"party": me.frm.doc.doctype == "Sales Invoice" ? me.frm.doc.customer : me.frm.doc.supplier,
"company": me.frm.doc.company
},
callback: function(r, rt) {
if(r.message) {
me.frm.doc.due_date = r.message;
refresh_field("due_date");
frappe.ui.form.trigger(me.frm.doc.doctype, "currency");
me.recalculate_terms();
}