Explorar el Código

Correctif : erreur division par zero

packProduct
Fab hace 2 años
padre
commit
b076e6c43e
Se han modificado 2 ficheros con 8 adiciones y 2 borrados
  1. +5
    -1
      Solver/Product/ProductFamilySolver.php
  2. +3
    -1
      Solver/Product/ProductSolver.php

+ 5
- 1
Solver/Product/ProductFamilySolver.php Ver fichero

@@ -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 Ver fichero

@@ -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;
}
}


Cargando…
Cancelar
Guardar