From eef80fba38f2f9dd6475b5aa7bb82f197be23556 Mon Sep 17 00:00:00 2001 From: Shram007 Date: Tue, 14 Mar 2023 11:49:40 +0530 Subject: [PATCH 1/2] fix: default pos conversion factor set to 1 --- erpnext/selling/page/point_of_sale/point_of_sale.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 158ac1d049a5..657623d18f7e 100644 --- a/erpnext/selling/page/point_of_sale/point_of_sale.py +++ b/erpnext/selling/page/point_of_sale/point_of_sale.py @@ -55,7 +55,7 @@ def search_by_term(search_term, warehouse, price_list): ) item_stock_qty, is_stock_item = get_stock_availability(item_code, warehouse) - item_stock_qty = item_stock_qty // item.get("conversion_factor") + item_stock_qty = item_stock_qty // item.get("conversion_factor", 1) item.update({"actual_qty": item_stock_qty}) price = frappe.get_list( From eb9c495d2c2ce6d49c094d98822bd59eabe0a8f6 Mon Sep 17 00:00:00 2001 From: Shram007 Date: Thu, 16 Mar 2023 18:51:41 +0530 Subject: [PATCH 2/2] fix:get-batch-no-of-item-automatically --- erpnext/selling/page/point_of_sale/point_of_sale.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 657623d18f7e..62b310587201 100644 --- a/erpnext/selling/page/point_of_sale/point_of_sale.py +++ b/erpnext/selling/page/point_of_sale/point_of_sale.py @@ -63,8 +63,9 @@ def search_by_term(search_term, warehouse, price_list): filters={ "price_list": price_list, "item_code": item_code, + "batch_no": batch_no, }, - fields=["uom", "stock_uom", "currency", "price_list_rate"], + fields=["uom", "stock_uom", "currency", "price_list_rate", "batch_no"], ) def __sort(p): @@ -167,7 +168,7 @@ def get_items(start, page_length, price_list, item_group, pos_profile, search_te item_price = frappe.get_all( "Item Price", - fields=["price_list_rate", "currency", "uom"], + fields=["price_list_rate", "currency", "uom", "batch_no"], filters={ "price_list": price_list, "item_code": item.item_code, @@ -190,9 +191,9 @@ def get_items(start, page_length, price_list, item_group, pos_profile, search_te "price_list_rate": price.get("price_list_rate"), "currency": price.get("currency"), "uom": price.uom or item.uom, + "batch_no": price.batch_no, } ) - return {"items": result}