Browse Source

Correctif : erreur division par zero

packProduct
Fab 2 years ago
parent
commit
b076e6c43e
2 changed files with 8 additions and 2 deletions
  1. +5
    -1
      Solver/Product/ProductFamilySolver.php
  2. +3
    -1
      Solver/Product/ProductSolver.php

+ 5
- 1
Solver/Product/ProductFamilySolver.php View File

@@ -372,7 +372,11 @@ class ProductFamilySolver

public function getQuantityInherited(ProductFamilyInterface $productFamily): ?float
{
return $productFamily->getQuantity();
if($productFamily->getQuantity()){
return $productFamily->getQuantity();
}else{
return 1;
}
}

public function getUnitInherited(ProductFamilyInterface $productFamily)

+ 3
- 1
Solver/Product/ProductSolver.php View File

@@ -130,8 +130,10 @@ class ProductSolver
{
if ($product->getQuantity()) {
return $product->getQuantity();
} else {
} else if($product->getProductFamily()->getQuantity()){
return $product->getProductFamily()->getQuantity();
}else{
return 1;
}
}


Loading…
Cancel
Save