Attempt to fix bug #133

This commit is contained in:
James Cole 2015-12-24 09:45:21 +01:00
parent a6d71988f2
commit 5a61a11a61
2 changed files with 2 additions and 5 deletions

View File

@ -129,10 +129,8 @@ class ChartJsBudgetChartGenerator implements BudgetChartGenerator
foreach ($entries as $entry) {
$array = [
'label' => $entry[0]->formatLocalized($format),
'data' => [],
'data' => array_shift($entry),
];
array_shift($entry);
$array['data'] = $entry;
$data['datasets'][] = $array;
}

View File

@ -290,7 +290,6 @@ class BudgetController extends Controller
}
// filter empty budgets:
foreach ($allBudgets as $budget) {
$spent = $repository->balanceInPeriodForList($budget, $start, $end, $accounts);
if ($spent != 0) {
@ -315,7 +314,7 @@ class BudgetController extends Controller
$start->endOfMonth()->addDay();
}
$data = $this->generator->year($allBudgets, $entries);
$data = $this->generator->year($budgets, $entries);
$cache->store($data);
return Response::json($data);