From bbab850135efa852b3f2ee49ea644b0448f6dddf Mon Sep 17 00:00:00 2001 From: Abdeali Chharchhoda Date: Mon, 25 Nov 2024 14:13:26 +0530 Subject: [PATCH 1/3] fix: Increase quantity by `1 UOM` when adding an item from the selector in POS --- erpnext/selling/page/point_of_sale/pos_controller.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/erpnext/selling/page/point_of_sale/pos_controller.js b/erpnext/selling/page/point_of_sale/pos_controller.js index 14339cd9b70..4d4a7125e0a 100644 --- a/erpnext/selling/page/point_of_sale/pos_controller.js +++ b/erpnext/selling/page/point_of_sale/pos_controller.js @@ -556,7 +556,9 @@ erpnext.PointOfSale.Controller = class { const item_row_exists = !$.isEmptyObject(item_row); const from_selector = field === "qty" && value === "+1"; - if (from_selector) value = flt(item_row.stock_qty) + flt(value); + if (from_selector) { + value = flt(item_row.qty) + 1; // increase qty by 1 UOM + } if (item_row_exists) { if (field === "qty") value = flt(value); From 84dcbe6639f9d727a974aecd6ed7a932ca4bb7bc Mon Sep 17 00:00:00 2001 From: Abdeali Chharchhoda Date: Mon, 25 Nov 2024 14:48:41 +0530 Subject: [PATCH 2/3] fix: Show available stock qty in `stock_uom` instead of `uom` --- erpnext/selling/page/point_of_sale/pos_controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/selling/page/point_of_sale/pos_controller.js b/erpnext/selling/page/point_of_sale/pos_controller.js index 4d4a7125e0a..4652ca8edd1 100644 --- a/erpnext/selling/page/point_of_sale/pos_controller.js +++ b/erpnext/selling/page/point_of_sale/pos_controller.js @@ -697,7 +697,7 @@ erpnext.PointOfSale.Controller = class { const is_stock_item = resp[1]; frappe.dom.unfreeze(); - const bold_uom = item_row.uom.bold(); + const bold_uom = item_row.stock_uom.bold(); const bold_item_code = item_row.item_code.bold(); const bold_warehouse = warehouse.bold(); const bold_available_qty = available_qty.toString().bold(); From 112b4c705bbad2bd07e6be80e4d4128d73c14d73 Mon Sep 17 00:00:00 2001 From: Abdeali Chharchhoda Date: Mon, 25 Nov 2024 16:17:03 +0530 Subject: [PATCH 3/3] revert: use `+ flt(value)` instead of direct increment --- erpnext/selling/page/point_of_sale/pos_controller.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/erpnext/selling/page/point_of_sale/pos_controller.js b/erpnext/selling/page/point_of_sale/pos_controller.js index 4652ca8edd1..2becd9e9c19 100644 --- a/erpnext/selling/page/point_of_sale/pos_controller.js +++ b/erpnext/selling/page/point_of_sale/pos_controller.js @@ -556,9 +556,7 @@ erpnext.PointOfSale.Controller = class { const item_row_exists = !$.isEmptyObject(item_row); const from_selector = field === "qty" && value === "+1"; - if (from_selector) { - value = flt(item_row.qty) + 1; // increase qty by 1 UOM - } + if (from_selector) value = flt(item_row.qty) + flt(value); if (item_row_exists) { if (field === "qty") value = flt(value);