diff --git a/app/controllers/GoogleChartController.php b/app/controllers/GoogleChartController.php index fb76aecc18..b72d791379 100644 --- a/app/controllers/GoogleChartController.php +++ b/app/controllers/GoogleChartController.php @@ -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(); }