|
|
|
|
|
|
|
|
$this->activeDistribution($distribution, $active); |
|
|
$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))); |
|
|
$week = sprintf('%02d', date('W', strtotime($date))); |
|
|
$start = strtotime(date('Y', strtotime($date)) . 'W' . $week); |
|
|
$start = strtotime(date('Y', strtotime($date)) . 'W' . $week); |
|
|
$dateDay = new \DateTime(date('Y-m-d', strtotime($dayWeek, $start))); |
|
|
$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 |
|
|
public function activeDistributionsOfWeek(string $date, bool $active = true): void |