diff --git a/services/StockService.php b/services/StockService.php index 86c0b4f5..56b42b49 100644 --- a/services/StockService.php +++ b/services/StockService.php @@ -113,6 +113,12 @@ class StockService extends BaseService throw new \Exception('Product does not exist or is inactive'); } + + if ($amount <= 0) + { + throw new \Exception('Amount can\'t be <= 0'); + } + $productDetails = (object)$this->GetProductDetails($productId); // Tare weight handling @@ -356,6 +362,11 @@ class StockService extends BaseService throw new \Exception('Product does not exist or is inactive'); } + if ($amount <= 0) + { + throw new \Exception('Amount can\'t be <= 0'); + } + if ($locationId !== null && !$this->LocationExists($locationId)) { throw new \Exception('Location does not exist');