DX: rename CountHousehold => CountHouseholdInPeriod.php + add test

This commit is contained in:
2023-11-13 12:56:59 +01:00
parent d01b6db5dc
commit 1663c6f7c7
3 changed files with 64 additions and 14 deletions

View File

@@ -26,7 +26,7 @@ use Doctrine\ORM\Query;
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
use Symfony\Component\Form\FormBuilderInterface;
class CountHousehold implements ExportInterface, GroupedExportInterface
class CountHouseholdInPeriod implements ExportInterface, GroupedExportInterface
{
private const TR_PREFIX = 'export.export.nb_household_with_course.';
private readonly bool $filterStatsByCenters;
@@ -120,6 +120,7 @@ class CountHousehold implements ExportInterface, GroupedExportInterface
->join('person.accompanyingPeriodParticipations', 'acppart')
->join('acppart.accompanyingPeriod', 'acp')
->andWhere('acppart.startDate != acppart.endDate OR acppart.endDate IS NULL')
->andWhere('hmember.startDate <= :count_household_at_date AND (hmember.endDate IS NULL OR hmember.endDate > :count_household_at_date)')
->setParameter('count_household_at_date', $this->rollingDateConverter->convert($data['calc_date']));
$qb
@@ -135,7 +136,6 @@ class CountHousehold implements ExportInterface, GroupedExportInterface
'
)
)
->andWhere('hmember.startDate <= :count_household_at_date AND (hmember.endDate IS NULL OR hmember.endDate > :count_household_at_date)')
->setParameter('authorized_centers', $centers);
}