Merge branch 'adjust_list_household_export' into 'master'

Adjust list household export

See merge request Chill-Projet/chill-bundles!750
This commit is contained in:
LenaertsJ 2024-11-14 08:53:44 +00:00
commit a8660ecdb2
2 changed files with 14 additions and 5 deletions

View File

@ -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: ""

View File

@ -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')
)
)
)
);