|
|
|
|
|
|
|
|
// Filtre par point de vente |
|
|
// Filtre par point de vente |
|
|
if ($pointSaleCurrent && $producer->option_order_entry_point == Producer::ORDER_ENTRY_POINT_POINT_SALE) { |
|
|
if ($pointSaleCurrent && $producer->option_order_entry_point == Producer::ORDER_ENTRY_POINT_POINT_SALE) { |
|
|
$distributionsArrayFilterPointSale = []; |
|
|
$distributionsArrayFilterPointSale = []; |
|
|
for ($i = 0; $i < count($distributionsArray); $i++) { |
|
|
|
|
|
$distribution = $distributionsArray[$i]; |
|
|
|
|
|
|
|
|
foreach($distributionsArray as $distribution) { |
|
|
if ($distribution && $distributionModule->isPointSaleActive($distribution, $pointSaleCurrent)) { |
|
|
if ($distribution && $distributionModule->isPointSaleActive($distribution, $pointSaleCurrent)) { |
|
|
$countOrders = Order::searchCount([ |
|
|
$countOrders = Order::searchCount([ |
|
|
'id_distribution' => $distribution->id, |
|
|
'id_distribution' => $distribution->id, |
|
|
'id_point_sale' => $pointSaleCurrent->id |
|
|
'id_point_sale' => $pointSaleCurrent->id |
|
|
]); |
|
|
]); |
|
|
$orderUserPointSale = $this->getOrderUser($distribution->date, $pointSaleCurrent); |
|
|
$orderUserPointSale = $this->getOrderUser($distribution->date, $pointSaleCurrent); |
|
|
|
|
|
|
|
|
if (!$pointSaleCurrent->maximum_number_orders |
|
|
if (!$pointSaleCurrent->maximum_number_orders |
|
|
|| ($orderUserPointSale && $orderUserPointSale->id_point_sale == $pointSaleCurrent->id) |
|
|
|| ($orderUserPointSale && $orderUserPointSale->id_point_sale == $pointSaleCurrent->id) |
|
|
|| ($pointSaleCurrent->maximum_number_orders && |
|
|
|| ($pointSaleCurrent->maximum_number_orders && |