diff --git a/.changes/unreleased/Fixed-20241029-143304.yaml b/.changes/unreleased/Fixed-20241029-143304.yaml new file mode 100644 index 000000000..efc0a5fb5 --- /dev/null +++ b/.changes/unreleased/Fixed-20241029-143304.yaml @@ -0,0 +1,6 @@ +kind: Fixed +body: Adjust household list export to include households even if their address is + NULL +time: 2024-10-29T14:33:04.393943822+01:00 +custom: + Issue: "" diff --git a/src/Bundle/ChillPersonBundle/Export/Export/ListHouseholdInPeriod.php b/src/Bundle/ChillPersonBundle/Export/Export/ListHouseholdInPeriod.php index 21f7a5923..b69330002 100644 --- a/src/Bundle/ChillPersonBundle/Export/Export/ListHouseholdInPeriod.php +++ b/src/Bundle/ChillPersonBundle/Export/Export/ListHouseholdInPeriod.php @@ -219,11 +219,14 @@ class ListHouseholdInPeriod implements ListInterface, GroupedExportInterface $qb ->leftJoin('household.addresses', 'addresses') ->andWhere( - $qb->expr()->andX( - $qb->expr()->lte('addresses.validFrom', ':calcDate'), - $qb->expr()->orX( - $qb->expr()->isNull('addresses.validTo'), - $qb->expr()->gt('addresses.validTo', ':calcDate') + $qb->expr()->orX( + $qb->expr()->isNull('addresses'), // Include households without any address + $qb->expr()->andX( + $qb->expr()->lte('addresses.validFrom', ':calcDate'), + $qb->expr()->orX( + $qb->expr()->isNull('addresses.validTo'), + $qb->expr()->gt('addresses.validTo', ':calcDate') + ) ) ) );