mirror of
https://github.com/grocy/grocy.git
synced 2025-08-20 12:20:22 +00:00
Make it possible to disable open per product (closes #1911)
This commit is contained in:
@@ -953,10 +953,16 @@ class StockService extends BaseService
|
||||
throw new \Exception('Product does not exist or is inactive');
|
||||
}
|
||||
|
||||
$product = $this->getDatabase()->products($productId);
|
||||
|
||||
if ($product->disable_open == 1)
|
||||
{
|
||||
throw new \Exception('Product can\'t be opened');
|
||||
}
|
||||
|
||||
$productDetails = (object)$this->GetProductDetails($productId);
|
||||
$productStockAmountUnopened = $productDetails->stock_amount_aggregated - $productDetails->stock_amount_opened_aggregated;
|
||||
$potentialStockEntries = $this->GetProductStockEntries($productId, true, $allowSubproductSubstitution);
|
||||
$product = $this->getDatabase()->products($productId);
|
||||
|
||||
if ($product->enable_tare_weight_handling == 1)
|
||||
{
|
||||
|
Reference in New Issue
Block a user