|
|
@@ -208,15 +208,20 @@ class DistributionBuilder extends AbstractBuilder |
|
|
|
$this->activeDistribution($distribution, $active); |
|
|
|
} |
|
|
|
|
|
|
|
public function activeDistributionByDayWeek(string $date, string $dayWeek, bool $active = true) |
|
|
|
public function activeDistributionByDateIfDelivery(\DateTime $date, bool $active = true): void |
|
|
|
{ |
|
|
|
$activeDay = $this->pointSaleRepository->isDayOfWeekWithDelivery($date->format('l')); |
|
|
|
if($activeDay || !$active) { |
|
|
|
$this->activeDistributionByDate($date, $active); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public function activeDistributionByDayWeek(string $date, string $dayWeek, bool $active = true): void |
|
|
|
{ |
|
|
|
$week = sprintf('%02d', date('W', strtotime($date))); |
|
|
|
$start = strtotime(date('Y', strtotime($date)) . 'W' . $week); |
|
|
|
$dateDay = new \DateTime(date('Y-m-d', strtotime($dayWeek, $start))); |
|
|
|
$activeDay = $this->pointSaleRepository->isDayOfWeekWithDelivery($dayWeek); |
|
|
|
if ($activeDay || !$active) { |
|
|
|
$this->activeDistributionByDate($dateDay, $active); |
|
|
|
} |
|
|
|
$this->activeDistributionByDateIfDelivery($dateDay, $active); |
|
|
|
} |
|
|
|
|
|
|
|
public function activeDistributionsOfWeek(string $date, bool $active = true): void |