Various code cleanup.

This commit is contained in:
James Cole
2016-11-20 11:43:19 +01:00
parent 75a524c656
commit 94875adb6c
60 changed files with 544 additions and 563 deletions

View File

@@ -252,7 +252,7 @@ class BudgetController extends Controller
// join them:
$result = [];
foreach (array_keys($periods) as $period) {
$nice = $periods[$period];
$nice = $periods[$period];
$result[$nice] = [
'spent' => isset($entries[$period]) ? $entries[$period] : '0',
'budgeted' => isset($entries[$period]) ? $budgeted[$period] : 0,

View File

@@ -299,16 +299,17 @@ class CategoryReportController extends Controller
/** @var Category $category */
foreach ($categories as $category) {
// get sum, and get label:
$categoryId = $category->id;
$data[$label]['name'][$categoryId] = $category->name;
$data[$label]['in'][$categoryId] = $income[$categoryId] ?? '0';
$data[$label]['out'][$categoryId] = $expenses[$categoryId] ?? '0';
$categoryId = $category->id;
$data[$label]['name'][$categoryId] = $category->name;
$data[$label]['in'][$categoryId] = $income[$categoryId] ?? '0';
$data[$label]['out'][$categoryId] = $expenses[$categoryId] ?? '0';
}
$current = Navigation::addPeriod($current, $period, 0);
}
$data = $this->generator->mainReportChart($data);
return Response::json($data);
}

View File

@@ -128,9 +128,9 @@ class ReportController extends Controller
}
/**
* @param Carbon $start
* @param Carbon $end
* @param Collection $accounts
* @param Carbon $start
* @param Carbon $end
* @param Collection $accounts
*
* @return \Illuminate\Http\JsonResponse
* @internal param AccountRepositoryInterface $repository