Pārlūkot izejas kodu

Correctif mineur

packProduct
Fabien Normand pirms 2 gadiem
vecāks
revīzija
b173f49898
1 mainītis faili ar 6 papildinājumiem un 3 dzēšanām
  1. +6
    -3
      Generator/OrderReferenceGenerator.php

+ 6
- 3
Generator/OrderReferenceGenerator.php Parādīt failu

@@ -2,6 +2,7 @@

namespace Lc\CaracoleBundle\Generator;

use App\Solver\Order\OrderShopSolver;
use Lc\CaracoleBundle\Definition\SectionSettingDefinition;
use Lc\CaracoleBundle\Model\Order\OrderShopInterface;
use Lc\CaracoleBundle\Model\Section\SectionModel;
@@ -10,10 +11,12 @@ use Lc\SovBundle\Solver\Setting\SettingSolver;
class OrderReferenceGenerator
{
protected SettingSolver $settingSolver;
protected OrderShopSolver $orderShopSolver;

public function __construct(SettingSolver $settingSolver)
public function __construct(SettingSolver $settingSolver, OrderShopSolver $orderShopSolver)
{
$this->settingSolver = $settingSolver;
$this->orderShopSolver= $orderShopSolver;
}

public function buildReference(OrderShopInterface $orderShop): string
@@ -21,9 +24,9 @@ class OrderReferenceGenerator
$complementaryIndex = null;

if ($orderShop->getMainOrderShop()) {
$complementaryIndex = 1;
$complementaryIndex = 0;
foreach ($orderShop->getMainOrderShop()->getComplementaryOrderShops() as $complementaryOrder) {
if ($complementaryOrder->isValid()) $complementaryIndex++;
if ($this->orderShopSolver->isValid($complementaryOrder)) $complementaryIndex++;
}
$orderShop = $complementaryOrder->getMainOrderShop();


Notiek ielāde…
Atcelt
Saglabāt