From 981be7b3635f1c5ec2bf8b82a2ff9a700e997b09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Thu, 28 Sep 2023 12:36:33 +0200 Subject: [PATCH] SocialWorkRepository: on search by accompanying period, enlarge the dateranges for take into account work with same endDate / startDate Close https://gitlab.com/Chill-Projet/chill-bundles/-/issues/144 --- .../AccompanyingPeriod/AccompanyingPeriodWorkRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php index 56365452a..df33518a4 100644 --- a/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php +++ b/src/Bundle/ChillPersonBundle/Repository/AccompanyingPeriod/AccompanyingPeriodWorkRepository.php @@ -122,7 +122,7 @@ final class AccompanyingPeriodWorkRepository implements ObjectRepository . ")"; } - $sql .= " AND daterange(:after::date, :before::date) && daterange(w.startDate, w.endDate)"; + $sql .= " AND daterange(:after::date, :before::date) && daterange(w.startDate, w.endDate, '[]')"; // if the start and end date were inversed, we inverse the order to avoid an error if (null !== ($filters['after'] ?? null) && null !== ($filters['before']) && $filters['after'] > $filters['before']) {