diff --git a/services/StockService.php b/services/StockService.php index f73ac5bd..ffbbf7e9 100644 --- a/services/StockService.php +++ b/services/StockService.php @@ -697,6 +697,10 @@ class StockService extends BaseService if (Grocycode::Validate($barcode)) { $gc = new Grocycode($barcode); + if ($gc->GetType() != Grocycode::PRODUCT) + { + throw new \Exception("Grocycode $barcode is not a product code"); + } return intval($gc->GetId()); }