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
This commit is contained in:
Julien Fastré 2023-09-28 12:36:33 +02:00
parent 74e25e706e
commit 981be7b363
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB

View File

@ -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']) {