Original fix in place. #133

This commit is contained in:
James Cole
2015-12-24 09:50:28 +01:00
parent 8bab9e84e2
commit 8cdcba3231

View File

@@ -290,12 +290,12 @@ class BudgetController extends Controller
} }
// filter empty budgets: // filter empty budgets:
// foreach ($allBudgets as $budget) { foreach ($allBudgets as $budget) {
// $spent = $repository->balanceInPeriodForList($budget, $start, $end, $accounts); $spent = $repository->balanceInPeriodForList($budget, $start, $end, $accounts);
// if ($spent != 0) { if ($spent != 0) {
// $budgets->push($budget); $budgets->push($budget);
// } }
// } }
$entries = new Collection; $entries = new Collection;
@@ -306,7 +306,7 @@ class BudgetController extends Controller
$row = [clone $start]; $row = [clone $start];
// each budget, fill the row: // each budget, fill the row:
foreach ($allBudgets as $budget) { foreach ($budgets as $budget) {
$spent = $repository->balanceInPeriodForList($budget, $start, $month, $accounts); $spent = $repository->balanceInPeriodForList($budget, $start, $month, $accounts);
$row[] = $spent * -1; $row[] = $spent * -1;
} }
@@ -314,7 +314,7 @@ class BudgetController extends Controller
$start->endOfMonth()->addDay(); $start->endOfMonth()->addDay();
} }
$data = $this->generator->year($allBudgets, $entries); $data = $this->generator->year($budgets, $entries);
$cache->store($data); $cache->store($data);
return Response::json($data); return Response::json($data);