mirror of
https://github.com/grocy/grocy.git
synced 2025-08-19 20:11:16 +00:00
Fixed API response for /api/stock/products/{productId}/inventory when the new amount equals the current stock amount (references #224)
This commit is contained in:
@@ -321,7 +321,11 @@ class StockService extends BaseService
|
||||
$containerWeight = $productDetails->product->tare_weight;
|
||||
}
|
||||
|
||||
if ($newAmount > $productDetails->stock_amount + $containerWeight)
|
||||
if ($newAmount == $productDetails->stock_amount + $containerWeight)
|
||||
{
|
||||
throw new \Exception('The new amount cannot equal the current stock amount');
|
||||
}
|
||||
else if ($newAmount > $productDetails->stock_amount + $containerWeight)
|
||||
{
|
||||
$bookingAmount = $newAmount - $productDetails->stock_amount;
|
||||
if ($productDetails->product->enable_tare_weight_handling == 1)
|
||||
|
Reference in New Issue
Block a user