diff --git a/services/StockService.php b/services/StockService.php index 6abc247c..6611aa51 100644 --- a/services/StockService.php +++ b/services/StockService.php @@ -40,7 +40,7 @@ class StockService extends BaseService public function GetProductIdFromBarcode(string $barcode) { - $potentialProduct = $this->Database->products()->where('barcode LIKE :1', '%' . $barcode . '%')->limit(1)->fetch(); + $potentialProduct = $this->Database->products()->where("',' || barcode || ',' LIKE '%,' || :1 || ',%' AND IFNULL(barcode, '') != ''", $barcode)->limit(1)->fetch(); if ($potentialProduct === null) {