mirror of
https://github.com/grocy/grocy.git
synced 2025-10-14 17:24:07 +00:00
Return a proper API response when booking amount for consume/open is > current stock amount (references #170)
This commit is contained in:
@@ -221,7 +221,7 @@ class StockService extends BaseService
|
||||
|
||||
if ($amount > $productStockAmount)
|
||||
{
|
||||
return false;
|
||||
throw new \Exception('Amount to be consumed cannot be > current stock amount');
|
||||
}
|
||||
|
||||
if ($specificStockEntryId !== 'default')
|
||||
@@ -347,7 +347,7 @@ class StockService extends BaseService
|
||||
|
||||
if ($amount > $productStockAmountUnopened)
|
||||
{
|
||||
return false;
|
||||
throw new \Exception('Amount to be opened cannot be > current unopened stock amount');
|
||||
}
|
||||
|
||||
if ($specificStockEntryId !== 'default')
|
||||
|
Reference in New Issue
Block a user