Don't allow tare weight handling enabled products to be opened (closes #770)

This commit is contained in:
Bernd Bestel
2020-11-14 22:51:06 +01:00
parent 62c9c285ba
commit 28276191cc
3 changed files with 7 additions and 1 deletions

View File

@@ -740,6 +740,11 @@ class StockService extends BaseService
$potentialStockEntries = $this->GetProductStockEntries($productId, true);
$product = $this->getDatabase()->products($productId);
if ($product->enable_tare_weight_handling == 1)
{
throw new \Exception('Opening tare weight handling enabled products is not supported');
}
if ($amount > $productStockAmountUnopened)
{
throw new \Exception('Amount to be opened cannot be > current unopened stock amount');