Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Fixing routes
James Colebebfbf0b901e
diff --git a/app/Http/Controllers/AccountController.php b/app/Http/Controllers/AccountController.phpindex e129fc9128..1d26e17f43 100644--- a/app/Http/Controllers/AccountController.php+++ b/app/Http/Controllers/AccountController.php@@ -282,7 +282,7 @@ class AccountController extends Controller** @return View*/- public function showWithDate(Account $account, string $date)+ public function showByDate(Account $account, string $date){$carbon = new Carbon($date);$range = Preferences::get('viewRange', '1M')->data;@@ -298,7 +298,7 @@ class AccountController extends Controller$journals = $collector->getPaginatedJournals();$journals->setPath('accounts/show/' . $account->id . '/' . $date);- return view('accounts.show_with_date', compact('category', 'date', 'account', 'journals', 'subTitle', 'carbon', 'start', 'end'));+ return view('accounts.show-by-date', compact('category', 'date', 'account', 'journals', 'subTitle', 'carbon', 'start', 'end'));}/**diff --git a/app/Http/Controllers/Auth/TwoFactorController.php b/app/Http/Controllers/Auth/TwoFactorController.phpindex d310cc3bd7..ae1af3c066 100644--- a/app/Http/Controllers/Auth/TwoFactorController.php+++ b/app/Http/Controllers/Auth/TwoFactorController.php@@ -38,10 +38,16 @@ class TwoFactorController extends Controller$user = auth()->user();// to make sure the validator in the next step gets the secret, we push it in session- $secret = Preferences::get('twoFactorAuthSecret', '')->data;+ $secret = Preferences::get('twoFactorAuthSecret', null)->data;$title = strval(trans('firefly.two_factor_title'));- if (strlen($secret) === 0) {+ // make sure the user has two factor configured:+ $has2FA = Preferences::get('twoFactorAuthEnabled', null)->data;+ if (is_null($has2FA) || $has2FA === false) {+ return redirect(route('index'));+ }++ if (strlen(strval($secret)) === 0) {throw new FireflyException('Your two factor authentication secret is empty, which it cannot be at this point. Please check the log files.');}Session::flash('two-factor-secret', $secret);diff --git a/app/Http/Controllers/Chart/AccountController.php b/app/Http/Controllers/Chart/AccountController.phpindex c0e8071327..fb586715de 100644--- a/app/Http/Controllers/Chart/AccountController.php+++ b/app/Http/Controllers/Chart/AccountController.php@@ -112,7 +112,7 @@ class AccountController extends Controller** @return \Illuminate\Http\JsonResponse*/- public function expenseByBudget(JournalCollectorInterface $collector, Account $account, Carbon $start, Carbon $end)+ public function expenseBudget(JournalCollectorInterface $collector, Account $account, Carbon $start, Carbon $end){$cache = new CacheProperties;$cache->addProperty($account->id);@@ -153,7 +153,7 @@ class AccountController extends Controller** @return \Illuminate\Http\JsonResponse*/- public function expenseByCategory(JournalCollectorInterface $collector, Account $account, Carbon $start, Carbon $end)+ public function expenseCategory(JournalCollectorInterface $collector, Account $account, Carbon $start, Carbon $end){$cache = new CacheProperties;$cache->addProperty($account->id);@@ -199,7 +199,7 @@ class AccountController extends Controller$frontPage = Preferences::get('frontPageAccounts', $repository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET])->pluck('id')->toArray());$accounts = $repository->getAccountsById($frontPage->data);- return Response::json($this->accountBalanceChart($start, $end, $accounts));+ return Response::json($this->accountBalanceChart($accounts, $start, $end));}/**@@ -210,7 +210,7 @@ class AccountController extends Controller** @return \Illuminate\Http\JsonResponse*/- public function incomeByCategory(JournalCollectorInterface $collector, Account $account, Carbon $start, Carbon $end)+ public function incomeCategory(JournalCollectorInterface $collector, Account $account, Carbon $start, Carbon $end){$cache = new CacheProperties;$cache->addProperty($account->id);@@ -251,9 +251,9 @@ class AccountController extends Controller** @return \Illuminate\Http\JsonResponse*/- public function report(Carbon $start, Carbon $end, Collection $accounts)+ public function report(Collection $accounts, Carbon $start, Carbon $end){- return Response::json($this->accountBalanceChart($start, $end, $accounts));+ return Response::json($this->accountBalanceChart($accounts, $start, $end));}/**@@ -406,13 +406,13 @@ class AccountController extends Controller}/**+ * @param Collection $accounts* @param Carbon $start* @param Carbon $end- * @param Collection $accounts** @return array*/- private function accountBalanceChart(Carbon $start, Carbon $end, Collection $accounts): array+ private function accountBalanceChart(Collection $accounts, Carbon $start, Carbon $end): array{// chart properties for cache:$cache = new CacheProperties();diff --git a/app/Http/Controllers/ReportController.php b/app/Http/Controllers/ReportController.phpindex 71089f6b81..655c3b2a22 100644--- a/app/Http/Controllers/ReportController.php+++ b/app/Http/Controllers/ReportController.php@@ -61,14 +61,13 @@ class ReportController extends Controller}/**+ * @param Collection $accounts* @param Carbon $start* @param Carbon $end- * @param Collection $accounts** @return string- * @throws FireflyException*/- public function auditReport(Carbon $start, Carbon $end, Collection $accounts)+ public function auditReport(Collection $accounts, Carbon $start, Carbon $end){if ($end < $start) {return view('error')->with('message', trans('firefly.end_after_start_date'));@@ -97,15 +96,14 @@ class ReportController extends Controller}/**- * @param Carbon $start- * @param Carbon $end* @param Collection $accounts- ** @param Collection $categories+ * @param Carbon $start+ * @param Carbon $end** @return string*/- public function categoryReport(Carbon $start, Carbon $end, Collection $accounts, Collection $categories)+ public function categoryReport(Collection $accounts, Collection $categories, Carbon $start, Carbon $end){if ($end < $start) {return view('error')->with('message', trans('firefly.end_after_start_date'));@@ -134,14 +132,13 @@ class ReportController extends Controller}/**+ * @param Collection $accounts* @param Carbon $start* @param Carbon $end- * @param Collection $accounts** @return string- * @throws FireflyException*/- public function defaultReport(Carbon $start, Carbon $end, Collection $accounts)+ public function defaultReport(Collection $accounts, Carbon $start, Carbon $end){if ($end < $start) {return view('error')->with('message', trans('firefly.end_after_start_date'));@@ -246,13 +243,13 @@ class ReportController extends Controllerdefault:throw new FireflyException(sprintf('Firefly does not support the "%s"-report yet.', $reportType));case 'category':- $uri = route('reports.report.category', [$start, $end, $accounts, $categories]);+ $uri = route('reports.report.category', [$accounts, $categories, $start, $end]);break;case 'default':- $uri = route('reports.report.default', [$start, $end, $accounts]);+ $uri = route('reports.report.default', [$accounts, $start, $end]);break;case 'audit':- $uri = route('reports.report.audit', [$start, $end, $accounts]);+ $uri = route('reports.report.audit', [$accounts, $start, $end]);break;}diff --git a/app/Http/Middleware/AuthenticateTwoFactor.php b/app/Http/Middleware/AuthenticateTwoFactor.phpindex 7dbaa77505..4f9f1f5542 100644--- a/app/Http/Middleware/AuthenticateTwoFactor.php+++ b/app/Http/Middleware/AuthenticateTwoFactor.php@@ -57,7 +57,7 @@ class AuthenticateTwoFactor$has2faSecret = !is_null(Preferences::get('twoFactorAuthSecret'));$is2faAuthed = Session::get('twofactor-authenticated');if ($is2faEnabled && $has2faSecret && !$is2faAuthed) {- return redirect(route('two-factor'));+ return redirect(route('two-factor.index'));}return $next($request);diff --git a/public/js/ff/accounts/show_with_date.js b/public/js/ff/accounts/show-by-date.jssimilarity index 88%rename from public/js/ff/accounts/show_with_date.jsrename to public/js/ff/accounts/show-by-date.jsindex c34d4ce952..4e1768daf4 100644--- a/public/js/ff/accounts/show_with_date.js+++ b/public/js/ff/accounts/show-by-date.js@@ -6,9 +6,6 @@* of the MIT license. See the LICENSE file for details.*/-/* global $, lineChart, dateString, accountID, token, incomeByCategoryUri, expenseByCategoryUri, expenseByBudgetUri */--// Return a helper with preserved width of cellsvar fixHelper = function (e, tr) {"use strict";@@ -24,11 +21,11 @@ var fixHelper = function (e, tr) {$(function () {"use strict";- lineChart('chart/account/' + accountID + '/' + dateString, 'period-specific-account');+ lineChart(periodUri, 'period-specific-account');- pieChart(incomeByCategoryUri, 'account-cat-in');- pieChart(expenseByCategoryUri, 'account-cat-out');- pieChart(expenseByBudgetUri, 'account-budget-out');+ pieChart(incomeCategoryUri, 'account-cat-in');+ pieChart(expenseCategoryUri, 'account-cat-out');+ pieChart(expenseBudgetUri, 'account-budget-out');// sortable!diff --git a/public/js/ff/accounts/show.js b/public/js/ff/accounts/show.jsindex 4de17eddb5..5875c0da90 100644--- a/public/js/ff/accounts/show.js+++ b/public/js/ff/accounts/show.js@@ -15,10 +15,10 @@ var fixHelper = function (e, tr) {$(function () {"use strict";- lineChart('chart/account/' + accountID, 'overview-chart');- pieChart(incomeByCategoryUri, 'account-cat-in');- pieChart(expenseByCategoryUri, 'account-cat-out');- pieChart(expenseByBudgetUri, 'account-budget-out');+ lineChart(singleUri, 'overview-chart');+ pieChart(incomeCategoryUri, 'account-cat-in');+ pieChart(expenseCategoryUri, 'account-cat-out');+ pieChart(expenseBudgetUri, 'account-budget-out');// sortable!diff --git a/public/js/ff/bills/show.js b/public/js/ff/bills/show.jsindex d383023ead..ba12284cd3 100644--- a/public/js/ff/bills/show.js+++ b/public/js/ff/bills/show.js@@ -2,8 +2,6 @@$(function () {"use strict";- if (typeof(columnChart) === 'function' && typeof(billID) !== 'undefined') {- columnChart('chart/bill/' + billID, 'bill-overview');- }+ columnChart(billUri, 'bill-overview');});\ No newline at end of filediff --git a/public/js/ff/index.js b/public/js/ff/index.jsindex f797dcf142..b0cc90b70f 100644--- a/public/js/ff/index.js+++ b/public/js/ff/index.js@@ -32,14 +32,14 @@ function endTheTour() {function drawChart() {"use strict";- lineChart('chart/account/frontpage', 'accounts-chart');+ lineChart(accountFrontpageUri, 'accounts-chart');if (billCount > 0) {pieChart('chart/bill/frontpage', 'bills-chart');}stackedColumnChart('chart/budget/frontpage', 'budgets-chart');columnChart('chart/category/frontpage', 'categories-chart');- columnChart('chart/account/expense', 'expense-accounts-chart');- columnChart('chart/account/revenue', 'revenue-accounts-chart');+ columnChart(accountExpenseUri, 'expense-accounts-chart');+ columnChart(accountRevenueUri, 'revenue-accounts-chart');getBoxAmounts();diff --git a/public/js/ff/reports/default/all.js b/public/js/ff/reports/default/all.jsindex 0d3f056e2b..939b0462e0 100644--- a/public/js/ff/reports/default/all.js+++ b/public/js/ff/reports/default/all.js@@ -98,7 +98,7 @@ function displayAjaxPartial(data, holder) {function failAjaxPartial(uri, holder) {"use strict";- console.log('Failed to load' + uri);+ console.log('Failed to load: ' + uri);$('#' + holder).removeClass('loading').addClass('general-chart-error');}diff --git a/public/js/ff/reports/default/month.js b/public/js/ff/reports/default/month.jsindex 4e34d95032..a150da25cc 100644--- a/public/js/ff/reports/default/month.js+++ b/public/js/ff/reports/default/month.js@@ -15,5 +15,5 @@ function drawChart() {// month view:// draw account chart- lineChart('chart/account/report/' + reportType + '/' + startDate + '/' + endDate + '/' + accountIds, 'account-balances-chart');+ lineChart(accountChartUri, 'account-balances-chart');}\ No newline at end of filediff --git a/resources/views/accounts/edit.twig b/resources/views/accounts/edit.twigindex d849fa50d4..0b76b53819 100644--- a/resources/views/accounts/edit.twig+++ b/resources/views/accounts/edit.twig@@ -77,3 +77,7 @@</div>{{ Form.close|raw }}{% endblock %}++{% block scripts %}+ <script type="text/javascript" src="js/ff/accounts/create-edit.js"></script>+{% endblock %}\ No newline at end of filediff --git a/resources/views/accounts/show-by-date.twig b/resources/views/accounts/show-by-date.twigindex e872140108..fbe746b110 100644--- a/resources/views/accounts/show-by-date.twig+++ b/resources/views/accounts/show-by-date.twig@@ -94,9 +94,10 @@var dateString = "{{ date|escape }}";// uri's for charts:- var incomeByCategoryUri = '{{ route('chart.account.incomeByCategory', [account.id, start.format('Ymd'), end.format('Ymd')]) }}';- var expenseByCategoryUri = '{{ route('chart.account.expenseByCategory', [account.id, start.format('Ymd'), end.format('Ymd')]) }}';- var expenseByBudgetUri = '{{ route('chart.account.expenseByBudget', [account.id, start.format('Ymd'), end.format('Ymd')]) }}';+ var periodUri = '{{ route('chart.account.single', [account.id, date]) }}';+ var incomeCategoryUri = '{{ route('chart.account.income-category', [account.id, start.format('Ymd'), end.format('Ymd')]) }}';+ var expenseCategoryUri = '{{ route('chart.account.expense-category', [account.id, start.format('Ymd'), end.format('Ymd')]) }}';+ var expenseBudgetUri = '{{ route('chart.account.expense-budget', [account.id, start.format('Ymd'), end.format('Ymd')]) }}';</script><script type="text/javascript" src="js/lib/Chart.bundle.min.js"></script>@@ -104,6 +105,6 @@<script type="text/javascript" src="js/ff/charts.js"></script><script src="js/lib/jquery-ui.min.js" type="text/javascript"></script><script src="js/lib/jquery.color-2.1.2.min.js" type="text/javascript"></script>- <script src="js/ff/accounts/show_with_date.js" type="text/javascript"></script>+ <script src="js/ff/accounts/show-by-date.js" type="text/javascript"></script><script type="text/javascript" src="js/ff/transactions/list.js"></script>{% endblock %}diff --git a/resources/views/accounts/show.twig b/resources/views/accounts/show.twigindex 28f1b770b0..9826d1f358 100644--- a/resources/views/accounts/show.twig+++ b/resources/views/accounts/show.twig@@ -123,9 +123,10 @@<script type="text/javascript">var accountID = {{ account.id }};// uri's for charts:- var incomeByCategoryUri = '{{ route('chart.account.incomeByCategory', [account.id, start.format('Ymd'), end.format('Ymd')]) }}';- var expenseByCategoryUri = '{{ route('chart.account.expenseByCategory', [account.id, start.format('Ymd'), end.format('Ymd')]) }}';- var expenseByBudgetUri = '{{ route('chart.account.expenseByBudget', [account.id, start.format('Ymd'), end.format('Ymd')]) }}';+ var singleUri = '{{ route('chart.account.single', [account.id]) }}';+ var incomeCategoryUri = '{{ route('chart.account.income-category', [account.id, start.format('Ymd'), end.format('Ymd')]) }}';+ var expenseCategoryUri = '{{ route('chart.account.expense-category', [account.id, start.format('Ymd'), end.format('Ymd')]) }}';+ var expenseBudgetUri = '{{ route('chart.account.expense-budget', [account.id, start.format('Ymd'), end.format('Ymd')]) }}';</script>diff --git a/resources/views/auth/two-factor.twig b/resources/views/auth/two-factor.twigindex 65a29bed85..ea4275aae2 100644--- a/resources/views/auth/two-factor.twig+++ b/resources/views/auth/two-factor.twig@@ -18,7 +18,7 @@<p class="login-box-msg">{{ trans('firefly.two_factor_welcome', {user: user.email}) }}</p><p class="login-box-msg">{{ 'two_factor_enter_code'|_ }}</p>- <form action="{{ route('two-factor-post') }}" method="post">+ <form action="{{ route('two-factor.post') }}" method="post"><input type="hidden" name="_token" value="{{ csrf_token() }}"/><div class="form-group has-feedback">@@ -33,7 +33,7 @@<!-- /.col --></div></form>- <a href="{{ route('lost-two-factor') }}">{{ 'two_factor_forgot'|_ }}</a>+ <a href="{{ route('two-factor.lost') }}">{{ 'two_factor_forgot'|_ }}</a></div><!-- /.login-box-body -->{% endblock %}diff --git a/resources/views/bills/show.twig b/resources/views/bills/show.twigindex f2db32ebf2..9227d99d46 100644--- a/resources/views/bills/show.twig+++ b/resources/views/bills/show.twig@@ -116,7 +116,7 @@{% block scripts %}<script type="text/javascript">- var billID = {{ bill.id }};+ var billUri = '{{ route('chart.bill.single', [bill.id]) }}';</script><script type="text/javascript" src="js/lib/Chart.bundle.min.js"></script><script type="text/javascript" src="js/ff/charts.defaults.js"></script>diff --git a/resources/views/budgets/income.twig b/resources/views/budgets/income.twigindex aef412667c..f78cb2c255 100644--- a/resources/views/budgets/income.twig+++ b/resources/views/budgets/income.twig@@ -8,7 +8,7 @@</h4></div>- <form style="display: inline;" id="income" action="{{ route('budgets.postIncome') }}" method="POST">+ <form style="display: inline;" id="income" action="{{ route('budgets.income.post') }}" method="POST"><div class="modal-body"><input type="hidden" name="_token" value="{{ csrf_token() }}"/>diff --git a/resources/views/budgets/index.twig b/resources/views/budgets/index.twigindex 66e95d7f1f..827cd7d79d 100644--- a/resources/views/budgets/index.twig+++ b/resources/views/budgets/index.twig@@ -65,7 +65,7 @@</div><div class="box-body"><p>- <a href="{{ route('budgets.noBudget') }}">+ <a href="{{ route('budgets.no-budget') }}">{{ trans('firefly.transactions_no_budget', {start: periodStart, end: periodEnd }) }}</a></p>@@ -91,7 +91,7 @@<h3 class="box-title"><!-- link in header -->{% if budget.currentRep.id %}- <a href="{{ route('budgets.showWithRepetition', [budget.id, budget.currentRep.id]) }}" class="budget-link"+ <a href="{{ route('budgets.show.repetition', [budget.id, budget.currentRep.id]) }}" class="budget-link"data-id="{{ budget.id }}">{{ budget.name }}</a>{% else %}<a href="{{ route('budgets.show',budget.id) }}" class="budget-link" data-id="{{ budget.id }}">{{ budget.name }}</a>diff --git a/resources/views/categories/show_with_date.twig b/resources/views/categories/show-by-date.twigsimilarity index 100%rename from resources/views/categories/show_with_date.twigrename to resources/views/categories/show-by-date.twigdiff --git a/resources/views/index.twig b/resources/views/index.twigindex a1443b6e18..07450afebb 100644--- a/resources/views/index.twig+++ b/resources/views/index.twig@@ -143,6 +143,11 @@showTour = false;{% endif %}var billCount = {{ billCount }};++ // uri's of charts:+ var accountFrontpageUri = '{{ route('chart.account.frontpage') }}';+ var accountRevenueUri = '{{ route('chart.account.revenue') }}';+ var accountExpenseUri = '{{ route('chart.account.expense') }}';</script><script type="text/javascript" src="js/lib/Chart.bundle.min.js"></script>diff --git a/resources/views/layout/default.twig b/resources/views/layout/default.twigindex bf006c8696..54dd27bce6 100644--- a/resources/views/layout/default.twig+++ b/resources/views/layout/default.twig@@ -91,7 +91,7 @@<!-- sidebar: style can be found in sidebar.less --><section class="sidebar"><!-- search form -->- <form action="{{ route('search') }}" method="get" class="sidebar-form">+ <form action="{{ route('search.index') }}" method="get" class="sidebar-form"><div class="input-group"><input type="text" name="q" class="form-control" placeholder="{{ 'searchPlaceholder'|_ }}" value="{{ query }}"/><span class="input-group-btn">diff --git a/resources/views/list/categories.twig b/resources/views/list/categories.twigindex 5e97abe7e4..c16be94906 100644--- a/resources/views/list/categories.twig+++ b/resources/views/list/categories.twig@@ -9,7 +9,7 @@<tbody><tr><td> </td>- <td><a href="{{ route('categories.noCategory') }}"><em>{{ 'without_category'|_ }}</em></a></td>+ <td><a href="{{ route('categories.no-category') }}"><em>{{ 'without_category'|_ }}</em></a></td><td class="hidden-sm hidden-xs"> </td></tr>{% for category in categories %}diff --git a/resources/views/reports/default/month.twig b/resources/views/reports/default/month.twigindex 1b81077e10..f7edc09dac 100644--- a/resources/views/reports/default/month.twig+++ b/resources/views/reports/default/month.twig@@ -132,14 +132,17 @@var reportType = '{{ reportType }}';var accountIds = '{{ accountIds }}';- <!-- some URL's -->- var accountReportUri = '{{ route('reports.data.accountReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';- var incomeReportUri = '{{ route('reports.data.incomeReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';- var expenseReportUri = '{{ route('reports.data.expenseReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';- var incExpReportUri = '{{ route('reports.data.incExpReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';- var categoryReportUri = '{{ route('reports.data.categoryReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';- var budgetReportUri = '{{ route('reports.data.budgetReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';- var balanceReportUri = '{{ route('reports.data.balanceReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';+ // uri's for data+ var categoryReportUri = '{{ route('report-data.category.operations', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';+ var budgetReportUri = '{{ route('report-data.budget.general', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';+ var balanceReportUri = '{{ route('report-data.balance.general', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';+ var accountReportUri = '{{ route('report-data.account.general', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';+ var incomeReportUri = '{{ route('report-data.operations.income', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';+ var expenseReportUri = '{{ route('report-data.operations.expenses', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';+ var incExpReportUri = '{{ route('report-data.operations.operations', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';++ // uri's for charts:+ var accountChartUri = '{{ route('chart.account.report', [accountIds, start.format('Ymd'), end.format('Ymd')]) }}';</script><script type="text/javascript" src="js/ff/reports/default/all.js"></script>diff --git a/resources/views/reports/default/year.twig b/resources/views/reports/default/year.twigindex 5b757717b0..395ba25afd 100644--- a/resources/views/reports/default/year.twig+++ b/resources/views/reports/default/year.twig@@ -170,15 +170,14 @@var reportType = '{{ reportType }}';var accountIds = '{{ accountIds }}';- <!-- some URL's -->- var accountReportUri = '{{ route('reports.data.accountReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';- var incomeReportUri = '{{ route('reports.data.incomeReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';- var expenseReportUri = '{{ route('reports.data.expenseReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';- var incExpReportUri = '{{ route('reports.data.incExpReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';-- var budgetPeriodReportUri = '{{ route('reports.data.budgetPeriodReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';- var categoryExpenseUri = '{{ route('reports.data.categoryExpense', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';- var categoryIncomeUri = '{{ route('reports.data.categoryIncome', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';+ var accountReportUri = '{{ route('report-data.account.general', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';+ var incomeReportUri = '{{ route('report-data.operations.income', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';+ var expenseReportUri = '{{ route('report-data.operations.expenses', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';+ var incExpReportUri = '{{ route('report-data.operations.operations', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';++ var budgetPeriodReportUri = '{{ route('report-data.budget.period', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';+ var categoryExpenseUri = '{{ route('report-data.category.expenses', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';+ var categoryIncomeUri = '{{ route('report-data.category.income', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';</script>diff --git a/routes/web.php b/routes/web.phpindex ab84d24292..47c41c671c 100755--- a/routes/web.php+++ b/routes/web.php@@ -156,7 +156,7 @@ Route::group(Route::get('delete/{budget}', ['uses' => 'BudgetController@delete', 'as' => 'delete']);Route::get('show/{budget}', ['uses' => 'BudgetController@show', 'as' => 'show']);Route::get('show/{budget}/{limitrepetition}', ['uses' => 'BudgetController@showByRepetition', 'as' => 'show.repetition']);- Route::get('list/noBudget', ['uses' => 'BudgetController@noBudget', 'as' => 'no-budget']);+ Route::get('list/no-budget', ['uses' => 'BudgetController@noBudget', 'as' => 'no-budget']);Route::post('income', ['uses' => 'BudgetController@postUpdateIncome', 'as' => 'income.post']);Route::post('store', ['uses' => 'BudgetController@store', 'as' => 'store']);@@ -178,7 +178,7 @@ Route::group(Route::get('show/{category}', ['uses' => 'CategoryController@show', 'as' => 'show']);Route::get('show/{category}/{date}', ['uses' => 'CategoryController@showByDate', 'as' => 'show.date']);- Route::get('list/noCategory', ['uses' => 'CategoryController@noCategory', 'as' => 'no-category']);+ Route::get('list/no-category', ['uses' => 'CategoryController@noCategory', 'as' => 'no-category']);Route::post('store', ['uses' => 'CategoryController@store', 'as' => 'store']);Route::post('update/{category}', ['uses' => 'CategoryController@update', 'as' => 'update']);@@ -227,7 +227,7 @@ Route::group(Route::get('frontpage', ['uses' => 'AccountController@frontpage', 'as' => 'frontpage']);Route::get('expense', ['uses' => 'AccountController@expenseAccounts', 'as' => 'expense']);Route::get('revenue', ['uses' => 'AccountController@revenueAccounts', 'as' => 'revenue']);- Route::get('report/default/{accountList}/{start_date}/{end_date}', ['uses' => 'AccountController@report', 'as' => 'report']);+ Route::get('report/{accountList}/{start_date}/{end_date}', ['uses' => 'AccountController@report', 'as' => 'report']);Route::get('single/{account}', ['uses' => 'AccountController@single', 'as' => 'single']);Route::get('period/{account}/{date}', ['uses' => 'AccountController@period', 'as' => 'period']);@@ -242,9 +242,9 @@ Route::group(* Chart\Bill Controller*/Route::group(- ['middleware' => 'user-full-auth', 'namespace' => 'Chart', 'prefix' => 'chart/bill'], function () {- Route::get('frontpage', ['uses' => 'BillController@frontpage']);- Route::get('single/{bill}', ['uses' => 'BillController@single']);+ ['middleware' => 'user-full-auth', 'namespace' => 'Chart', 'prefix' => 'chart/bill','as' => 'chart.bill.'], function () {+ Route::get('frontpage', ['uses' => 'BillController@frontpage' ,'as' => 'frontpage']);+ Route::get('single/{bill}', ['uses' => 'BillController@single','as' => 'single']);});@@ -254,6 +254,7 @@ Route::group(*/Route::group(['middleware' => 'user-full-auth', 'namespace' => 'Chart', 'prefix' => 'chart/budget'], function () {+Route::get('frontpage', ['uses' => 'BudgetController@frontpage']);Route::get('period/0/{accountList}/{start_date}/{end_date}', ['uses' => 'BudgetController@periodNoBudget']);Route::get('period/{budget}/{accountList}/{start_date}/{end_date}', ['uses' => 'BudgetController@period']);@@ -399,7 +400,7 @@ Route::group(/**- * Name Controller+ * Preferences Controller*/Route::group(['middleware' => 'user-full-auth', 'prefix' => 'preferences', 'as' => 'preferences.'], function () {@@ -427,7 +428,7 @@ Route::group();/**- * Name Controller+ * Report Controller*/Route::group(['middleware' => 'user-full-auth', 'prefix' => 'reports', 'as' => 'reports.'], function () {@@ -436,9 +437,9 @@ Route::group(Route::get('options/{reportType}', ['uses' => 'ReportController@options', 'as' => 'options']);- Route::get('default/{accountList}/{start_date}/{end_date}', ['uses' => 'ReportController@default', 'as' => 'report.default']);- Route::get('audit/{accountList}/{start_date}/{end_date}', ['uses' => 'ReportController@audit', 'as' => 'report.audit']);- Route::get('category/{accountList}/{categoryList}/{start_date}/{end_date}', ['uses' => 'ReportController@category', 'as' => 'report.category']);+ Route::get('default/{accountList}/{start_date}/{end_date}', ['uses' => 'ReportController@defaultReport', 'as' => 'report.default']);+ Route::get('audit/{accountList}/{start_date}/{end_date}', ['uses' => 'ReportController@auditReport', 'as' => 'report.audit']);+ Route::get('category/{accountList}/{categoryList}/{start_date}/{end_date}', ['uses' => 'ReportController@categoryReport', 'as' => 'report.category']);Route::post('', ['uses' => 'ReportController@postIndex', 'as' => 'index.post']);}@@ -448,7 +449,7 @@ Route::group(* Report Data AccountController*/Route::group(- ['middleware' => 'user-full-auth', 'namespace' => 'Report', 'prefix' => 'report-data/account', 'as' => 'report-data.account'], function () {+ ['middleware' => 'user-full-auth', 'namespace' => 'Report', 'prefix' => 'report-data/account', 'as' => 'report-data.account.'], function () {Route::get('general/{accountList}/{start_date}/{end_date}', ['uses' => 'AccountController@general', 'as' => 'general']);});@@ -457,7 +458,7 @@ Route::group(* Report Data Income/Expenses Controller (called financial operations)*/Route::group(- ['middleware' => 'user-full-auth', 'namespace' => 'Report', 'prefix' => 'report-data/operations', 'as' => 'report-data.operations'], function () {+ ['middleware' => 'user-full-auth', 'namespace' => 'Report', 'prefix' => 'report-data/operations', 'as' => 'report-data.operations.'], function () {Route::get('operations/{accountList}/{start_date}/{end_date}', ['uses' => 'OperationsController@operations', 'as' => 'operations']);Route::get('income/{accountList}/{start_date}/{end_date}', ['uses' => 'OperationsController@income', 'as' => 'income']);Route::get('expenses/{accountList}/{start_date}/{end_date}', ['uses' => 'OperationsController@expenses', 'as' => 'expenses']);@@ -472,7 +473,7 @@ Route::group(['middleware' => 'user-full-auth', 'namespace' => 'Report', 'prefix' => 'report-data/category', 'as' => 'report-data.category.'], function () {Route::get('operations/{accountList}/{start_date}/{end_date}', ['uses' => 'CategoryController@operations', 'as' => 'operations']);Route::get('income/{accountList}/{start_date}/{end_date}', ['uses' => 'CategoryController@income', 'as' => 'income']);- Route::get('expenses/{accountList}/{start_date}/{end_date}', ['uses' => 'CategoryController@expenses', 'as' => 'expense']);+ Route::get('expenses/{accountList}/{start_date}/{end_date}', ['uses' => 'CategoryController@expenses', 'as' => 'expenses']);});@@ -627,7 +628,7 @@ Route::group(Route::group(['middleware' => 'user-full-auth', 'namespace' => 'Transaction', 'prefix' => 'transactions/convert', 'as' => 'transactions.convert.'], function () {Route::get('{transaction_type}/{tj}', ['uses' => 'ConvertController@index', 'as' => 'index']);- Route::post('{transaction_type}/{tj}', ['uses' => 'ConvertController@indexPost', 'as' => 'index.post']);+ Route::post('{transaction_type}/{tj}', ['uses' => 'ConvertController@postIndex', 'as' => 'index.post']);});