fixes for exports and list

This commit is contained in:
Julien Fastré 2023-06-30 17:12:09 +02:00
parent b7df62d4f5
commit c8b62d990a
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
6 changed files with 15 additions and 12 deletions

View File

@ -0,0 +1,5 @@
kind: Fixed
body: '[export] fix list when a person locating a course is without address'
time: 2023-06-30T17:11:19.454081914+02:00
custom:
Issue: ""

View File

@ -0,0 +1,5 @@
kind: Fixed
body: '[export] remove unused condition on course about duration participation'
time: 2023-06-30T17:11:53.076615549+02:00
custom:
Issue: ""

View File

@ -101,7 +101,6 @@ class CountAccompanyingCourse implements ExportInterface, GroupedExportInterface
->andWhere('acp.step != :count_acp_step') ->andWhere('acp.step != :count_acp_step')
->leftJoin('acp.participations', 'acppart') ->leftJoin('acp.participations', 'acppart')
->leftJoin('acppart.person', 'person') ->leftJoin('acppart.person', 'person')
->andWhere('acppart.startDate != acppart.endDate OR acppart.endDate IS NULL')
->andWhere( ->andWhere(
$qb->expr()->exists( $qb->expr()->exists(
'SELECT 1 FROM ' . PersonCenterHistory::class . ' acl_count_person_history WHERE acl_count_person_history.person = person 'SELECT 1 FROM ' . PersonCenterHistory::class . ' acl_count_person_history WHERE acl_count_person_history.person = person

View File

@ -101,7 +101,6 @@ class CountAccompanyingPeriodWork implements ExportInterface, GroupedExportInter
->join('acpw.accompanyingPeriod', 'acp') ->join('acpw.accompanyingPeriod', 'acp')
->join('acp.participations', 'acppart') ->join('acp.participations', 'acppart')
->join('acppart.person', 'person') ->join('acppart.person', 'person')
->andWhere('acppart.startDate != acppart.endDate OR acppart.endDate IS NULL')
->andWhere( ->andWhere(
$qb->expr()->exists( $qb->expr()->exists(
'SELECT 1 FROM ' . PersonCenterHistory::class . ' acl_count_person_history WHERE acl_count_person_history.person = person 'SELECT 1 FROM ' . PersonCenterHistory::class . ' acl_count_person_history WHERE acl_count_person_history.person = person

View File

@ -101,7 +101,6 @@ class CountEvaluation implements ExportInterface, GroupedExportInterface
->join('acpw.accompanyingPeriod', 'acp') ->join('acpw.accompanyingPeriod', 'acp')
->join('acp.participations', 'acppart') ->join('acp.participations', 'acppart')
->join('acppart.person', 'person') ->join('acppart.person', 'person')
->andWhere('acppart.startDate != acppart.endDate OR acppart.endDate IS NULL')
->andWhere( ->andWhere(
$qb->expr()->exists( $qb->expr()->exists(
'SELECT 1 FROM ' . PersonCenterHistory::class . ' acl_count_person_history WHERE acl_count_person_history.person = person 'SELECT 1 FROM ' . PersonCenterHistory::class . ' acl_count_person_history WHERE acl_count_person_history.person = person

View File

@ -416,15 +416,11 @@ class ListAccompanyingPeriod implements ListInterface, GroupedExportInterface
) )
) )
) )
->leftJoin(PersonHouseholdAddress::class, 'personAddress', Join::WITH, 'locationHistory.personLocation = personAddress.person') ->leftJoin(
->andWhere( PersonHouseholdAddress::class,
$qb->expr()->orX( 'personAddress',
$qb->expr()->isNull('personAddress'), Join::WITH,
$qb->expr()->andX( 'locationHistory.personLocation = personAddress.person AND (personAddress.validFrom <= :calcDate AND (personAddress.validTo IS NULL OR personAddress.validTo > :calcDate))'
$qb->expr()->lte('personAddress.validFrom', ':calcDate'),
$qb->expr()->orX($qb->expr()->isNull('personAddress.validTo'), $qb->expr()->gt('personAddress.validTo', ':calcDate'))
)
)
) )
->leftJoin(Address::class, 'acp_address', Join::WITH, 'COALESCE(IDENTITY(locationHistory.addressLocation), IDENTITY(personAddress.address)) = acp_address.id'); ->leftJoin(Address::class, 'acp_address', Join::WITH, 'COALESCE(IDENTITY(locationHistory.addressLocation), IDENTITY(personAddress.address)) = acp_address.id');