Properly show spent and earned. #109

This commit is contained in:
James Cole
2015-09-13 07:40:37 +02:00
parent fa586dba7e
commit 51c7d4fb1b
3 changed files with 86 additions and 2 deletions

View File

@@ -65,8 +65,9 @@ class CategoryController extends Controller
while ($start <= $end) {
$currentEnd = Navigation::endOfPeriod($start, $range);
$spent = $repository->balanceInPeriod($category, $start, $currentEnd, true);
$entries->push([clone $start, $spent]);
$spent = $repository->spentInPeriod($category, $start, $currentEnd);
$earned = $repository->earnedInPeriod($category, $start, $currentEnd);
$entries->push([clone $start, $spent, $earned]);
$start = Navigation::addPeriod($start, $range, 0);
}