Skip to content

Firefly III: a personal finances manager

Final set of route changes.

James Colec799fc655d85
diff --git a/app/Http/Controllers/Popup/ReportController.php b/app/Http/Controllers/Popup/ReportController.php
index c9fd9afe8c..e10a016495 100644
--- a/app/Http/Controllers/Popup/ReportController.php
+++ b/app/Http/Controllers/Popup/ReportController.php
@@ -46,7 +46,7 @@ class ReportController extends Controller
* @return \Illuminate\Http\JsonResponse
* @throws FireflyException
*/
- public function info(Request $request)
+ public function general(Request $request)
{
$attributes = $request->get('attributes') ?? [];
$attributes = $this->parseAttributes($attributes);
diff --git a/public/js/ff/reports/default/all.js b/public/js/ff/reports/default/all.js
index f5c968f05f..b19187497b 100644
--- a/public/js/ff/reports/default/all.js
+++ b/public/js/ff/reports/default/all.js
@@ -1,4 +1,4 @@
-/* globals startDate, showOnlyTop, showFullList, endDate, reportType, expenseReportUri, accountIds, incExpReportUri,accountReportUri, incomeReportUri */
+/* globals startDate, showOnlyTop, showFullList, endDate, expenseReportUri, accountIds, incExpReportUri,accountReportUri, incomeReportUri */
/*
* all.js
* Copyright (C) 2016 [email protected]
@@ -39,10 +39,9 @@ function clickInfoButton(e) {
// add some more elements:
attributes.startDate = startDate;
attributes.endDate = endDate;
- attributes.reportType = reportType;
attributes.accounts = accountIds;
- $.getJSON('popup/report', {attributes: attributes}).done(respondInfoButton).fail(errorInfoButton);
+ $.getJSON('popup/general', {attributes: attributes}).done(respondInfoButton).fail(errorInfoButton);
}
function errorInfoButton(data) {
diff --git a/public/js/ff/reports/default/multi-year.js b/public/js/ff/reports/default/multi-year.js
index 3988ee298b..b1f755a8f1 100644
--- a/public/js/ff/reports/default/multi-year.js
+++ b/public/js/ff/reports/default/multi-year.js
@@ -1,19 +1,17 @@
-/* globals budgetMultiUri, accountIds */
-
-
$(function () {
"use strict";
drawChart();
loadAjaxPartial('budgetPeriodReport', budgetPeriodReportUri);
- loadAjaxPartial('categoryPeriodReport', categoryPeriodReportUri);
+ loadAjaxPartial('categoryExpense', categoryExpenseUri);
+ loadAjaxPartial('categoryIncome', categoryIncomeUri);
});
function drawChart() {
"use strict";
// income and expense over multi year:
- lineChart('chart/report/net-worth/' + startDate + '/' + endDate + '/' + accountIds, 'net-worth');
- columnChart('chart/report/in-out/' + startDate + '/' + endDate + '/' + accountIds, 'income-expenses-chart');
- columnChart('chart/report/in-out-sum/' + startDate + '/' + endDate + '/' + accountIds, 'income-expenses-sum-chart');
+ lineChart(netWorthUri, 'net-worth');
+ columnChart(opChartUri, 'income-expenses-chart');
+ columnChart(sumChartUri, 'income-expenses-sum-chart');
}
diff --git a/resources/views/budgets/index.twig b/resources/views/budgets/index.twig
index 827cd7d79d..691a92638a 100644
--- a/resources/views/budgets/index.twig
+++ b/resources/views/budgets/index.twig
@@ -156,7 +156,7 @@
{% for other in budget.otherRepetitions %}
{% if other.id != budget.currentRep.id %}
<li>Budgeted
- <a href="{{ route('budgets.showWithRepetition', [budget.id, other.id]) }}">{{ other.amount|formatAmountPlain }}</a>
+ <a href="{{ route('budgets.show.repetition', [budget.id, other.id]) }}">{{ other.amount|formatAmountPlain }}</a>
between
{{ other.startdate.formatLocalized(monthAndDayFormat) }}
and {{ other.enddate.formatLocalized(monthAndDayFormat) }}.
diff --git a/resources/views/list/piggy-banks.twig b/resources/views/list/piggy-banks.twig
index 3a049b0e1f..269c675dfc 100644
--- a/resources/views/list/piggy-banks.twig
+++ b/resources/views/list/piggy-banks.twig
@@ -26,7 +26,7 @@
</td>
<td class="hidden-sm hidden-xs" style="text-align:right;width:40px;">
{% if piggyBank.savedSoFar > 0 %}
- <a href="{{ route('piggy-banks.removeMoney', piggyBank.id) }}" class="btn btn-default btn-xs removeMoney" data-id="{{ piggyBank.id }}">
+ <a href="{{ route('piggy-banks.remove-money', piggyBank.id) }}" class="btn btn-default btn-xs removeMoney" data-id="{{ piggyBank.id }}">
<i data-id="{{ piggyBank.id }}" class="fa fa-minus"></i></a>
{% endif %}
</td>
@@ -51,7 +51,7 @@
<td class="hidden-sm hidden-xs" style="width:40px;">
{% if piggyBank.leftToSave > 0 %}
- <a href="{{ route('piggy-banks.addMoney', piggyBank.id) }}" class="btn btn-default btn-xs addMoney" data-id="{{ piggyBank.id }}">
+ <a href="{{ route('piggy-banks.add-money', piggyBank.id) }}" class="btn btn-default btn-xs addMoney" data-id="{{ piggyBank.id }}">
<i data-id="{{ piggyBank.id }}" class="fa fa-plus"></i></a>
{% endif %}
</td>
diff --git a/resources/views/profile/change-password.twig b/resources/views/profile/change-password.twig
index d313e31e36..248c51b604 100644
--- a/resources/views/profile/change-password.twig
+++ b/resources/views/profile/change-password.twig
@@ -5,7 +5,7 @@
{% endblock %}
{% block content %}
- <form method="POST" action="{{ route('profile.change-password.store') }}" accept-charset="UTF-8" class="form-horizontal" id="change-password">
+ <form method="POST" action="{{ route('profile.change-password.post') }}" accept-charset="UTF-8" class="form-horizontal" id="change-password">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
<div class="row">
diff --git a/resources/views/reports/default/month.twig b/resources/views/reports/default/month.twig
index f7edc09dac..352f5a2d1c 100644
--- a/resources/views/reports/default/month.twig
+++ b/resources/views/reports/default/month.twig
@@ -133,13 +133,13 @@
var accountIds = '{{ 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]) }}';
+ var accountReportUri = '{{ route('report-data.account.general', [accountIds, start.format('Ymd'), end.format('Ymd')]) }}';
+ var categoryReportUri = '{{ route('report-data.category.operations', [accountIds, start.format('Ymd'), end.format('Ymd')]) }}';
+ var budgetReportUri = '{{ route('report-data.budget.general', [accountIds, start.format('Ymd'), end.format('Ymd')]) }}';
+ var balanceReportUri = '{{ route('report-data.balance.general', [accountIds, start.format('Ymd'), end.format('Ymd')]) }}';
+ var incomeReportUri = '{{ route('report-data.operations.income', [accountIds, start.format('Ymd'), end.format('Ymd')]) }}';
+ var expenseReportUri = '{{ route('report-data.operations.expenses', [accountIds, start.format('Ymd'), end.format('Ymd')]) }}';
+ var incExpReportUri = '{{ route('report-data.operations.operations', [accountIds, start.format('Ymd'), end.format('Ymd')]) }}';
// uri's for charts:
var accountChartUri = '{{ route('chart.account.report', [accountIds, start.format('Ymd'), end.format('Ymd')]) }}';
diff --git a/resources/views/reports/default/multi-year.twig b/resources/views/reports/default/multi-year.twig
index c92c8f3e91..527eb84740 100644
--- a/resources/views/reports/default/multi-year.twig
+++ b/resources/views/reports/default/multi-year.twig
@@ -114,14 +114,27 @@
</div>
</div>
- {# same thing but for categories #}
+ {# same thing but for categories (expenses) #}
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="box">
<div class="box-header with-border">
- <h3 class="box-title">{{ 'categories'|_ }}</h3>
+ <h3 class="box-title">{{ 'categories'|_ }} ({{ 'expenses'|_ }})</h3>
</div>
- <div class="box-body no-padding table-responsive loading" id="categoryPeriodReport">
+ <div class="box-body no-padding table-responsive loading" id="categoryExpense">
+ </div>
+ </div>
+ </div>
+ </div>
+
+ {# same thing but for categories (income) #}
+ <div class="row">
+ <div class="col-lg-12 col-md-12 col-sm-12">
+ <div class="box">
+ <div class="box-header with-border">
+ <h3 class="box-title">{{ 'categories'|_ }} ({{ 'income'|_ }})</h3>
+ </div>
+ <div class="box-body no-padding table-responsive loading" id="categoryIncome">
</div>
</div>
</div>
@@ -159,17 +172,22 @@
// to report another URL:
var startDate = '{{ start.format('Ymd') }}';
var endDate = '{{ end.format('Ymd') }}';
- 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]) }}';
+ // report uri's
+ var opChartUri ='{{ route('chart.report.operations', [accountIds, start.format('Ymd'), end.format('Ymd')]) }}';
+ var sumChartUri='{{ route('chart.report.sum', [accountIds, start.format('Ymd'), end.format('Ymd')]) }}';
+ var netWorthUri ='{{ route('chart.report.net-worth', [accountIds, start.format('Ymd'), end.format('Ymd')]) }}';
+
+ // data uri's
+ var accountReportUri = '{{ route('report-data.account.general', [accountIds, start.format('Ymd'), end.format('Ymd')]) }}';
+ var incomeReportUri = '{{ route('report-data.operations.income', [accountIds, start.format('Ymd'), end.format('Ymd')]) }}';
+ var expenseReportUri = '{{ route('report-data.operations.expenses', [accountIds, start.format('Ymd'), end.format('Ymd')]) }}';
+ var incExpReportUri = '{{ route('report-data.operations.operations', [accountIds, start.format('Ymd'), end.format('Ymd')]) }}';
- var budgetPeriodReportUri = '{{ route('reports.data.budgetPeriodReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';
- var categoryPeriodReportUri = '{{ route('reports.data.categoryPeriodReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';
+ var budgetPeriodReportUri = '{{ route('report-data.budget.period', [accountIds, start.format('Ymd'), end.format('Ymd')]) }}';
+ var categoryExpenseUri = '{{ route('report-data.category.expenses', [accountIds, start.format('Ymd'), end.format('Ymd')]) }}';
+ var categoryIncomeUri = '{{ route('report-data.category.income', [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.twig
index e6438a7531..aad882010d 100644
--- a/resources/views/reports/default/year.twig
+++ b/resources/views/reports/default/year.twig
@@ -167,7 +167,6 @@
// to report another URL:
var startDate = '{{ start.format('Ymd') }}';
var endDate = '{{ end.format('Ymd') }}';
- var reportType = '{{ reportType }}';
var accountIds = '{{ accountIds }}';
// report uri's
diff --git a/resources/views/reports/index.twig b/resources/views/reports/index.twig
index eec3c8c134..c889d0eee2 100644
--- a/resources/views/reports/index.twig
+++ b/resources/views/reports/index.twig
@@ -114,17 +114,36 @@
</div>
<div class="box-body">
+ <h4>{{ ('quick_link_default_report')|_ }}</h4>
+ <ul>
+ <li><a href="{{ route('reports.report.default',[accountList, 'currentMonthStart','currentMonthEnd']) }}">{{ 'report_this_month_quick'|_ }}</a></li>
+ <li><a href="{{ route('reports.report.default',[accountList, 'currentYearStart','currentYearEnd']) }}">{{ 'report_this_year_quick'|_ }}</a></li>
+ {% if customFiscalYear == 1 %}
+ <li><a href="{{ route('reports.report.default',[accountList, 'currentFiscalYearStart','currentFiscalYearEnd']) }}">{{ 'report_this_fiscal_year_quick'|_ }}</a></li>
+ {% endif %}
+ <li><a href="{{ route('reports.report.default',[accountList, start.format('Ymd'),'currentMonthEnd']) }}">{{ 'report_all_time_quick'|_ }}</a></li>
+ </ul>
+
+ <h4>{{ ('quick_link_audit_report')|_ }}</h4>
+ <ul>
+ <li><a href="{{ route('reports.report.audit',[accountList, 'currentMonthStart','currentMonthEnd']) }}">{{ 'report_this_month_quick'|_ }}</a></li>
+ <li><a href="{{ route('reports.report.audit',[accountList, 'currentYearStart','currentYearEnd']) }}">{{ 'report_this_year_quick'|_ }}</a></li>
+ {% if customFiscalYear == 1 %}
+ <li><a href="{{ route('reports.report.audit',[accountList, 'currentFiscalYearStart','currentFiscalYearEnd']) }}">{{ 'report_this_fiscal_year_quick'|_ }}</a></li>
+ {% endif %}
+ <li><a href="{{ route('reports.report.audit',[accountList, start.format('Ymd'),'currentMonthEnd']) }}">{{ 'report_all_time_quick'|_ }}</a></li>
+ </ul>
+ {#<h4>{{ ('quick_link_category_report')|_ }}</h4>#}
+
+
+ {#
+
{% for type in ['default','audit'] %}
- <h4>{{ ('quick_link_'~type~'_report')|_ }}</h4>
+
<ul>
<li>
- <a href="{{ route('reports.report.'~type,
- [
- 'currentMonthStart',
- 'currentMonthEnd',
- accountList
- ]) }}">{{ 'report_this_month_quick'|_ }}</a>
+
</li>
<li>
<a href="{{ route('reports.report.'~type,
@@ -154,6 +173,8 @@
</li>
</ul>
{% endfor %}
+ #}
+
<p>
<em>{{ 'reports_can_bookmark'|_ }}</em>
</p>
diff --git a/resources/views/reports/partials/budgets.twig b/resources/views/reports/partials/budgets.twig
index 8caff22d66..8a06c858b2 100644
--- a/resources/views/reports/partials/budgets.twig
+++ b/resources/views/reports/partials/budgets.twig
@@ -26,7 +26,7 @@
{% if budgetLine.getRepetition.id %}
<td class="hidden-xs" data-value="{{ budgetLine.getRepetition.startdate.format('Y-m-d') }}">
- <a href="{{ route('budgets.showWithRepetition', [budgetLine.getBudget.id, budgetLine.getRepetition.id]) }}">
+ <a href="{{ route('budgets.show.repetition', [budgetLine.getBudget.id, budgetLine.getRepetition.id]) }}">
{{ budgetLine.getRepetition.startdate.formatLocalized(monthAndDayFormat) }}
&mdash;
{{ budgetLine.getRepetition.enddate.formatLocalized(monthAndDayFormat) }}
diff --git a/resources/views/reports/partials/categories.twig b/resources/views/reports/partials/categories.twig
index 281fd6ca5f..d5bfcb4df8 100644
--- a/resources/views/reports/partials/categories.twig
+++ b/resources/views/reports/partials/categories.twig
@@ -6,26 +6,28 @@
</tr>
</thead>
<tbody>
- {% for cat in categories.getCategories %}
+ {% set sum = 0 %}
+ {% for id, category in report %}
+ {% set sum = sum + category.spent %}
{% if loop.index > listLength %}
<tr class="overListLength">
{% else %}
<tr>
{% endif %}
<td>
- <a href="{{ route('categories.show',cat.id) }}">{{ cat.name }}</a>
+ <a href="{{ route('categories.show',id) }}">{{ category.name }}</a>
</td>
- <td>{{ cat.spent|formatAmount }}</td>
+ <td>{{ category.spent|formatAmount }}</td>
<td style="width:20px;">
<i class="fa fa-fw fa-info-circle text-muted firefly-info-button"
- data-location="category-entry" data-category-id="{{ cat.id }}"
+ data-location="category-entry" data-category-id="{{ id }}"
></i>
</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
- {% if categories.getCategories.count > listLength %}
+ {% if report|length > listLength %}
<tr>
<td colspan="2" class="active">
<a href="#" class="listLengthTrigger">{{ trans('firefly.show_full_list',{number:incomeTopLength}) }}</a>
@@ -35,7 +37,7 @@
<tr>
<td><em>{{ 'sum'|_ }}</em></td>
- <td>{{ categories.getTotal|formatAmount }}</td>
+ <td>{{ sum|formatAmount }}</td>
</tr>
</tfoot>
</table>
diff --git a/resources/views/rules/index.twig b/resources/views/rules/index.twig
index f126463521..6500bc827d 100644
--- a/resources/views/rules/index.twig
+++ b/resources/views/rules/index.twig
@@ -38,18 +38,18 @@
<button class="btn btn-box-tool dropdown-toggle" data-toggle="dropdown"><i
class="fa fa-ellipsis-v"></i></button>
<ul class="dropdown-menu" role="menu">
- <li><a href="{{ route('rules.rule-group.edit',ruleGroup.id) }}"><i
+ <li><a href="{{ route('rule-groups.edit',ruleGroup.id) }}"><i
class="fa fa-fw fa-pencil"></i> {{ 'edit'|_ }}</a></li>
- <li><a href="{{ route('rules.rule-group.delete',ruleGroup.id) }}"><i
+ <li><a href="{{ route('rule-groups.delete',ruleGroup.id) }}"><i
class="fa fa-fw fa-trash"></i> {{ 'delete'|_ }}</a></li>
- <li><a href="{{ route('rules.rule-group.select_transactions',ruleGroup.id) }}"><i
+ <li><a href="{{ route('rule-groups.select-transactions',ruleGroup.id) }}"><i
class="fa fa-fw fa-anchor"></i> {{ 'execute_on_existing_transactions_short'|_ }}</a></li>
{% if ruleGroup.order > 1 %}
- <li><a href="{{ route('rules.rule-group.up',ruleGroup.id) }}"><i
+ <li><a href="{{ route('rule-groups.up',ruleGroup.id) }}"><i
class="fa fa-fw fa-arrow-up"></i> {{ 'move_rule_group_up'|_ }}</a></li>
{% endif %}
{% if ruleGroup.order < ruleGroups|length %}
- <li><a href="{{ route('rules.rule-group.down',ruleGroup.id) }}"><i
+ <li><a href="{{ route('rule-groups.down',ruleGroup.id) }}"><i
class="fa fa-fw fa-arrow-down"></i> {{ 'move_rule_group_down'|_ }}
</a></li>
{% endif %}
@@ -79,7 +79,7 @@
<div class="btn-group btn-group-xs">
{% if rule.order > 1 %}
<a title="{{ 'rule_priority_up'|_ }}"
- href="{{ route('rules.rule.up', rule.id) }}"
+ href="{{ route('rules.up', rule.id) }}"
class="btn btn-default"><span
class="fa fa-fw fa-arrow-up"></span></a>
{% else %}
@@ -88,7 +88,7 @@
{% endif %}
{% if rule.order < ruleGroup.rules.count %}
<a title="{{ 'rule_priority_down'|_ }}"
- href="{{ route('rules.rule.down', rule.id) }}"
+ href="{{ route('rules.down', rule.id) }}"
class="btn btn-default"><span
class="fa fa-fw fa-arrow-down"></span>
</a>
@@ -96,17 +96,17 @@
<a href="#" class="btn btn-default"><span
class="fa fa-fw"></span></a>
{% endif %}
- <a title="{{ 'edit'|_ }}" href="{{ route('rules.rule.edit', rule.id) }}"
+ <a title="{{ 'edit'|_ }}" href="{{ route('rules.edit', rule.id) }}"
class="btn btn-default"><span
class="fa fa-fw fa-pencil"></span></a>
<a title="{{ 'delete'|_ }}"
- href="{{ route('rules.rule.delete', rule.id) }}"
+ href="{{ route('rules.delete', rule.id) }}"
class="btn btn-danger"><span
class="fa fa-fw fa-trash"></span></a>
</div>
<br/>
<div class="btn-group btn-group-xs">
- <a href="{{ route('rules.rule-group.select_transactions',ruleGroup.id) }}" class="btn btn-default"
+ <a href="{{ route('rule-groups.select-transactions',ruleGroup.id) }}" class="btn btn-default"
title=" {{ 'execute_on_existing_transactions_short'|_ }}">
<i class="fa fa-fw fa-check-circle"></i></a>
</div>
@@ -179,7 +179,7 @@
{% endif %}
<p>
<br/>
- <a href="{{ route('rules.rule.create', ruleGroup.id) }}"
+ <a href="{{ route('rules.create', ruleGroup.id) }}"
class="btn btn-success">{{ 'new_rule'|_ }}</a>
</p>
</div>
@@ -190,7 +190,7 @@
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
- <a href="{{ route('rules.rule-group.create') }}" class="btn btn-success">{{ 'new_rule_group'|_ }}</a>
+ <a href="{{ route('rule-groups.create') }}" class="btn btn-success">{{ 'new_rule_group'|_ }}</a>
</div>
</div>
diff --git a/resources/views/rules/rule/create.twig b/resources/views/rules/rule/create.twig
index 15b80d88af..481473712c 100644
--- a/resources/views/rules/rule/create.twig
+++ b/resources/views/rules/rule/create.twig
@@ -6,7 +6,7 @@
{% block content %}
- <form method="POST" action="{{ route('rules.rule.store', ruleGroup.id) }}" accept-charset="UTF-8" class="form-horizontal" id="store">
+ <form method="POST" action="{{ route('rules.store', ruleGroup.id) }}" accept-charset="UTF-8" class="form-horizontal" id="store">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
<input type="hidden" name="rule_group_id" value="{{ ruleGroup.id }}"/>
<input type="hidden" name="active" value="1"/>
diff --git a/resources/views/rules/rule/delete.twig b/resources/views/rules/rule/delete.twig
index 0d01f303b8..befd03a63b 100644
--- a/resources/views/rules/rule/delete.twig
+++ b/resources/views/rules/rule/delete.twig
@@ -6,7 +6,7 @@
{% block content %}
- <form method="POST" action="{{ route('rules.rule.destroy',rule.id) }}" accept-charset="UTF-8" class="form-horizontal" id="destroy">
+ <form method="POST" action="{{ route('rules.destroy',rule.id) }}" accept-charset="UTF-8" class="form-horizontal" id="destroy">
<input name="_token" type="hidden" value="{{ csrf_token() }}">
<div class="row">
<div class="col-lg-6 col-lg-offset-3 col-md-12 col-sm-12">