From 4879fe2cf3b4ff5b11517c00d44ae5dc579a90d1 Mon Sep 17 00:00:00 2001 From: jekkos Date: Thu, 23 Jan 2025 23:55:27 +0100 Subject: [PATCH] Show error when hitting enter in sales (#4155) --- app/Controllers/Sales.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Controllers/Sales.php b/app/Controllers/Sales.php index 450f93224..07bd73b82 100644 --- a/app/Controllers/Sales.php +++ b/app/Controllers/Sales.php @@ -606,7 +606,7 @@ class Sales extends Secure_Controller } else { - if(!$this->sale_lib->add_item($item_id_or_number_or_item_kit_or_receipt, $item_location, $quantity, $discount, $discount_type, PRICE_MODE_STANDARD, null, null, $price)) + if($item_id_or_number_or_item_kit_or_receipt == '' || !$this->sale_lib->add_item($item_id_or_number_or_item_kit_or_receipt, $item_location, $quantity, $discount, $discount_type, PRICE_MODE_STANDARD, null, null, $price)) { $data['error'] = lang('Sales.unable_to_add_item'); }