diff --git a/public/typo3conf/ext/ep_products/Classes/Domain/Repository/ContingentRepository.php b/public/typo3conf/ext/ep_products/Classes/Domain/Repository/ContingentRepository.php index 95322d4d..4fb3d335 100644 --- a/public/typo3conf/ext/ep_products/Classes/Domain/Repository/ContingentRepository.php +++ b/public/typo3conf/ext/ep_products/Classes/Domain/Repository/ContingentRepository.php @@ -43,7 +43,7 @@ class ContingentRepository extends AbstractRepository implements ProviderInterfa * @return \CalendR\Event\EventInterface[] * @throws \Doctrine\DBAL\DBALException */ - public function getEvents(\DateTime $dateFrom, \DateTime $dateTo, array $options = []) + public function getEvents(\DateTime $dateFrom, \DateTime $dateTo = null, array $options = []) { $optionsResolver = new OptionsResolver(); $optionsResolver->setDefined(['hotel']); @@ -71,11 +71,16 @@ class ContingentRepository extends AbstractRepository implements ProviderInterfa $qb ->andWhere('date >= :dateFrom') - ->andWhere('date <= :dateTo') ->setParameter('dateFrom', $dateFrom->format('Y-m-d')) - ->setParameter('dateTo', $dateTo->format('Y-m-d')) ; + if (null !== $dateTo) { + $qb + ->andWhere('date <= :dateTo') + ->setParameter('dateTo', $dateTo->format('Y-m-d')) + ; + } + $result = $qb->execute()->fetchAll(); $dates = []; diff --git a/public/typo3conf/ext/ep_products/Classes/Service/ContingentImportService.php b/public/typo3conf/ext/ep_products/Classes/Service/ContingentImportService.php index 4e550329..558e9dd0 100644 --- a/public/typo3conf/ext/ep_products/Classes/Service/ContingentImportService.php +++ b/public/typo3conf/ext/ep_products/Classes/Service/ContingentImportService.php @@ -229,6 +229,7 @@ class ContingentImportService implements SingletonInterface, LoggerAwareInterfac $roomType = $roomTypes[$roomTypeBusProId]; $roomCode = $roomType['code']; $availablePax = 0; + $capacity = 0; if ($roomType['ctrl'] === true) { if ((string) $xmlRoom['status'] === 'A') { $status = Contingent::STATUS_ONREQUEST; diff --git a/public/typo3conf/ext/ep_products/Classes/Service/IcalService.php b/public/typo3conf/ext/ep_products/Classes/Service/IcalService.php index c5af9f8a..d4aaa788 100644 --- a/public/typo3conf/ext/ep_products/Classes/Service/IcalService.php +++ b/public/typo3conf/ext/ep_products/Classes/Service/IcalService.php @@ -60,11 +60,11 @@ class IcalService implements SingletonInterface */ public function createContingentsFeed(Hotel $hotel): string { - $range = Period::after(new \DateTime('now'), '1 year'); + $now = new \DateTime('now'); try { $events = $this->contingentRepository->getEvents( - \DateTime::createFromImmutable($range->getStartDate()), - \DateTime::createFromImmutable($range->getEndDate()), + $now, + null, ['hotel' => $hotel] ); }