fix: Customer based price_list in online POS
This commit is contained in:
@@ -477,7 +477,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
|||||||
var me = this;
|
var me = this;
|
||||||
var item = frappe.get_doc(cdt, cdn);
|
var item = frappe.get_doc(cdt, cdn);
|
||||||
|
|
||||||
if (item.serial_no) {
|
if (item && item.serial_no) {
|
||||||
if (!item.item_code) {
|
if (!item.item_code) {
|
||||||
this.frm.trigger("item_code", cdt, cdn);
|
this.frm.trigger("item_code", cdt, cdn);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -164,6 +164,12 @@ erpnext.pos.PointOfSale = class PointOfSale {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
frappe.ui.form.on('Sales Invoice', 'selling_price_list', (frm) => {
|
||||||
|
if(this.items) {
|
||||||
|
this.items.reset_items();
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
toggle_editing(flag) {
|
toggle_editing(flag) {
|
||||||
@@ -1384,6 +1390,7 @@ class POSItems {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get_items({start = 0, page_length = 40, search_value='', item_group=this.parent_item_group}={}) {
|
get_items({start = 0, page_length = 40, search_value='', item_group=this.parent_item_group}={}) {
|
||||||
|
const price_list = this.frm.doc.selling_price_list;
|
||||||
return new Promise(res => {
|
return new Promise(res => {
|
||||||
frappe.call({
|
frappe.call({
|
||||||
method: "erpnext.selling.page.point_of_sale.point_of_sale.get_items",
|
method: "erpnext.selling.page.point_of_sale.point_of_sale.get_items",
|
||||||
@@ -1391,10 +1398,10 @@ class POSItems {
|
|||||||
args: {
|
args: {
|
||||||
start,
|
start,
|
||||||
page_length,
|
page_length,
|
||||||
'price_list': this.frm.doc.selling_price_list,
|
price_list,
|
||||||
item_group,
|
item_group,
|
||||||
search_value,
|
search_value,
|
||||||
'pos_profile': this.frm.doc.pos_profile
|
pos_profile: this.frm.doc.pos_profile
|
||||||
}
|
}
|
||||||
}).then(r => {
|
}).then(r => {
|
||||||
// const { items, serial_no, batch_no } = r.message;
|
// const { items, serial_no, batch_no } = r.message;
|
||||||
|
|||||||
Reference in New Issue
Block a user