From 49cca7ac76f85f1e7449468d1fb6dae0cb249899 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Fri, 25 Jan 2019 16:41:01 +0530 Subject: [PATCH] fix: Customer based price_list in online POS --- erpnext/public/js/controllers/transaction.js | 2 +- erpnext/selling/page/point_of_sale/point_of_sale.js | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 4ef8b2e8be..20e1098806 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -477,7 +477,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ var me = this; var item = frappe.get_doc(cdt, cdn); - if (item.serial_no) { + if (item && item.serial_no) { if (!item.item_code) { this.frm.trigger("item_code", cdt, cdn); } diff --git a/erpnext/selling/page/point_of_sale/point_of_sale.js b/erpnext/selling/page/point_of_sale/point_of_sale.js index 1ee5971271..8b4d684466 100644 --- a/erpnext/selling/page/point_of_sale/point_of_sale.js +++ b/erpnext/selling/page/point_of_sale/point_of_sale.js @@ -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) { @@ -1384,6 +1390,7 @@ class POSItems { } 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 => { frappe.call({ method: "erpnext.selling.page.point_of_sale.point_of_sale.get_items", @@ -1391,10 +1398,10 @@ class POSItems { args: { start, page_length, - 'price_list': this.frm.doc.selling_price_list, + price_list, item_group, search_value, - 'pos_profile': this.frm.doc.pos_profile + pos_profile: this.frm.doc.pos_profile } }).then(r => { // const { items, serial_no, batch_no } = r.message;