Some bug fixes and cleanup.

This commit is contained in:
James Cole
2015-06-05 16:49:16 +02:00
parent 834b1afb38
commit 40e49ffc37
5 changed files with 27 additions and 18 deletions

View File

@@ -55,17 +55,25 @@ class BudgetController extends Controller
while ($first < $last) {
$end = Navigation::addPeriod($first, $range, 0);
$end->subDay();
// start date for chart.
$chartDate = clone $end;
$chartDate->startOfMonth();
$spent = $repository->spentInPeriodCorrected($budget, $first, $end);
$chart->addRow($end, $spent);
$chart->addRow($chartDate, $spent);
$first = Navigation::addPeriod($first, $range, 0);
}
$chart->generate();
$data = $chart->getData();
$cache->store($data);
return Response::json($data);
@@ -242,7 +250,7 @@ class BudgetController extends Controller
}
$chart->addRowArray($row);
$start->addMonth();
$start->endOfMonth()->addDay();
}
$chart->generate();