diff --git a/.changes/unreleased/Fixed-20240613-135945.yaml b/.changes/unreleased/Fixed-20240613-135945.yaml new file mode 100644 index 000000000..38028a735 --- /dev/null +++ b/.changes/unreleased/Fixed-20240613-135945.yaml @@ -0,0 +1,5 @@ +kind: Fixed +body: Take into account the acp closing date in the acp works date filter +time: 2024-06-13T13:59:45.561891547+02:00 +custom: + Issue: "271" diff --git a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkEndDateBetweenDateFilter.php b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkEndDateBetweenDateFilter.php index 92258ccf9..38ca39320 100644 --- a/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkEndDateBetweenDateFilter.php +++ b/src/Bundle/ChillPersonBundle/Export/Filter/SocialWorkFilters/AccompanyingPeriodWorkEndDateBetweenDateFilter.php @@ -86,11 +86,11 @@ final readonly class AccompanyingPeriodWorkEndDateBetweenDateFilter implements F }; $end = match ($data['keep_null']) { true => $qb->expr()->orX( - $qb->expr()->gt('acpw.endDate', ':'.$as), + $qb->expr()->gt('COALESCE(acp.closingDate, acpw.endDate)', ':'.$as), $qb->expr()->isNull('acpw.endDate') ), false => $qb->expr()->andX( - $qb->expr()->gt('acpw.endDate', ':'.$as), + $qb->expr()->gt('COALESCE(acp.closingDate, acpw.endDate)', ':'.$as), $qb->expr()->isNotNull('acpw.endDate') ), default => throw new \LogicException('This value is not supported'),