Minor fixes

This commit is contained in:
Julie Lenaerts 2023-12-18 10:33:30 +01:00
parent 5b2a2a1bc5
commit b9890d1302

View File

@ -46,14 +46,19 @@ final readonly class WithParticipationBetweenDatesFilter implements FilterInterf
$qb
->andWhere(
$qb->expr()->exists(
'SELECT 1 FROM '.AccompanyingPeriodParticipation::class." {$p}_acpp ".
"WHERE {$p}_acpp.person = person ".
"AND OVERLAPSI (acpp.startDate, acpp.endDate), (:{$p}_date_after), :{$p}_date_before)) = 'TRUE' ")
$qb->expr()->andX(
$qb->expr()->exists(
"SELECT 1 FROM ".AccompanyingPeriodParticipation::class." {$p}_acp ".
"WHERE {$p}_acp.person = person ".
"AND OVERLAPSI ({$p}_acp.openingDate, {$p}_acp.closingDate), (:{$p}_date_after), :{$p}_date_before)) = TRUE"),
$qb->expr()->exists(
'SELECT 1 FROM '.AccompanyingPeriodParticipation::class." {$p}_acpp ".
"WHERE {$p}_acpp.person = person ".
"AND OVERLAPSI ({$p}_acpp.startDate, {$p}_acpp.endDate), (:{$p}_date_after), :{$p}_date_before)) = TRUE")
)
)
->setParameter("{$p}_date_after", $this->rollingDateConverter->convert($data['date_after']), Types::DATE_IMMUTABLE)
->setParameter("{$p}_date_before", $this->rollingDateConverter->convert($data['date_before']), Types::DATE_IMMUTABLE);
}
public function applyOn(): string
@ -75,7 +80,7 @@ final readonly class WithParticipationBetweenDatesFilter implements FilterInterf
public function getFormDefaultData(): array
{
return [
'date_after' => new RollingDate(RollingDate::T_YEAR_PREVIOUS_START),
'date_after' => new RollingDate(RollingDate::T_YEAR_CURRENT_START),
'date_before' => new RollingDate(RollingDate::T_TODAY),
];
}