mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
fix cs
This commit is contained in:
@@ -19,7 +19,6 @@ use Chill\PersonBundle\Entity\Household\Household;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use DateTime;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Monolog\DateTimeImmutable;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
@@ -129,28 +128,31 @@ class ElementController extends AbstractController
|
||||
// TODO replace this by calculators
|
||||
$wholeCharges = $actualCharges;
|
||||
$wholeResources = $actualResources;
|
||||
|
||||
foreach ($household->getCurrentPersons() as $person) {
|
||||
$wholeCharges = array_merge(
|
||||
$wholeCharges,
|
||||
$this->em
|
||||
->getRepository(Charge::class)
|
||||
->findByEntityAndDate($person, $now));
|
||||
->findByEntityAndDate($person, $now)
|
||||
);
|
||||
$wholeResources = array_merge(
|
||||
$wholeResources,
|
||||
$this->em
|
||||
->getRepository(Resource::class)
|
||||
->findByEntityAndDate($person, $now));
|
||||
->getRepository(Resource::class)
|
||||
->findByEntityAndDate($person, $now)
|
||||
);
|
||||
}
|
||||
|
||||
return $this->render('ChillBudgetBundle:Household:index.html.twig', [
|
||||
'household' => $household,
|
||||
'charges' => $charges,
|
||||
'resources' => $ressources,
|
||||
'wholeResources' => array_filter($wholeResources, function (Resource $r) use ($now) {
|
||||
return $r->getStartDate() <= $now and ($r->getEndDate() === null or $r->getEndDate() >= $now);
|
||||
'wholeResources' => array_filter($wholeResources, static function (Resource $r) use ($now) {
|
||||
return $r->getStartDate() <= $now && ($r->getEndDate() === null || $r->getEndDate() >= $now);
|
||||
}),
|
||||
'wholeCharges' => array_filter($wholeCharges, function (Charge $c) use ($now) {
|
||||
return $c->getStartDate() <= $now and ($c->getEndDate() === null or $c->getEndDate() >= $now);
|
||||
'wholeCharges' => array_filter($wholeCharges, static function (Charge $c) use ($now) {
|
||||
return $c->getStartDate() <= $now && ($c->getEndDate() === null || $c->getEndDate() >= $now);
|
||||
}),
|
||||
'results' => $results ?? [],
|
||||
]);
|
||||
|
Reference in New Issue
Block a user