diff --git a/.changes/unreleased/Fixed-20231107-144039.yaml b/.changes/unreleased/Fixed-20231107-144039.yaml new file mode 100644 index 000000000..2292b8adb --- /dev/null +++ b/.changes/unreleased/Fixed-20231107-144039.yaml @@ -0,0 +1,6 @@ +kind: Fixed +body: 'Export: fix "group accompanying period by geographical unit": take into account + the accompanying periods when the period is not located within an unit' +time: 2023-11-07T14:40:39.46483404+01:00 +custom: + Issue: "185" diff --git a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php index f1c0d60ad..3fa612988 100644 --- a/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php +++ b/src/Bundle/ChillPersonBundle/Export/Aggregator/AccompanyingCourseAggregators/GeographicalUnitStatAggregator.php @@ -83,7 +83,12 @@ final readonly class GeographicalUnitStatAggregator implements AggregatorInterfa 'acp_geog_units' ); - $qb->andWhere($qb->expr()->in('acp_geog_units.layer', ':acp_geog_unit_layer')); + $qb->andWhere( + $qb->expr()->orX( + $qb->expr()->isNull('acp_geog_units'), + $qb->expr()->in('acp_geog_units.layer', ':acp_geog_unit_layer') + ) + ); $qb->setParameter('acp_geog_unit_layer', $data['level']);