Also add stuff not in budgets.

This commit is contained in:
Sander Dorigo 2014-11-08 09:15:03 +01:00
parent ab4f34a96b
commit 6d8f84654f

View File

@ -169,6 +169,7 @@ class GoogleChartController extends BaseController
foreach ($budgets as $budget) {
$chart->addColumn($budget->name, 'number');
}
$chart->addColumn('No budget','number');
/*
* Loop budgets this year.
@ -182,6 +183,14 @@ class GoogleChartController extends BaseController
$row[] = $bdt->spentInMonth($budget, $start);
}
/*
* Without a budget:
*/
$endOfMonth = clone $start;
$endOfMonth->endOfMonth();
$set = $bdt->transactionsWithoutBudgetInDateRange($start, $endOfMonth);
$row[] = floatval($set->sum('amount')) * -1;
$chart->addRowArray($row);
$start->addMonth();
}