|
|
@@ -122,9 +122,27 @@ class ProductFamilySolver |
|
|
|
$availableQuantity += $this->productSolver->getAvailableQuantityInherited($product); |
|
|
|
} |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
case ProductFamilyModel::BEHAVIOR_COUNT_STOCK_UNLIMITED : |
|
|
|
$availableQuantity = false; |
|
|
|
return $availableQuantity; |
|
|
|
} |
|
|
|
|
|
|
|
public function getAvailableQuantitySupplierInherited(ProductFamilyInterface $productFamily) |
|
|
|
{ |
|
|
|
$availableQuantity = 0; |
|
|
|
|
|
|
|
switch ($productFamily->getBehaviorCountStock()) { |
|
|
|
case ProductFamilyModel::BEHAVIOR_COUNT_STOCK_BY_MEASURE : |
|
|
|
case ProductFamilyModel::BEHAVIOR_COUNT_STOCK_BY_PRODUCT_FAMILY : |
|
|
|
|
|
|
|
$availableQuantity = $productFamily->getAvailableQuantitySupplier(); |
|
|
|
break; |
|
|
|
|
|
|
|
case ProductFamilyModel::BEHAVIOR_COUNT_STOCK_BY_PRODUCT : |
|
|
|
|
|
|
|
foreach ($this->getProductsOnline($productFamily) as $product) { |
|
|
|
$availableQuantity += $this->productSolver->getAvailableQuantitySupplierInherited($product); |
|
|
|
} |
|
|
|
break; |
|
|
|
} |
|
|
|
|