Make it possible to disable open per product (closes #1911)

This commit is contained in:
Bernd Bestel
2025-01-19 14:57:19 +01:00
parent 72e1a9aee7
commit bc78359dba
10 changed files with 139 additions and 11 deletions

View File

@@ -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)
{