Fixed StockService->ConsumeProduct $productStockAmount check (fixes #1949)

This commit is contained in:
Bernd Bestel
2022-07-18 17:35:35 +02:00
parent e64df711e2
commit 0b532f7624
2 changed files with 2 additions and 1 deletions

View File

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