refactored page actions to event subscriber (#2420)
This commit is contained in:
@@ -52,8 +52,15 @@ final class ProjectViewService
|
||||
->leftJoin(Timesheet::class, 't', 'WITH', 'p.id = t.project')
|
||||
->andWhere($qb->expr()->eq('p.visible', true))
|
||||
->andWhere($qb->expr()->eq('c.visible', true))
|
||||
->andWhere(
|
||||
$qb->expr()->orX(
|
||||
$qb->expr()->isNull('p.end'),
|
||||
$qb->expr()->gte('p.end', ':project_end')
|
||||
)
|
||||
)
|
||||
->addGroupBy('p')
|
||||
->addGroupBy('t.project')
|
||||
->setParameter('project_end', $today, Types::DATETIME_MUTABLE)
|
||||
;
|
||||
|
||||
if ($query->getCustomer() !== null) {
|
||||
@@ -68,8 +75,8 @@ final class ProjectViewService
|
||||
if (!$query->isIncludeNoBudget()) {
|
||||
$qb->andWhere(
|
||||
$qb->expr()->orX(
|
||||
$qb->expr()->gt('p.budget', 0),
|
||||
$qb->expr()->gt('p.timeBudget', 0)
|
||||
$qb->expr()->gt('p.timeBudget', 0),
|
||||
$qb->expr()->gt('p.budget', 0)
|
||||
)
|
||||
);
|
||||
}
|
||||
@@ -83,7 +90,7 @@ final class ProjectViewService
|
||||
$entity = new ProjectViewModel();
|
||||
$entity->setProject($res['project']);
|
||||
$entity->setDurationTotal($res['totalDuration'] ?? 0);
|
||||
$entity->setRateTotal($res['totalRate'] ?? 0);
|
||||
$entity->setRateTotal($res['totalRate'] ?? 0.00);
|
||||
|
||||
$projectViews[$entity->getProject()->getId()] = $entity;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user