From 2faae839120fee26337d3eef9fa97734730a889d Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 24 Dec 2015 09:47:44 +0100 Subject: [PATCH] Include empty budgets. #133 --- app/Http/Controllers/Chart/BudgetController.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/Chart/BudgetController.php b/app/Http/Controllers/Chart/BudgetController.php index 85021011fd..ababff90b4 100644 --- a/app/Http/Controllers/Chart/BudgetController.php +++ b/app/Http/Controllers/Chart/BudgetController.php @@ -290,12 +290,12 @@ class BudgetController extends Controller } // filter empty budgets: - foreach ($allBudgets as $budget) { - $spent = $repository->balanceInPeriodForList($budget, $start, $end, $accounts); - if ($spent != 0) { - $budgets->push($budget); - } - } +// foreach ($allBudgets as $budget) { +// $spent = $repository->balanceInPeriodForList($budget, $start, $end, $accounts); +// if ($spent != 0) { +// $budgets->push($budget); +// } +// } $entries = new Collection; @@ -306,7 +306,7 @@ class BudgetController extends Controller $row = [clone $start]; // each budget, fill the row: - foreach ($budgets as $budget) { + foreach ($allBudgets as $budget) { $spent = $repository->balanceInPeriodForList($budget, $start, $month, $accounts); $row[] = $spent * -1; } @@ -314,7 +314,7 @@ class BudgetController extends Controller $start->endOfMonth()->addDay(); } - $data = $this->generator->year($budgets, $entries); + $data = $this->generator->year($allBudgets, $entries); $cache->store($data); return Response::json($data);