mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 04:12:59 +00:00
Fixed StockService->ConsumeProduct $productStockAmount check (fixes #1949)
This commit is contained in:
@@ -406,7 +406,7 @@ class StockService extends BaseService
|
||||
$potentialStockEntries = FindAllObjectsInArrayByPropertyValue($potentialStockEntries, 'stock_id', $specificStockEntryId);
|
||||
}
|
||||
|
||||
$productStockAmount = SumArrayValue($potentialStockEntries, 'amount');
|
||||
$productStockAmount = floatval($productDetails->stock_amount_aggregated);
|
||||
if ($amount > $productStockAmount)
|
||||
{
|
||||
throw new \Exception('Amount to be consumed cannot be > current stock amount (if supplied, at the desired location)');
|
||||
|
Reference in New Issue
Block a user