Adjust query to also add households in the list that do not have an address

This commit is contained in:
Julie Lenaerts 2024-10-29 14:32:37 +01:00
parent f7f8319749
commit 5629a0c124

View File

@ -219,6 +219,8 @@ class ListHouseholdInPeriod implements ListInterface, GroupedExportInterface
$qb
->leftJoin('household.addresses', 'addresses')
->andWhere(
$qb->expr()->orX(
$qb->expr()->isNull('addresses'), // Include households without any address
$qb->expr()->andX(
$qb->expr()->lte('addresses.validFrom', ':calcDate'),
$qb->expr()->orX(
@ -226,6 +228,7 @@ class ListHouseholdInPeriod implements ListInterface, GroupedExportInterface
$qb->expr()->gt('addresses.validTo', ':calcDate')
)
)
)
);
$this->addressHelper->addSelectClauses(
ExportAddressHelper::F_ALL,