Made reportType camelCase.

This commit is contained in:
James Cole
2015-12-28 20:04:54 +01:00
parent 6ab6dd6ac3
commit 026683a8e1
9 changed files with 52 additions and 52 deletions

View File

@@ -37,14 +37,14 @@ class AccountController extends Controller
/** /**
* Shows the balances for a given set of dates and accounts. * Shows the balances for a given set of dates and accounts.
* *
* @param $report_type * @param $reportType
* @param Carbon $start * @param Carbon $start
* @param Carbon $end * @param Carbon $end
* @param Collection $accounts * @param Collection $accounts
* *
* @return \Illuminate\Http\JsonResponse * @return \Illuminate\Http\JsonResponse
*/ */
public function report($report_type, Carbon $start, Carbon $end, Collection $accounts) public function report($reportType, Carbon $start, Carbon $end, Collection $accounts)
{ {
// chart properties for cache: // chart properties for cache:
$cache = new CacheProperties(); $cache = new CacheProperties();

View File

@@ -40,7 +40,7 @@ class BudgetController extends Controller
* TODO expand with no budget chart. * TODO expand with no budget chart.
* *
* @param BudgetRepositoryInterface $repository * @param BudgetRepositoryInterface $repository
* @param $report_type * @param $reportType
* @param Carbon $start * @param Carbon $start
* @param Carbon $end * @param Carbon $end
* @param Collection $accounts * @param Collection $accounts
@@ -48,11 +48,11 @@ class BudgetController extends Controller
* *
* @return \Illuminate\Http\JsonResponse * @return \Illuminate\Http\JsonResponse
*/ */
public function multiYear(BudgetRepositoryInterface $repository, $report_type, Carbon $start, Carbon $end, Collection $accounts, Collection $budgets) public function multiYear(BudgetRepositoryInterface $repository, $reportType, Carbon $start, Carbon $end, Collection $accounts, Collection $budgets)
{ {
// chart properties for cache: // chart properties for cache:
$cache = new CacheProperties(); $cache = new CacheProperties();
$cache->addProperty($report_type); $cache->addProperty($reportType);
$cache->addProperty($start); $cache->addProperty($start);
$cache->addProperty($end); $cache->addProperty($end);
$cache->addProperty($accounts); $cache->addProperty($accounts);
@@ -281,20 +281,20 @@ class BudgetController extends Controller
* TODO expand with no budget chart. * TODO expand with no budget chart.
* *
* @param BudgetRepositoryInterface $repository * @param BudgetRepositoryInterface $repository
* @param $report_type * @param $reportType
* @param Carbon $start * @param Carbon $start
* @param Carbon $end * @param Carbon $end
* @param Collection $accounts * @param Collection $accounts
* *
* @return \Illuminate\Http\JsonResponse * @return \Illuminate\Http\JsonResponse
*/ */
public function year(BudgetRepositoryInterface $repository, $report_type, Carbon $start, Carbon $end, Collection $accounts) public function year(BudgetRepositoryInterface $repository, $reportType, Carbon $start, Carbon $end, Collection $accounts)
{ {
// chart properties for cache: // chart properties for cache:
$cache = new CacheProperties(); $cache = new CacheProperties();
$cache->addProperty($start); $cache->addProperty($start);
$cache->addProperty($end); $cache->addProperty($end);
$cache->addProperty($report_type); $cache->addProperty($reportType);
$cache->addProperty($accounts); $cache->addProperty($accounts);
$cache->addProperty('budget'); $cache->addProperty('budget');
$cache->addProperty('year'); $cache->addProperty('year');

View File

@@ -130,7 +130,7 @@ class CategoryController extends Controller
/** /**
* @param CategoryRepositoryInterface $repository * @param CategoryRepositoryInterface $repository
* @param $report_type * @param $reportType
* @param Carbon $start * @param Carbon $start
* @param Carbon $end * @param Carbon $end
* @param Collection $accounts * @param Collection $accounts
@@ -138,11 +138,11 @@ class CategoryController extends Controller
* *
* @return \Illuminate\Http\JsonResponse * @return \Illuminate\Http\JsonResponse
*/ */
public function multiYear(CategoryRepositoryInterface $repository, $report_type, Carbon $start, Carbon $end, Collection $accounts, Collection $categories) public function multiYear(CategoryRepositoryInterface $repository, $reportType, Carbon $start, Carbon $end, Collection $accounts, Collection $categories)
{ {
// chart properties for cache: // chart properties for cache:
$cache = new CacheProperties(); $cache = new CacheProperties();
$cache->addProperty($report_type); $cache->addProperty($reportType);
$cache->addProperty($start); $cache->addProperty($start);
$cache->addProperty($end); $cache->addProperty($end);
$cache->addProperty($accounts); $cache->addProperty($accounts);
@@ -296,20 +296,20 @@ class CategoryController extends Controller
* grouped by month. * grouped by month.
* *
* @param CategoryRepositoryInterface $repository * @param CategoryRepositoryInterface $repository
* @param $report_type * @param $reportType
* @param Carbon $start * @param Carbon $start
* @param Carbon $end * @param Carbon $end
* @param Collection $accounts * @param Collection $accounts
* *
* @return \Illuminate\Http\JsonResponse * @return \Illuminate\Http\JsonResponse
*/ */
public function earnedInPeriod(CategoryRepositoryInterface $repository, $report_type, Carbon $start, Carbon $end, Collection $accounts) public function earnedInPeriod(CategoryRepositoryInterface $repository, $reportType, Carbon $start, Carbon $end, Collection $accounts)
{ {
$original = clone $start; $original = clone $start;
$cache = new CacheProperties; // chart properties for cache: $cache = new CacheProperties; // chart properties for cache:
$cache->addProperty($start); $cache->addProperty($start);
$cache->addProperty($end); $cache->addProperty($end);
$cache->addProperty($report_type); $cache->addProperty($reportType);
$cache->addProperty($accounts); $cache->addProperty($accounts);
$cache->addProperty('category'); $cache->addProperty('category');
$cache->addProperty('earned-in-period'); $cache->addProperty('earned-in-period');
@@ -400,20 +400,20 @@ class CategoryController extends Controller
* grouped by month. * grouped by month.
* *
* @param CategoryRepositoryInterface $repository * @param CategoryRepositoryInterface $repository
* @param $report_type * @param $reportType
* @param Carbon $start * @param Carbon $start
* @param Carbon $end * @param Carbon $end
* @param Collection $accounts * @param Collection $accounts
* *
* @return \Illuminate\Http\JsonResponse * @return \Illuminate\Http\JsonResponse
*/ */
public function spentInPeriod(CategoryRepositoryInterface $repository, $report_type, Carbon $start, Carbon $end, Collection $accounts) public function spentInPeriod(CategoryRepositoryInterface $repository, $reportType, Carbon $start, Carbon $end, Collection $accounts)
{ {
$original = clone $start; $original = clone $start;
$cache = new CacheProperties; // chart properties for cache: $cache = new CacheProperties; // chart properties for cache:
$cache->addProperty($start); $cache->addProperty($start);
$cache->addProperty($end); $cache->addProperty($end);
$cache->addProperty($report_type); $cache->addProperty($reportType);
$cache->addProperty($accounts); $cache->addProperty($accounts);
$cache->addProperty('category'); $cache->addProperty('category');
$cache->addProperty('spent-in-period'); $cache->addProperty('spent-in-period');

View File

@@ -36,14 +36,14 @@ class ReportController extends Controller
* Summarizes all income and expenses, per month, for a given year. * Summarizes all income and expenses, per month, for a given year.
* *
* @param ReportQueryInterface $query * @param ReportQueryInterface $query
* @param $report_type * @param $reportType
* @param Carbon $start * @param Carbon $start
* @param Carbon $end * @param Carbon $end
* @param Collection $accounts * @param Collection $accounts
* *
* @return \Illuminate\Http\JsonResponse * @return \Illuminate\Http\JsonResponse
*/ */
public function yearInOut(ReportQueryInterface $query, $report_type, Carbon $start, Carbon $end, Collection $accounts) public function yearInOut(ReportQueryInterface $query, $reportType, Carbon $start, Carbon $end, Collection $accounts)
{ {
// chart properties for cache: // chart properties for cache:
$cache = new CacheProperties; $cache = new CacheProperties;
@@ -105,14 +105,14 @@ class ReportController extends Controller
* Summarizes all income and expenses for a given year. Gives a total and an average. * Summarizes all income and expenses for a given year. Gives a total and an average.
* *
* @param ReportQueryInterface $query * @param ReportQueryInterface $query
* @param $report_type * @param $reportType
* @param Carbon $start * @param Carbon $start
* @param Carbon $end * @param Carbon $end
* @param Collection $accounts * @param Collection $accounts
* *
* @return \Illuminate\Http\JsonResponse * @return \Illuminate\Http\JsonResponse
*/ */
public function yearInOutSummarized(ReportQueryInterface $query, $report_type, Carbon $start, Carbon $end, Collection $accounts) public function yearInOutSummarized(ReportQueryInterface $query, $reportType, Carbon $start, Carbon $end, Collection $accounts)
{ {
// chart properties for cache: // chart properties for cache:

View File

@@ -73,14 +73,14 @@ class ReportController extends Controller
} }
/** /**
* @param $report_type * @param $reportType
* @param Carbon $start * @param Carbon $start
* @param Carbon $end * @param Carbon $end
* @param Collection $accounts * @param Collection $accounts
* *
* @return View * @return View
*/ */
public function defaultYear($report_type, Carbon $start, Carbon $end, Collection $accounts) public function defaultYear($reportType, Carbon $start, Carbon $end, Collection $accounts)
{ {
$incomeTopLength = 8; $incomeTopLength = 8;
$expenseTopLength = 8; $expenseTopLength = 8;
@@ -104,7 +104,7 @@ class ReportController extends Controller
return view( return view(
'reports.default.year', 'reports.default.year',
compact( compact(
'start', 'accountReport', 'incomes', 'report_type', 'accountIds', 'end', 'start', 'accountReport', 'incomes', 'reportType', 'accountIds', 'end',
'expenses', 'incomeTopLength', 'expenseTopLength' 'expenses', 'incomeTopLength', 'expenseTopLength'
) )
); );
@@ -112,14 +112,14 @@ class ReportController extends Controller
/** /**
* @param $report_type * @param $reportType
* @param Carbon $start * @param Carbon $start
* @param Carbon $end * @param Carbon $end
* @param Collection $accounts * @param Collection $accounts
* *
* @return View * @return View
*/ */
public function defaultMonth($report_type, Carbon $start, Carbon $end, Collection $accounts) public function defaultMonth($reportType, Carbon $start, Carbon $end, Collection $accounts)
{ {
$incomeTopLength = 8; $incomeTopLength = 8;
$expenseTopLength = 8; $expenseTopLength = 8;
@@ -145,27 +145,27 @@ class ReportController extends Controller
return view( return view(
'reports.default.month', 'reports.default.month',
compact( compact(
'start', 'end', 'report_type', 'start', 'end', 'reportType',
'accountReport', 'accountReport',
'incomes', 'incomeTopLength', 'incomes', 'incomeTopLength',
'expenses', 'expenseTopLength', 'expenses', 'expenseTopLength',
'budgets', 'balance', 'budgets', 'balance',
'categories', 'categories',
'bills', 'bills',
'accountIds', 'report_type' 'accountIds', 'reportType'
) )
); );
} }
/** /**
* @param $report_type * @param $reportType
* @param $start * @param $start
* @param $end * @param $end
* @param $accounts * @param $accounts
* *
* @return View * @return View
*/ */
public function defaultMultiYear($report_type, $start, $end, $accounts) public function defaultMultiYear($reportType, $start, $end, $accounts)
{ {
@@ -182,19 +182,19 @@ class ReportController extends Controller
$accountIds = join(',', $accountIds); $accountIds = join(',', $accountIds);
return view( return view(
'reports.default.multi-year', compact('budgets', 'accounts', 'categories', 'start', 'end', 'accountIds', 'report_type') 'reports.default.multi-year', compact('budgets', 'accounts', 'categories', 'start', 'end', 'accountIds', 'reportType')
); );
} }
/** /**
* @param $report_type * @param $reportType
* @param Carbon $start * @param Carbon $start
* @param Carbon $end * @param Carbon $end
* @param Collection $accounts * @param Collection $accounts
* *
* @return View * @return View
*/ */
public function report($report_type, Carbon $start, Carbon $end, Collection $accounts) public function report($reportType, Carbon $start, Carbon $end, Collection $accounts)
{ {
// throw an error if necessary. // throw an error if necessary.
if ($end < $start) { if ($end < $start) {
@@ -206,7 +206,7 @@ class ReportController extends Controller
$start = Session::get('first'); $start = Session::get('first');
} }
switch ($report_type) { switch ($reportType) {
default: default:
case 'default': case 'default':
@@ -223,14 +223,14 @@ class ReportController extends Controller
// more than one year date difference means year report. // more than one year date difference means year report.
if ($start->diffInMonths($end) > 12) { if ($start->diffInMonths($end) > 12) {
return $this->defaultMultiYear($report_type, $start, $end, $accounts); return $this->defaultMultiYear($reportType, $start, $end, $accounts);
} }
// more than two months date difference means year report. // more than two months date difference means year report.
if ($start->diffInMonths($end) > 1) { if ($start->diffInMonths($end) > 1) {
return $this->defaultYear($report_type, $start, $end, $accounts); return $this->defaultYear($reportType, $start, $end, $accounts);
} }
return $this->defaultMonth($report_type, $start, $end, $accounts); return $this->defaultMonth($reportType, $start, $end, $accounts);
} }

View File

@@ -389,7 +389,7 @@ Route::group(
// accounts: // accounts:
Route::get('/chart/account/frontpage', ['uses' => 'Chart\AccountController@frontpage']); Route::get('/chart/account/frontpage', ['uses' => 'Chart\AccountController@frontpage']);
Route::get('/chart/account/expense', ['uses' => 'Chart\AccountController@expenseAccounts']); Route::get('/chart/account/expense', ['uses' => 'Chart\AccountController@expenseAccounts']);
Route::get('/chart/account/report/{report_type}/{start_date}/{end_date}/{accountList}', ['uses' => 'Chart\AccountController@report']); Route::get('/chart/account/report/{reportType}/{start_date}/{end_date}/{accountList}', ['uses' => 'Chart\AccountController@report']);
Route::get('/chart/account/{account}', ['uses' => 'Chart\AccountController@single']); Route::get('/chart/account/{account}', ['uses' => 'Chart\AccountController@single']);
@@ -401,8 +401,8 @@ Route::group(
Route::get('/chart/budget/frontpage', ['uses' => 'Chart\BudgetController@frontpage']); Route::get('/chart/budget/frontpage', ['uses' => 'Chart\BudgetController@frontpage']);
// this chart is used in reports: // this chart is used in reports:
Route::get('/chart/budget/year/{report_type}/{start_date}/{end_date}/{accountList}', ['uses' => 'Chart\BudgetController@year']); Route::get('/chart/budget/year/{reportType}/{start_date}/{end_date}/{accountList}', ['uses' => 'Chart\BudgetController@year']);
Route::get('/chart/budget/multi-year/{report_type}/{start_date}/{end_date}/{accountList}/{budgetList}', ['uses' => 'Chart\BudgetController@multiYear']); Route::get('/chart/budget/multi-year/{reportType}/{start_date}/{end_date}/{accountList}/{budgetList}', ['uses' => 'Chart\BudgetController@multiYear']);
Route::get('/chart/budget/{budget}/{limitrepetition}', ['uses' => 'Chart\BudgetController@budgetLimit']); Route::get('/chart/budget/{budget}/{limitrepetition}', ['uses' => 'Chart\BudgetController@budgetLimit']);
Route::get('/chart/budget/{budget}', ['uses' => 'Chart\BudgetController@budget']); Route::get('/chart/budget/{budget}', ['uses' => 'Chart\BudgetController@budget']);
@@ -411,10 +411,10 @@ Route::group(
Route::get('/chart/category/frontpage', ['uses' => 'Chart\CategoryController@frontpage']); Route::get('/chart/category/frontpage', ['uses' => 'Chart\CategoryController@frontpage']);
// these three charts are for reports: // these three charts are for reports:
Route::get('/chart/category/earned-in-period/{report_type}/{start_date}/{end_date}/{accountList}', ['uses' => 'Chart\CategoryController@earnedInPeriod']); Route::get('/chart/category/earned-in-period/{reportType}/{start_date}/{end_date}/{accountList}', ['uses' => 'Chart\CategoryController@earnedInPeriod']);
Route::get('/chart/category/spent-in-period/{report_type}/{start_date}/{end_date}/{accountList}', ['uses' => 'Chart\CategoryController@spentInPeriod']); Route::get('/chart/category/spent-in-period/{reportType}/{start_date}/{end_date}/{accountList}', ['uses' => 'Chart\CategoryController@spentInPeriod']);
Route::get( Route::get(
'/chart/category/multi-year/{report_type}/{start_date}/{end_date}/{accountList}/{categoryList}', ['uses' => 'Chart\CategoryController@multiYear'] '/chart/category/multi-year/{reportType}/{start_date}/{end_date}/{accountList}/{categoryList}', ['uses' => 'Chart\CategoryController@multiYear']
); );
Route::get('/chart/category/{category}/period', ['uses' => 'Chart\CategoryController@currentPeriod']); Route::get('/chart/category/{category}/period', ['uses' => 'Chart\CategoryController@currentPeriod']);
@@ -425,8 +425,8 @@ Route::group(
Route::get('/chart/piggyBank/{piggyBank}', ['uses' => 'Chart\PiggyBankController@history']); Route::get('/chart/piggyBank/{piggyBank}', ['uses' => 'Chart\PiggyBankController@history']);
// reports: // reports:
Route::get('/chart/report/in-out/{report_type}/{start_date}/{end_date}/{accountList}', ['uses' => 'Chart\ReportController@yearInOut']); Route::get('/chart/report/in-out/{reportType}/{start_date}/{end_date}/{accountList}', ['uses' => 'Chart\ReportController@yearInOut']);
Route::get('/chart/report/in-out-sum/{report_type}/{start_date}/{end_date}/{accountList}', ['uses' => 'Chart\ReportController@yearInOutSummarized']); Route::get('/chart/report/in-out-sum/{reportType}/{start_date}/{end_date}/{accountList}', ['uses' => 'Chart\ReportController@yearInOutSummarized']);
/** /**
@@ -492,7 +492,7 @@ Route::group(
* Report Controller * Report Controller
*/ */
Route::get('/reports', ['uses' => 'ReportController@index', 'as' => 'reports.index']); Route::get('/reports', ['uses' => 'ReportController@index', 'as' => 'reports.index']);
Route::get('/reports/report/{report_type}/{start_date}/{end_date}/{accountList}', ['uses' => 'ReportController@report', 'as' => 'reports.report']); Route::get('/reports/report/{reportType}/{start_date}/{end_date}/{accountList}', ['uses' => 'ReportController@report', 'as' => 'reports.report']);
/** /**
* Search Controller * Search Controller

View File

@@ -1,7 +1,7 @@
{% extends "./layout/default.twig" %} {% extends "./layout/default.twig" %}
{% block breadcrumbs %} {% block breadcrumbs %}
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, start, end, report_type, accountIds) }} {{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, start, end, reportType, accountIds) }}
{% endblock %} {% endblock %}
{% block content %} {% block content %}
@@ -75,7 +75,7 @@
// to report another URL: // to report another URL:
var startDate = '{{ start.format('Ymd') }}'; var startDate = '{{ start.format('Ymd') }}';
var endDate = '{{ end.format('Ymd') }}'; var endDate = '{{ end.format('Ymd') }}';
var reportType = '{{ report_type }}'; var reportType = '{{ reportType }}';
var accountIds = '{{ accountIds }}'; var accountIds = '{{ accountIds }}';
var incomeTopLength = {{ incomeTopLength }}; var incomeTopLength = {{ incomeTopLength }};

View File

@@ -1,7 +1,7 @@
{% extends "./layout/default.twig" %} {% extends "./layout/default.twig" %}
{% block breadcrumbs %} {% block breadcrumbs %}
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, start, end, report_type, accountIds) }} {{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, start, end, reportType, accountIds) }}
{% endblock %} {% endblock %}
{% block content %} {% block content %}
@@ -125,7 +125,7 @@
// to report another URL: // to report another URL:
var startDate = '{{ start.format('Ymd') }}'; var startDate = '{{ start.format('Ymd') }}';
var endDate = '{{ end.format('Ymd') }}'; var endDate = '{{ end.format('Ymd') }}';
var reportType = '{{ report_type }}'; var reportType = '{{ reportType }}';
var accountIds = '{{ accountIds }}'; var accountIds = '{{ accountIds }}';
</script> </script>
<script type="text/javascript" src="js/reports/default/multi-year.js"></script> <script type="text/javascript" src="js/reports/default/multi-year.js"></script>

View File

@@ -1,7 +1,7 @@
{% extends "./layout/default.twig" %} {% extends "./layout/default.twig" %}
{% block breadcrumbs %} {% block breadcrumbs %}
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, start, end, report_type, accountIds) }} {{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, start, end, reportType, accountIds) }}
{% endblock %} {% endblock %}
{% block content %} {% block content %}
@@ -92,7 +92,7 @@
// to report another URL: // to report another URL:
var startDate = '{{ start.format('Ymd') }}'; var startDate = '{{ start.format('Ymd') }}';
var endDate = '{{ end.format('Ymd') }}'; var endDate = '{{ end.format('Ymd') }}';
var reportType = '{{ report_type }}'; var reportType = '{{ reportType }}';
var accountIds = '{{ accountIds }}'; var accountIds = '{{ accountIds }}';