mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 04:12:59 +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;
|
$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;
|
$bookingAmount = $newAmount - $productDetails->stock_amount;
|
||||||
if ($productDetails->product->enable_tare_weight_handling == 1)
|
if ($productDetails->product->enable_tare_weight_handling == 1)
|
||||||
|
Reference in New Issue
Block a user