From 0d3802873b62dae8c346a9e256ebaa04050acff6 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 (cherry picked from commit bbab850135efa852b3f2ee49ea644b0448f6dddf) --- 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 c2dd591838d..3028e12d5a2 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 49dad1a456bd22d154deafbfc5b27930721b2240 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` (cherry picked from commit 84dcbe6639f9d727a974aecd6ed7a932ca4bb7bc) --- 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 3028e12d5a2..9684c9635d9 100644 --- a/erpnext/selling/page/point_of_sale/pos_controller.js +++ b/erpnext/selling/page/point_of_sale/pos_controller.js @@ -689,7 +689,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 b65e16a91b71ca7e674c04d08c2a01a8a0fb1079 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 (cherry picked from commit 112b4c705bbad2bd07e6be80e4d4128d73c14d73) --- 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 9684c9635d9..de3259ae2b7 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);