mirror of
https://github.com/grocy/grocy.git
synced 2026-04-09 22:16:16 +02:00
Don't allow transfering tare weight enabled products
This commit is contained in:
parent
2d0bc7f55a
commit
048312dd9b
|
|
@ -399,6 +399,9 @@ class StockService extends BaseService
|
||||||
$productDetails = (object)$this->GetProductDetails($productId);
|
$productDetails = (object)$this->GetProductDetails($productId);
|
||||||
if ($productDetails->product->enable_tare_weight_handling == 1)
|
if ($productDetails->product->enable_tare_weight_handling == 1)
|
||||||
{
|
{
|
||||||
|
// Hard fail for now, as we not yet support transfering tare weight enabled products
|
||||||
|
throw new \Exception('Transfering tare weight enabled products is not yet possible');
|
||||||
|
|
||||||
if ($amount < floatval($productDetails->product->tare_weight))
|
if ($amount < floatval($productDetails->product->tare_weight))
|
||||||
{
|
{
|
||||||
throw new \Exception('The amount cannot be lower than the defined tare weight');
|
throw new \Exception('The amount cannot be lower than the defined tare weight');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user