This commit is contained in:
Mathieu Jaumotte 2022-11-14 16:03:04 +01:00
parent 68bfb082fc
commit e767557216
28 changed files with 123 additions and 85 deletions

View File

@ -13,10 +13,10 @@ namespace Chill\ActivityBundle\Export\Filter;
use Chill\ActivityBundle\Export\Declarations;
use Chill\MainBundle\Export\FilterInterface;
use Chill\MainBundle\Form\Type\Export\FilterType;
use Chill\MainBundle\Form\Type\PickRollingDateType;
use Chill\MainBundle\Service\RollingDate\RollingDate;
use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface;
use Chill\MainBundle\Form\Type\Export\FilterType;
use Doctrine\ORM\Query\Expr;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface;
@ -27,10 +27,10 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class ActivityDateFilter implements FilterInterface
{
private RollingDateConverterInterface $rollingDateConverter;
protected TranslatorInterface $translator;
private RollingDateConverterInterface $rollingDateConverter;
public function __construct(
TranslatorInterface $translator,
RollingDateConverterInterface $rollingDateConverter
@ -60,10 +60,12 @@ class ActivityDateFilter implements FilterInterface
}
$qb->add('where', $where);
$qb->setParameter('date_from',
$qb->setParameter(
'date_from',
$this->rollingDateConverter->convert($data['date_from'])
);
$qb->setParameter('date_to',
$qb->setParameter(
'date_to',
$this->rollingDateConverter->convert($data['date_to'])
);
}

View File

@ -13,10 +13,10 @@ namespace Chill\AsideActivityBundle\Export\Filter;
use Chill\AsideActivityBundle\Export\Declarations;
use Chill\MainBundle\Export\FilterInterface;
use Chill\MainBundle\Form\Type\Export\FilterType;
use Chill\MainBundle\Form\Type\PickRollingDateType;
use Chill\MainBundle\Service\RollingDate\RollingDate;
use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface;
use Chill\MainBundle\Form\Type\Export\FilterType;
use Doctrine\ORM\Query\Expr\Andx;
use Doctrine\ORM\QueryBuilder;
use Symfony\Component\Form\FormBuilderInterface;
@ -27,10 +27,10 @@ use Symfony\Contracts\Translation\TranslatorInterface;
class ByDateFilter implements FilterInterface
{
private RollingDateConverterInterface $rollingDateConverter;
protected TranslatorInterface $translator;
private RollingDateConverterInterface $rollingDateConverter;
public function __construct(
RollingDateConverterInterface $rollingDateConverter,
TranslatorInterface $translator
@ -60,10 +60,12 @@ class ByDateFilter implements FilterInterface
}
$qb->add('where', $where);
$qb->setParameter('date_from',
$qb->setParameter(
'date_from',
$this->rollingDateConverter->convert($data['date_from'])
);
$qb->setParameter('date_to',
$qb->setParameter(
'date_to',
$this->rollingDateConverter->convert($data['date_to'])
);
}

View File

@ -50,11 +50,13 @@ class BetweenDatesFilter implements FilterInterface
}
$qb->add('where', $where);
$qb->setParameter('dateFrom',
$qb->setParameter(
'dateFrom',
$this->rollingDateConverter->convert($data['date_from'])
);
// modify dateTo so that entire day is also taken into account up until the beginning of the next day.
$qb->setParameter('dateTo',
$qb->setParameter(
'dateTo',
$this->rollingDateConverter->convert($data['date_to'])->modify('+1 day')
);
}

View File

@ -16,9 +16,9 @@ use Chill\MainBundle\Entity\GeographicalUnit;
use Chill\MainBundle\Entity\GeographicalUnitLayer;
use Chill\MainBundle\Export\AggregatorInterface;
use Chill\MainBundle\Form\Type\PickRollingDateType;
use Chill\MainBundle\Repository\GeographicalUnitLayerRepositoryInterface;
use Chill\MainBundle\Service\RollingDate\RollingDate;
use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface;
use Chill\MainBundle\Repository\GeographicalUnitLayerRepositoryInterface;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Chill\PersonBundle\Entity\Household\PersonHouseholdAddress;
use Chill\PersonBundle\Export\Declarations;
@ -33,10 +33,10 @@ final class GeographicalUnitStatAggregator implements AggregatorInterface
{
private GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository;
private TranslatableStringHelperInterface $translatableStringHelper;
private RollingDateConverterInterface $rollingDateConverter;
private TranslatableStringHelperInterface $translatableStringHelper;
public function __construct(
GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository,
TranslatableStringHelperInterface $translatableStringHelper,
@ -67,7 +67,8 @@ final class GeographicalUnitStatAggregator implements AggregatorInterface
)
);
$qb->setParameter('acp_geog_aggregator_date',
$qb->setParameter(
'acp_geog_aggregator_date',
$this->rollingDateConverter->convert($data['date_calc'])
);
}
@ -88,7 +89,8 @@ final class GeographicalUnitStatAggregator implements AggregatorInterface
)
);
$qb->setParameter('acp_geog_aggregator_date',
$qb->setParameter(
'acp_geog_aggregator_date',
$this->rollingDateConverter->convert($data['date_calc'])
);
}

View File

@ -13,9 +13,9 @@ namespace Chill\PersonBundle\Export\Aggregator\AccompanyingCourseAggregators;
use Chill\MainBundle\Export\AggregatorInterface;
use Chill\MainBundle\Form\Type\PickRollingDateType;
use Chill\MainBundle\Repository\UserRepository;
use Chill\MainBundle\Service\RollingDate\RollingDate;
use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface;
use Chill\MainBundle\Repository\UserRepository;
use Chill\MainBundle\Templating\Entity\UserRender;
use Chill\PersonBundle\Export\Declarations;
use Doctrine\ORM\QueryBuilder;
@ -27,12 +27,12 @@ final class ReferrerAggregator implements AggregatorInterface
private const P = 'acp_ref_agg_date';
private RollingDateConverterInterface $rollingDateConverter;
private UserRender $userRender;
private UserRepository $userRepository;
private RollingDateConverterInterface $rollingDateConverter;
public function __construct(
UserRepository $userRepository,
UserRender $userRender,
@ -66,7 +66,8 @@ final class ReferrerAggregator implements AggregatorInterface
)
)
)
->setParameter(self::P,
->setParameter(
self::P,
$this->rollingDateConverter->convert($data['date_calc'])
);
}

View File

@ -13,9 +13,9 @@ namespace Chill\PersonBundle\Export\Aggregator\AccompanyingCourseAggregators;
use Chill\MainBundle\Export\AggregatorInterface;
use Chill\MainBundle\Form\Type\PickRollingDateType;
use Chill\MainBundle\Repository\ScopeRepositoryInterface;
use Chill\MainBundle\Service\RollingDate\RollingDate;
use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface;
use Chill\MainBundle\Repository\ScopeRepositoryInterface;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Chill\PersonBundle\Export\Declarations;
use Doctrine\ORM\QueryBuilder;
@ -26,12 +26,12 @@ class ReferrerScopeAggregator implements AggregatorInterface
{
private const SCOPE_KEY = 'acp_agg_refscope_user_history_ref_scope_name';
private RollingDateConverterInterface $rollingDateConverter;
private ScopeRepositoryInterface $scopeRepository;
private TranslatableStringHelperInterface $translatableStringHelper;
private RollingDateConverterInterface $rollingDateConverter;
public function __construct(
ScopeRepositoryInterface $scopeRepository,
TranslatableStringHelperInterface $translatableStringHelper,
@ -69,7 +69,8 @@ class ReferrerScopeAggregator implements AggregatorInterface
)
)
)
->setParameter($dateCalc,
->setParameter(
$dateCalc,
$this->rollingDateConverter->convert($data['date_calc'])
);

View File

@ -24,10 +24,10 @@ use function in_array;
class ChildrenNumberAggregator implements AggregatorInterface
{
private TranslatorInterface $translator;
private RollingDateConverterInterface $rollingDateConverter;
private TranslatorInterface $translator;
public function __construct(
TranslatorInterface $translator,
RollingDateConverterInterface $rollingDateConverter
@ -59,7 +59,8 @@ class ChildrenNumberAggregator implements AggregatorInterface
->addSelect('composition_children.numberOfChildren AS childrennumber_aggregator')
->addGroupBy('childrennumber_aggregator');
$qb->setParameter('ondate_composition_children',
$qb->setParameter(
'ondate_composition_children',
$this->rollingDateConverter->convert($data['on_date'])
);
}

View File

@ -25,12 +25,12 @@ use function in_array;
class CompositionAggregator implements AggregatorInterface
{
private RollingDateConverterInterface $rollingDateConverter;
private TranslatableStringHelper $translatableStringHelper;
private HouseholdCompositionTypeRepository $typeRepository;
private RollingDateConverterInterface $rollingDateConverter;
public function __construct(
HouseholdCompositionTypeRepository $typeRepository,
TranslatableStringHelper $translatableStringHelper,
@ -64,7 +64,8 @@ class CompositionAggregator implements AggregatorInterface
->addSelect('IDENTITY(composition_type.householdCompositionType) AS composition_aggregator')
->addGroupBy('composition_aggregator');
$qb->setParameter('ondate_composition_type',
$qb->setParameter(
'ondate_composition_type',
$this->rollingDateConverter->convert($data['on_date'])
);
}

View File

@ -29,10 +29,10 @@ class ByHouseholdCompositionAggregator implements AggregatorInterface
private HouseholdCompositionTypeRepositoryInterface $householdCompositionTypeRepository;
private TranslatableStringHelperInterface $translatableStringHelper;
private RollingDateConverterInterface $rollingDateConverter;
private TranslatableStringHelperInterface $translatableStringHelper;
public function __construct(
RollingDateConverterInterface $rollingDateConverter,
HouseholdCompositionTypeRepositoryInterface $householdCompositionTypeRepository,
@ -78,7 +78,8 @@ class ByHouseholdCompositionAggregator implements AggregatorInterface
)
)
->addSelect("IDENTITY({$p}_compo.householdCompositionType) AS {$p}_select")
->setParameter("{$p}_date",
->setParameter(
"{$p}_date",
$this->rollingDateConverter->convert($data['date_calc'])
)
->addGroupBy("{$p}_select");

View File

@ -15,9 +15,9 @@ use Chill\MainBundle\Entity\GeographicalUnit;
use Chill\MainBundle\Entity\GeographicalUnitLayer;
use Chill\MainBundle\Export\AggregatorInterface;
use Chill\MainBundle\Form\Type\PickRollingDateType;
use Chill\MainBundle\Repository\GeographicalUnitLayerRepositoryInterface;
use Chill\MainBundle\Service\RollingDate\RollingDate;
use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface;
use Chill\MainBundle\Repository\GeographicalUnitLayerRepositoryInterface;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Chill\PersonBundle\Export\Declarations;
use Doctrine\ORM\Query\Expr\Join;
@ -30,10 +30,10 @@ class GeographicalUnitAggregator implements AggregatorInterface
{
private GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository;
private TranslatableStringHelperInterface $translatableStringHelper;
private RollingDateConverterInterface $rollingDateConverter;
private TranslatableStringHelperInterface $translatableStringHelper;
public function __construct(
GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository,
TranslatableStringHelperInterface $translatableStringHelper,
@ -73,7 +73,8 @@ class GeographicalUnitAggregator implements AggregatorInterface
$qb->expr()->in('person_geog_agg_geog_unit.layer', ':person_geog_agg_layers')
)
)
->setParameter('person_geog_agg_date',
->setParameter(
'person_geog_agg_date',
$this->rollingDateConverter->convert($data['date_calc'])
)
->setParameter('person_geog_agg_layers', $data['level'])

View File

@ -31,12 +31,12 @@ final class HouseholdPositionAggregator implements AggregatorInterface, ExportEl
{
private PositionRepository $positionRepository;
private RollingDateConverterInterface $rollingDateConverter;
private TranslatableStringHelper $translatableStringHelper;
private TranslatorInterface $translator;
private RollingDateConverterInterface $rollingDateConverter;
public function __construct(
TranslatorInterface $translator,
TranslatableStringHelper $translatableStringHelper,
@ -72,7 +72,8 @@ final class HouseholdPositionAggregator implements AggregatorInterface, ExportEl
)
));
$qb->setParameter('date',
$qb->setParameter(
'date',
$this->rollingDateConverter->convert($data['date_position'])
);

View File

@ -53,7 +53,8 @@ class ActiveOnDateFilter implements FilterInterface
}
$qb->add('where', $where);
$qb->setParameter('ondate',
$qb->setParameter(
'ondate',
$this->rollingDateConverter->convert($data['on_date'])
);
}

View File

@ -38,10 +38,12 @@ class ActiveOneDayBetweenDatesFilter implements FilterInterface
$clause = "OVERLAPSI (acp.openingDate, acp.closingDate), (:datefrom, :dateto) = 'TRUE'";
$qb->andWhere($clause);
$qb->setParameter('datefrom',
$qb->setParameter(
'datefrom',
$this->rollingDateConverter->convert($data['date_from'])
);
$qb->setParameter('dateto',
$qb->setParameter(
'dateto',
$this->rollingDateConverter->convert($data['date_to'])
);
}

View File

@ -16,10 +16,10 @@ use Chill\MainBundle\Entity\GeographicalUnit;
use Chill\MainBundle\Entity\GeographicalUnit\SimpleGeographicalUnitDTO;
use Chill\MainBundle\Export\FilterInterface;
use Chill\MainBundle\Form\Type\PickRollingDateType;
use Chill\MainBundle\Service\RollingDate\RollingDate;
use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface;
use Chill\MainBundle\Repository\GeographicalUnitLayerRepositoryInterface;
use Chill\MainBundle\Repository\GeographicalUnitRepositoryInterface;
use Chill\MainBundle\Service\RollingDate\RollingDate;
use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Chill\PersonBundle\Entity\AccompanyingPeriod;
use Chill\PersonBundle\Entity\Household\PersonHouseholdAddress;
@ -40,10 +40,10 @@ class GeographicalUnitStatFilter implements FilterInterface
private GeographicalUnitRepositoryInterface $geographicalUnitRepository;
private TranslatableStringHelperInterface $translatableStringHelper;
private RollingDateConverterInterface $rollingDateConverter;
private TranslatableStringHelperInterface $translatableStringHelper;
public function __construct(
EntityManagerInterface $em,
GeographicalUnitRepositoryInterface $geographicalUnitRepository,
@ -88,7 +88,8 @@ class GeographicalUnitStatFilter implements FilterInterface
$qb
->andWhere($qb->expr()->exists($subQueryDql))
->setParameter('acp_geog_filter_date',
->setParameter(
'acp_geog_filter_date',
$this->rollingDateConverter->convert($data['date_calc'])
)
->setParameter('acp_geog_filter_units', array_map(static fn (SimpleGeographicalUnitDTO $unitDTO) => $unitDTO->id, $data['units']));

View File

@ -49,7 +49,8 @@ class HasNoReferrerFilter implements FilterInterface
AND uh.accompanyingPeriod = acp
)
')
->setParameter('has_no_referrer_filter_date',
->setParameter(
'has_no_referrer_filter_date',
$this->rollingDateConverter->convert($data['calc_date'])
);
}

View File

@ -42,7 +42,8 @@ class HasTemporaryLocationFilter implements FilterInterface
->join('acp.locationHistories', 'acp_having_temporarily_location')
->andWhere('acp_having_temporarily_location.startDate <= :acp_having_temporarily_location_date
AND (acp_having_temporarily_location.endDate IS NULL OR acp_having_temporarily_location.endDate > :acp_having_temporarily_location_date)')
->setParameter('acp_having_temporarily_location_date',
->setParameter(
'acp_having_temporarily_location_date',
$this->rollingDateConverter->convert($data['calc_date'])
);

View File

@ -13,9 +13,9 @@ namespace Chill\PersonBundle\Export\Filter\AccompanyingCourseFilters;
use Chill\MainBundle\Export\FilterInterface;
use Chill\MainBundle\Form\Type\PickRollingDateType;
use Chill\MainBundle\Form\Type\PickUserDynamicType;
use Chill\MainBundle\Service\RollingDate\RollingDate;
use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface;
use Chill\MainBundle\Form\Type\PickUserDynamicType;
use Chill\MainBundle\Templating\Entity\UserRender;
use Chill\PersonBundle\Export\Declarations;
use Doctrine\ORM\QueryBuilder;
@ -29,10 +29,10 @@ class ReferrerFilter implements FilterInterface
private const PU = 'acp_referrer_filter_users';
private UserRender $userRender;
private RollingDateConverterInterface $rollingDateConverter;
private UserRender $userRender;
public function __construct(
UserRender $userRender,
RollingDateConverterInterface $rollingDateConverter
@ -63,7 +63,8 @@ class ReferrerFilter implements FilterInterface
$qb->expr()->in(self::A . '.user', ':' . self::PU)
)
->setParameter(self::PU, $data['accepted_referrers'])
->setParameter(self::P,
->setParameter(
self::P,
$this->rollingDateConverter->convert($data['date_calc'])
);
}

View File

@ -15,9 +15,9 @@ use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Entity\UserJob;
use Chill\MainBundle\Export\FilterInterface;
use Chill\MainBundle\Form\Type\PickRollingDateType;
use Chill\MainBundle\Repository\UserJobRepositoryInterface;
use Chill\MainBundle\Service\RollingDate\RollingDate;
use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface;
use Chill\MainBundle\Repository\UserJobRepositoryInterface;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Chill\PersonBundle\Export\Declarations;
use Doctrine\ORM\QueryBuilder;
@ -35,14 +35,14 @@ class UserJobFilter implements FilterInterface
private const PJ = 'acp_ujob_filter_job';
private RollingDateConverterInterface $rollingDateConverter;
private Security $security;
private TranslatableStringHelper $translatableStringHelper;
private UserJobRepositoryInterface $userJobRepository;
private RollingDateConverterInterface $rollingDateConverter;
public function __construct(
Security $security,
TranslatableStringHelper $translatableStringHelper,
@ -73,7 +73,8 @@ class UserJobFilter implements FilterInterface
)
)
)
->setParameter(self::P,
->setParameter(
self::P,
$this->rollingDateConverter->convert($data['date_calc'])
)
->join(self::A . '.user', self::AU)

View File

@ -15,9 +15,9 @@ use Chill\MainBundle\Entity\Scope;
use Chill\MainBundle\Entity\User;
use Chill\MainBundle\Export\FilterInterface;
use Chill\MainBundle\Form\Type\PickRollingDateType;
use Chill\MainBundle\Repository\ScopeRepositoryInterface;
use Chill\MainBundle\Service\RollingDate\RollingDate;
use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface;
use Chill\MainBundle\Repository\ScopeRepositoryInterface;
use Chill\MainBundle\Templating\TranslatableStringHelper;
use Chill\PersonBundle\Export\Declarations;
use Doctrine\ORM\QueryBuilder;
@ -35,14 +35,14 @@ class UserScopeFilter implements FilterInterface
private const PS = 'acp_uscope_filter_scopes';
private RollingDateConverterInterface $rollingDateConverter;
private ScopeRepositoryInterface $scopeRepository;
private Security $security;
private TranslatableStringHelper $translatableStringHelper;
private RollingDateConverterInterface $rollingDateConverter;
public function __construct(
ScopeRepositoryInterface $scopeRepository,
Security $security,
@ -73,7 +73,8 @@ class UserScopeFilter implements FilterInterface
)
)
)
->setParameter(self::P,
->setParameter(
self::P,
$this->rollingDateConverter->convert($data['date_calc'])
)
->join(self::A . '.user', self::AU)

View File

@ -38,10 +38,12 @@ class ByEndDateFilter implements FilterInterface
{
$qb
->andWhere('workeval.endDate BETWEEN :work_eval_by_end_date_start_date and :work_eval_by_end_date_end_date')
->setParameter('work_eval_by_end_date_start_date',
->setParameter(
'work_eval_by_end_date_start_date',
$this->rollingDateConverter->convert($data['start_date'])
)
->setParameter('work_eval_by_end_date_end_date',
->setParameter(
'work_eval_by_end_date_end_date',
$this->rollingDateConverter->convert($data['end_date'])
);
}

View File

@ -38,10 +38,12 @@ class ByStartDateFilter implements FilterInterface
{
$qb
->andWhere('workeval.startDate BETWEEN :work_eval_by_start_date_start_date and :work_eval_by_start_date_end_date')
->setParameter('work_eval_by_start_date_start_date',
->setParameter(
'work_eval_by_start_date_start_date',
$this->rollingDateConverter->convert($data['start_date'])
)
->setParameter('work_eval_by_start_date_end_date',
->setParameter(
'work_eval_by_start_date_end_date',
$this->rollingDateConverter->convert($data['end_date'])
);
}

View File

@ -26,10 +26,10 @@ use function in_array;
class CompositionFilter implements FilterInterface
{
private TranslatableStringHelper $translatableStringHelper;
private RollingDateConverterInterface $rollingDateConverter;
private TranslatableStringHelper $translatableStringHelper;
public function __construct(
TranslatableStringHelper $translatableStringHelper,
RollingDateConverterInterface $rollingDateConverter
@ -62,7 +62,8 @@ class CompositionFilter implements FilterInterface
$qb->andWhere($whereClause);
$qb->setParameter('compositions', $data['accepted_composition']);
$qb->setParameter('ondate_composition_type_filter',
$qb->setParameter(
'ondate_composition_type_filter',
$this->rollingDateConverter->convert($data['on_date'])
);
}

View File

@ -52,10 +52,12 @@ class BirthdateFilter implements ExportElementValidatedInterface, FilterInterfac
}
$qb->add('where', $where);
$qb->setParameter('date_from',
$qb->setParameter(
'date_from',
$this->rollingDateConverter->convert($data['date_from'])
);
$qb->setParameter('date_to',
$qb->setParameter(
'date_to',
$this->rollingDateConverter->convert($data['date_to'])
);
}

View File

@ -53,10 +53,12 @@ class DeathdateFilter implements ExportElementValidatedInterface, FilterInterfac
}
$qb->add('where', $where);
$qb->setParameter('date_from',
$qb->setParameter(
'date_from',
$this->rollingDateConverter->convert($data['date_from'])
);
$qb->setParameter('date_to',
$qb->setParameter(
'date_to',
$this->rollingDateConverter->convert($data['date_to'])
);
}

View File

@ -14,10 +14,10 @@ namespace Chill\PersonBundle\Export\Filter\PersonFilters;
use Chill\MainBundle\Entity\GeographicalUnit;
use Chill\MainBundle\Entity\GeographicalUnit\SimpleGeographicalUnitDTO;
use Chill\MainBundle\Form\Type\PickRollingDateType;
use Chill\MainBundle\Service\RollingDate\RollingDate;
use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface;
use Chill\MainBundle\Repository\GeographicalUnitLayerRepositoryInterface;
use Chill\MainBundle\Repository\GeographicalUnitRepositoryInterface;
use Chill\MainBundle\Service\RollingDate\RollingDate;
use Chill\MainBundle\Service\RollingDate\RollingDateConverterInterface;
use Chill\MainBundle\Templating\TranslatableStringHelperInterface;
use Chill\PersonBundle\Entity\Household\PersonHouseholdAddress;
use Chill\PersonBundle\Export\Declarations;
@ -31,10 +31,10 @@ class GeographicalUnitFilter implements \Chill\MainBundle\Export\FilterInterface
private GeographicalUnitRepositoryInterface $geographicalUnitRepository;
private TranslatableStringHelperInterface $translatableStringHelper;
private RollingDateConverterInterface $rollingDateConverter;
private TranslatableStringHelperInterface $translatableStringHelper;
public function __construct(
GeographicalUnitRepositoryInterface $geographicalUnitRepository,
GeographicalUnitLayerRepositoryInterface $geographicalUnitLayerRepository,
@ -75,7 +75,8 @@ class GeographicalUnitFilter implements \Chill\MainBundle\Export\FilterInterface
->andWhere(
$qb->expr()->exists($subQuery)
)
->setParameter('person_filter_geog_date',
->setParameter(
'person_filter_geog_date',
$this->rollingDateConverter->convert($data['date_calc'])
)
->setParameter('person_filter_geog_units', array_map(static fn (SimpleGeographicalUnitDTO $unitDTO) => $unitDTO->id, $data['units']));

View File

@ -27,10 +27,10 @@ use function in_array;
class ResidentialAddressAtThirdpartyFilter implements FilterInterface
{
private TranslatableStringHelper $translatableStringHelper;
private RollingDateConverterInterface $rollingDateConverter;
private TranslatableStringHelper $translatableStringHelper;
public function __construct(
RollingDateConverterInterface $rollingDateConverter,
TranslatableStringHelper $translatableStringHelper
@ -83,7 +83,8 @@ class ResidentialAddressAtThirdpartyFilter implements FilterInterface
}
$qb->setParameter('type', $data['thirdparty_cat']);
$qb->setParameter('date',
$qb->setParameter(
'date',
$this->rollingDateConverter->convert($data['date_calc'])
);
$qb->add('where', $where);

View File

@ -66,7 +66,8 @@ class ResidentialAddressAtUserFilter implements FilterInterface
$where = $qb->expr()->andX($clause);
}
$qb->setParameter('date',
$qb->setParameter(
'date',
$this->rollingDateConverter->convert($data['date_calc'])
);
$qb->add('where', $where);

View File

@ -48,10 +48,12 @@ class ReportDateFilter implements FilterInterface
}
$qb->add('where', $where);
$qb->setParameter('report_date_filter_date_from',
$qb->setParameter(
'report_date_filter_date_from',
$this->rollingDateConverter->convert($data['date_from'])
);
$qb->setParameter('report_date_filter_date_to',
$qb->setParameter(
'report_date_filter_date_to',
$this->rollingDateConverter->convert($data['date_to'])
);
}