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 ec1a292621..1b67ff2b72 100644 --- a/erpnext/selling/page/point_of_sale/point_of_sale.js +++ b/erpnext/selling/page/point_of_sale/point_of_sale.js @@ -21,7 +21,9 @@ frappe.pages['point-of-sale'].on_page_load = function(wrapper) { }; frappe.pages['point-of-sale'].refresh = function(wrapper) { - cur_frm = wrapper.pos.frm; + if (wrapper.pos) { + cur_frm = wrapper.pos.frm; + } } erpnext.pos.PointOfSale = class PointOfSale { @@ -742,7 +744,7 @@ class POSCart { this.wrapper.find('.discount_amount').on('change', (e) => { frappe.model.set_value(this.frm.doctype, this.frm.docname, - 'discount_amount', e.target.value); + 'discount_amount', flt(e.target.value)); this.frm.trigger('discount_amount') .then(() => { let discount_wrapper = this.wrapper.find('.additional_discount_percentage'); diff --git a/erpnext/selling/page/point_of_sale/point_of_sale.py b/erpnext/selling/page/point_of_sale/point_of_sale.py index 8ed288b6e9..fd6b8c9181 100644 --- a/erpnext/selling/page/point_of_sale/point_of_sale.py +++ b/erpnext/selling/page/point_of_sale/point_of_sale.py @@ -31,7 +31,7 @@ def get_items(start, page_length, price_list, item_group, search_value=""): ON (item_det.item_code=i.name or item_det.item_code=i.variant_of) where - i.disabled = 0 and i.has_variants = 0 + i.disabled = 0 and i.has_variants = 0 and i.is_sales_item = 1 and i.item_group in (select name from `tabItem Group` where lft >= {lft} and rgt <= {rgt}) and (i.item_code like %(item_code)s or i.item_name like %(item_code)s or i.barcode like %(item_code)s)