瀏覽代碼

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


Loading…
取消
儲存