fixes for budgets

This commit is contained in:
2022-03-03 10:37:10 +01:00
parent ac12e75714
commit 0833bb49ca
13 changed files with 97 additions and 84 deletions

View File

@@ -30,8 +30,11 @@ class ResourceRepository extends EntityRepository
$entityStr = $entity instanceof Person ? 'person' : 'household';
$qb->where("c.{$entityStr} = :{$entityStr}")
->andWhere('c.startDate < :date')
->andWhere('c.startDate < :date OR c.startDate IS NULL');
// TODO: in controller, the budget and charges asked are also for future and actual
//->andWhere('c.startDate < :date')
// TODO: there is a misconception here, the end date must be lower or null. startDate are never null
//->andWhere('c.startDate < :date OR c.startDate IS NULL');
;
if (null !== $sort) {
$qb->orderBy($sort);
@@ -39,7 +42,7 @@ class ResourceRepository extends EntityRepository
$qb->setParameters([
$entityStr => $entity,
'date' => $date,
//'date' => $date,
]);
return $qb->getQuery()->getResult();