mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +00:00
Fix use import and add a "not null" condition on travel time
This commit is contained in:
parent
58eb089d1c
commit
2c46886e36
@ -17,6 +17,7 @@ use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
|
|||||||
use Chill\MainBundle\Export\ExportInterface;
|
use Chill\MainBundle\Export\ExportInterface;
|
||||||
use Chill\MainBundle\Export\FormatterInterface;
|
use Chill\MainBundle\Export\FormatterInterface;
|
||||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||||
|
use Chill\PersonBundle\Export\Declarations as PersonDeclarations;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
use Doctrine\ORM\Query;
|
use Doctrine\ORM\Query;
|
||||||
@ -55,7 +56,7 @@ class SumActivityDuration implements ExportInterface, GroupedExportInterface
|
|||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
if ('export_sum_activity_duration' !== $key) {
|
if ('export_sum_activity_duration' !== $key) {
|
||||||
throw new LogicException("the key {$key} is not used by this export");
|
throw new \LogicException("the key {$key} is not used by this export");
|
||||||
}
|
}
|
||||||
|
|
||||||
return static fn ($value) => '_header' === $value ? 'Sum activities linked to an accompanying period duration' : $value;
|
return static fn ($value) => '_header' === $value ? 'Sum activities linked to an accompanying period duration' : $value;
|
||||||
@ -89,7 +90,8 @@ class SumActivityDuration implements ExportInterface, GroupedExportInterface
|
|||||||
$qb->join('activity.accompanyingPeriod', 'acp');
|
$qb->join('activity.accompanyingPeriod', 'acp');
|
||||||
}
|
}
|
||||||
|
|
||||||
$qb->select('SUM(activity.durationTime) as export_sum_activity_duration');
|
$qb->select('SUM(activity.durationTime) as export_sum_activity_duration')
|
||||||
|
->andWhere($qb->expr()->isNotNull('activity.durationTime'));
|
||||||
|
|
||||||
return $qb;
|
return $qb;
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,7 @@ use Chill\ActivityBundle\Security\Authorization\ActivityStatsVoter;
|
|||||||
use Chill\MainBundle\Export\ExportInterface;
|
use Chill\MainBundle\Export\ExportInterface;
|
||||||
use Chill\MainBundle\Export\FormatterInterface;
|
use Chill\MainBundle\Export\FormatterInterface;
|
||||||
use Chill\MainBundle\Export\GroupedExportInterface;
|
use Chill\MainBundle\Export\GroupedExportInterface;
|
||||||
|
use Chill\PersonBundle\Export\Declarations as PersonDeclarations;
|
||||||
use Doctrine\ORM\EntityManagerInterface;
|
use Doctrine\ORM\EntityManagerInterface;
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
use Doctrine\ORM\Query;
|
use Doctrine\ORM\Query;
|
||||||
@ -55,7 +56,7 @@ class SumActivityVisitDuration implements ExportInterface, GroupedExportInterfac
|
|||||||
public function getLabels($key, array $values, $data)
|
public function getLabels($key, array $values, $data)
|
||||||
{
|
{
|
||||||
if ('export_sum_activity_visit_duration' !== $key) {
|
if ('export_sum_activity_visit_duration' !== $key) {
|
||||||
throw new LogicException("the key {$key} is not used by this export");
|
throw new \LogicException("the key {$key} is not used by this export");
|
||||||
}
|
}
|
||||||
|
|
||||||
return static fn ($value) => '_header' === $value ? 'Sum activities linked to an accompanying period visit duration' : $value;
|
return static fn ($value) => '_header' === $value ? 'Sum activities linked to an accompanying period visit duration' : $value;
|
||||||
@ -89,7 +90,8 @@ class SumActivityVisitDuration implements ExportInterface, GroupedExportInterfac
|
|||||||
$qb->join('activity.accompanyingPeriod', 'acp');
|
$qb->join('activity.accompanyingPeriod', 'acp');
|
||||||
}
|
}
|
||||||
|
|
||||||
$qb->select('SUM(activity.travelTime) as export_sum_activity_visit_duration');
|
$qb->select('SUM(activity.travelTime) as export_sum_activity_visit_duration')
|
||||||
|
->andWhere($qb->expr()->isNotNull('activity.travelTime'));
|
||||||
|
|
||||||
return $qb;
|
return $qb;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user