Final set of route changes.

This commit is contained in:
James Cole 2016-12-06 09:07:50 +01:00
parent 628c7cd055
commit c799fc655d
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
15 changed files with 99 additions and 62 deletions

View File

@ -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);

View File

@ -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 thegrumpydictator@gmail.com
@ -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) {

View File

@ -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');
}

View File

@ -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) }}.

View File

@ -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>

View File

@ -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">

View File

@ -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')]) }}';

View File

@ -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')]) }}';
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]) }}';
// 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('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>

View File

@ -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

View File

@ -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>

View File

@ -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) }}

View File

@ -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>

View File

@ -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>

View File

@ -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"/>

View File

@ -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">