浏览代码

Correctif : erreur division par zero

packProduct
Fab 2 年前
父节点
当前提交
b076e6c43e
共有 2 个文件被更改,包括 8 次插入2 次删除
  1. +5
    -1
      Solver/Product/ProductFamilySolver.php
  2. +3
    -1
      Solver/Product/ProductSolver.php

+ 5
- 1
Solver/Product/ProductFamilySolver.php 查看文件

@@ -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 查看文件

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


正在加载...
取消
保存