Return a proper API response when booking amount for consume/open is > current stock amount (references #170)

This commit is contained in:
Bernd Bestel
2019-03-10 13:50:28 +01:00
parent 75241fc61f
commit 61f582554f
2 changed files with 4 additions and 4 deletions

View File

@@ -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')