Преглед изворни кода

Correctif mineur

packProduct
Fabien Normand пре 3 година
родитељ
комит
a676c398a6
1 измењених фајлова са 28 додато и 5 уклоњено
  1. +28
    -5
      Generator/OrderReferenceGenerator.php

+ 28
- 5
Generator/OrderReferenceGenerator.php Прегледај датотеку

@@ -18,18 +18,41 @@ class OrderReferenceGenerator

public function buildReference(OrderShopInterface $orderShop): string
{
$complementaryIndex = null;

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

}

switch ($orderShop->getSection()->getCycleType()) {
case SectionModel::CYCLE_TYPE_DAY:
return $this->buildReferenceCycleDay($orderShop);
$reference = $this->buildReferenceCycleDay($orderShop);
break;
case SectionModel::CYCLE_TYPE_WEEK:
return $this->buildReferenceCycleWeek($orderShop);
$reference = $this->buildReferenceCycleWeek($orderShop,);
break;
case SectionModel::CYCLE_TYPE_MONTH:
return $this->buildReferenceCycleMonth($orderShop);
$reference = $this->buildReferenceCycleMonth($orderShop);
break;
case SectionModel::CYCLE_TYPE_YEAR:
return $this->buildReferenceCycleYear($orderShop);
$reference = $this->buildReferenceCycleYear($orderShop);
break;
default:
$reference = 'C' . $orderShop->getId();
break;
}

return 'C' . $orderShop->getId();
if($complementaryIndex){
$reference = $reference.'C'.$this->numberPad($complementaryIndex, 1);
}

return $reference;

}

public function buildReferenceCycleDay(OrderShopInterface $orderShop): string

Loading…
Откажи
Сачувај