From 5629a0c124eec341d11ae9d0eb57e36bc5440146 Mon Sep 17 00:00:00 2001 From: Julie Lenaerts Date: Tue, 29 Oct 2024 14:32:37 +0100 Subject: [PATCH] Adjust query to also add households in the list that do not have an address --- .../Export/Export/ListHouseholdInPeriod.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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') + ) ) ) );