Revamped tag report as well.

This commit is contained in:
James Cole
2019-09-03 15:37:59 +02:00
parent 4872d3e4bc
commit 5a8146aa34
22 changed files with 1917 additions and 992 deletions

View File

@@ -1,93 +1,114 @@
{% extends "./layout/default" %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, accountIds, tagTags, start, end) }}
{#{{ Breadcrumbs.render(Route.getCurrentRoute.getName, accountIds, tagTags, start, end) }}#}
{% endblock %}
{% block content %}
<div class="row">
<div class="col-lg-6 col-md-6">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'accounts'|_ }}</h3>
</div>
<div class="box-body table-responsive no-padding">
<table class="table table-hover sortable">
<thead>
<tr>
<th data-defaultsign="az">{{ 'name'|_ }}</th>
<th data-defaultsign="_19" style="text-align: right;">{{ 'earned'|_ }}</th>
<th data-defaultsign="_19" style="text-align: right;">{{ 'spent'|_ }}</th>
</tr>
</thead>
<tbody>
{% for account in accounts %}
<tr>
<td data-value="{{ account.name }}">
<a href="{{ route('accounts.show', account.id) }}" title="{{ account.name }}">{{ account.name }}</a>
</td>
{% if accountSummary[account.id] %}
<td data-value="{{ accountSummary[account.id].earned }}"
style="text-align: right;">{{ accountSummary[account.id].earned|formatAmount }}</td>
{% else %}
<td data-value="0" style="text-align: right;">{{ 0|formatAmount }}</td>
{% endif %}
{% if accountSummary[account.id] %}
<td data-value="{{ accountSummary[account.id].spent }}"
style="text-align: right;">{{ accountSummary[account.id].spent|formatAmount }}</td>
{% else %}
<td data-value="0" style="text-align: right;">{{ 0|formatAmount }}</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<td>{{ 'sum'|_ }}</td>
<td style="text-align: right;">{{ accountSummary.sum.earned|formatAmount }}</td>
<td style="text-align: right;">{{ accountSummary.sum.spent|formatAmount }}</td>
</tr>
</tfoot>
</table>
<div class="box-body table-responsive no-padding" id="accountsHolder">
</div>
{# loading indicator #}
<div class="overlay">
<i class="fa fa-refresh fa-spin"></i>
</div>
</div>
</div>
<div class="col-lg-2 col-md-3">
<div class="box" id="pieCharts">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'income_per_tag'|_ }}</h3>
<h3 class="box-title">{{ 'tags'|_ }}</h3>
</div>
<div class="box-body">
<canvas id="tags-in-pie-chart" style="margin:0 auto;" height="150" width="150"></canvas>
<label style="font-weight:normal;">
<input type="checkbox" id="tags-in-pie-chart-checked">
<small>{{ 'include_income_not_in_tags'|_ }}</small>
</label>
<div class="box-body table-responsive no-padding" id="tagsHolder">
</div>
{# loading indicator #}
<div class="overlay">
<i class="fa fa-refresh fa-spin"></i>
</div>
</div>
</div>
<div class="col-lg-2 col-md-3">
</div>
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'account_per_tag'|_ }}</h3>
</div>
<div class="box-body table-responsive no-padding" id="accountPerTagHolder">
</div>
{# loading indicator #}
<div class="overlay">
<i class="fa fa-refresh fa-spin"></i>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6 col-md-6">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'expense_per_tag'|_ }}</h3>
</div>
<div class="box-body">
<canvas id="tags-out-pie-chart" style="margin:0 auto;" height="150" width="150"></canvas>
<label style="font-weight:normal;">
<input type="checkbox" id="tags-out-pie-chart-checked">
<small>{{ 'include_expense_not_in_tags'|_ }}</small>
</label>
<div style="width:100%;margin:0 auto;">
<canvas id="tag-out-pie-chart" style="width:100%;height:250px;" height="250"></canvas>
</div>
</div>
</div>
</div>
<div class="col-lg-2 col-md-3">
<div class="col-lg-6 col-md-6">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'income_per_tag'|_ }}</h3>
</div>
<div class="box-body">
<div style="width:100%;margin:0 auto;">
<canvas id="tag-in-pie-chart" style="width:100%;height:250px;" height="250"></canvas>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-4 col-md-6">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'expense_per_category'|_ }}</h3>
</div>
<div class="box-body">
<div style="width:100%;margin:0 auto;">
<canvas id="category-out-pie-chart" style="width:100%;height:250px;" height="250"></canvas>
</div>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'income_per_category'|_ }}</h3>
</div>
<div class="box-body">
<div style="width:100%;margin:0 auto;">
<canvas id="category-in-pie-chart" style="width:100%;height:250px;" height="250"></canvas>
</div>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'expense_per_budget'|_ }}</h3>
</div>
<div class="box-body">
<canvas id="budgets-out-pie-chart" style="margin:0 auto;" height="150" width="150"></canvas>
<div style="width:100%;margin:0 auto;">
<canvas id="budgets-out-pie-chart" style="width:100%;height:250px;" height="250"></canvas>
</div>
</div>
</div>
</div>
@@ -96,355 +117,128 @@
<div class="col-lg-6 col-md-6">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'tags'|_ }}</h3>
<h3 class="box-title">{{ 'expense_per_source_account'|_ }}</h3>
</div>
<div class="box-body table-responsive no-padding">
<table class="table table-hover sortable">
<thead>
<tr>
<th data-defaultsign="az">{{ 'name'|_ }}</th>
<th data-defaultsign="_19" style="text-align: right;">{{ 'earned'|_ }}</th>
<th data-defaultsign="_19" style="text-align: right;">{{ 'spent'|_ }}</th>
</tr>
</thead>
<tbody>
{% for tag in tags %}
<tr>
<td data-value="{{ tag.tag }}">
<a href="{{ route('tags.show', tag.id) }}" title="{{ tag.tag }}">{{ tag.tag }}</a>
</td>
{% if tagSummary[tag.id] %}
<td data-value="{{ tagSummary[tag.id].earned }}"
style="text-align: right;">{{ tagSummary[tag.id].earned|formatAmount }}</td>
{% else %}
<td data-value="0" style="text-align: right;">{{ 0|formatAmount }}</td>
{% endif %}
{% if tagSummary[tag.id] %}
<td data-value="{{ tagSummary[tag.id].spent }}" style="text-align: right;">{{ tagSummary[tag.id].spent|formatAmount }}</td>
{% else %}
<td data-value="0" style="text-align: right;">{{ 0|formatAmount }}</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
<tfoot>
<tr>
<td>{{ 'sum'|_ }}</td>
<td style="text-align: right;">{{ tagSummary.sum.earned|formatAmount }}</td>
<td style="text-align: right;">{{ tagSummary.sum.spent|formatAmount }}</td>
</tr>
</tfoot>
</table>
<div class="box-body">
<div style="width:100%;margin:0 auto;">
<canvas id="source-out-pie-chart" style="width:100%;height:250px;" height="250"></canvas>
</div>
</div>
</div>
</div>
<div class="col-lg-2 col-md-3">
<div class="col-lg-6 col-md-6">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'income_per_account'|_ }}</h3>
<h3 class="box-title">{{ 'income_per_source_account'|_ }}</h3>
</div>
<div class="box-body">
<canvas id="accounts-in-pie-chart" style="margin:0 auto;" height="150" width="150"></canvas>
<label style="font-weight:normal;">
<input type="checkbox" id="accounts-in-pie-chart-checked">
<small>{{ 'include_income_not_in_account'|_ }}</small>
</label>
</div>
</div>
</div>
<div class="col-lg-2 col-md-3">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'expense_per_account'|_ }}</h3>
</div>
<div class="box-body">
<canvas id="accounts-out-pie-chart" style="margin:0 auto;" height="150" width="150"></canvas>
<label style="font-weight:normal;">
<input type="checkbox" id="accounts-out-pie-chart-checked">
<small>{{ 'include_income_not_in_account'|_ }}</small>
</label>
</div>
</div>
</div>
<div class="col-lg-2 col-md-3">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'expense_per_category'|_ }}</h3>
</div>
<div class="box-body">
<canvas id="categories-out-pie-chart" style="margin:0 auto;" height="150" width="150"></canvas>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<div class="box" id="incomeAndExpensesChart">
<div class="box-header with-border">
<h3 class="box-title">{{ 'income_and_expenses'|_ }}</h3>
</div>
<div class="box-body">
<canvas id="in-out-chart" style="width:100%;height:400px;" height="400" width="100%"></canvas>
<div style="width:100%;margin:0 auto;">
<canvas id="source-in-pie-chart" style="width:100%;height:250px;" height="250"></canvas>
</div>
</div>
</div>
</div>
</div>
<div class="row">
{% if averageExpenses|length > 0 %}
<div class="col-lg-6">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'average_spending_per_account'|_ }}</h3>
</div>
<div class="box-body table-responsive no-padding">
<table class="table table-hover sortable">
<thead>
<tr>
<th data-defaultsign="az">{{ 'account'|_ }}</th>
<th data-defaultsign="_19" style="text-align: right;">{{ 'spent_average'|_ }}</th>
<th data-defaultsign="_19" style="text-align: right;">{{ 'total'|_ }}</th>
<th data-defaultsign="_19">{{ 'transaction_count'|_ }}</th>
</tr>
</thead>
<tbody>
{% set totalCount = 0 %}
{% set totalSum = 0 %}
{% for row in averageExpenses %}
{% set totalCount = totalCount+ row.count %}
{% set totalSum = totalSum + row.sum %}
{% if loop.index > listLength %}
<tr class="overListLength">
{% else %}
<tr>
{% endif %}
<td data-value="{{ row.name }}">
<a href="{{ route('accounts.show', row.id) }}">{{ row.name }}</a>
</td>
<td data-value="{{ row.average }}" style="text-align: right;">
{{ row.average|formatAmount }}
</td>
<td data-value="{{ row.sum }}" style="text-align: right;">
{{ row.sum|formatAmount }}
</td>
<td data-value="{{ row.count }}">
{{ row.count }}
</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
{% if averageExpenses|length > listLength %}
<tr>
<td colspan="4" class="active">
<a href="#" class="listLengthTrigger">{{ trans('firefly.show_full_list',{number:incomeTopLength}) }}</a>
</td>
</tr>
{% endif %}
<tr>
<td colspan="2">
{{ 'sum'|_ }}
</td>
<td style="text-align:right">{{ totalSum|formatAmount }}</td>
<td>{{ totalCount }}</td>
</tr>
</tfoot>
</table>
<div class="col-lg-6 col-md-6">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'expense_per_destination_account'|_ }}</h3>
</div>
<div class="box-body">
<div style="width:100%;margin:0 auto;">
<canvas id="dest-out-pie-chart" style="width:100%;height:250px;" height="250"></canvas>
</div>
</div>
</div>
{% endif %}
{% if topExpenses|length > 0 %}
<div class="col-lg-6">
</div>
<div class="col-lg-6 col-md-6">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'income_per_destination_account'|_ }}</h3>
</div>
<div class="box-body">
<div style="width:100%;margin:0 auto;">
<canvas id="dest-in-pie-chart" style="width:100%;height:250px;" height="250"></canvas>
</div>
</div>
</div>
</div>
</div>
<div class="box">
{% for tag in tags %}
<div class="row">
<div class="col-lg-12">
<div class="box main_budget_chart">
<div class="box-header with-border">
<h3 class="box-title">{{ 'expenses'|_ }} ({{ trans('firefly.topX', {number: listLength}) }})</h3>
<h3 class="box-title">{{ 'income_and_expenses'|_ }} ({{ tag.tag }})</h3>
</div>
<div class="box-body">
<table class="table table-hover sortable">
<thead>
<tr>
<th data-defaultsort="disabled">{{ 'description'|_ }}</th>
<th data-defaultsign="month">{{ 'date'|_ }}</th>
<th data-defaultsign="az">{{ 'account'|_ }}</th>
<th data-defaultsign="_19" style="text-align: right;">{{ 'amount'|_ }}</th>
</tr>
</thead>
<tbody>
{% set totalSum = 0 %}
{% for row in topExpenses %}
{% set totalSum = totalSum + row.transaction_amount %}
{% if loop.index > listLength %}
<tr class="overListLength">
{% else %}
<tr>
{% endif %}
<td data-sortable="false">
<a href="{{ route('transactions.show', 1+row.transaction_group_id) }}">
{% if row.group_title|length > 0 %}
{{ row.group_title }} ({{ row.description }})
{% else %}
{{ row.description }}
{% endif %}
</a>
</td>
<td data-value="{{ row.date.format('Y-m-d') }}">
{{ row.date.formatLocalized(monthAndDayFormat) }}
</td>
<td data-value="{{ row.destination_account_name }}">
<a href="{{ route('accounts.show', row.destination_account_id) }}">
{{ row.destination_account_name }}
</a>
</td>
<td data-value="{{ row.amount }}" style="text-align: right;">
{{ formatAmountBySymbol(row.amount, row.currency_symbol, row.currency_decimal_places) }}
</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
{% if topExpenses|length > listLength %}
<tr>
<td colspan="3" class="active">
<a href="#" class="listLengthTrigger">{{ trans('firefly.show_full_list',{number:incomeTopLength}) }}</a>
</td>
</tr>
{% endif %}
<tr>
<td colspan="3">
{{ 'sum'|_ }}
</td>
<td style="text-align:right">{{ totalSum|formatAmount }}</td>
</tr>
</tfoot>
</table>
<canvas class="main_tag_canvas"
data-url="{{ route('chart.tag.main', [accountIds, tag.id, start.format('Ymd'), end.format('Ymd')]) }}"
id="in-out-chart-{{ tag.id }}" style="width:100%;height:400px;" height="400" width="100%"></canvas>
</div>
<div class="box-footer">
<p class="text-info"><em>{{ 'tag_report_chart_single_tag'|_ }}</em></p>
</div>
</div>
</div>
{% endif %}
</div>
</div>
{% endfor %}
<div class="row">
{% if averageIncome|length > 0 %}
<div class="col-lg-6">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'average_income_per_account'|_ }}</h3>
</div>
<div class="box-body">
<table class="table table-hover sortable">
<thead>
<tr>
<th data-defaultsign="az">{{ 'account'|_ }}</th>
<th data-defaultsign="_19" style="text-align:right;">{{ 'income_average'|_ }}</th>
<th data-defaultsign="_19" style="text-align:right;">{{ 'total'|_ }}</th>
<th data-defaultsign="_19">{{ 'transaction_count'|_ }}</th>
</tr>
</thead>
<tbody>
{% set totalCount = 0 %}
{% set totalSum = 0 %}
{% for row in averageIncome %}
{% set totalCount = totalCount+ row.count %}
{% set totalSum = totalSum + row.sum %}
<tr>
<td data-value="{{ row.name }}">
<a href="{{ route('accounts.show', row.id) }}">{{ row.name }}</a>
</td>
<td data-value="{{ row.average }}" style="text-align:right;">
{{ (row.average*-1)|formatAmount }}
</td>
<td data-value="{{ row.sum }}" style="text-align:right;">
{{ (row.sum*-1)|formatAmount }}
</td>
<td data-value="{{ row.count }}">
{{ row.count }}
</td>
</tr>
{% endfor %}
<tr>
<td colspan="2">
{{ 'sum'|_ }}
</td>
<td style="text-align:right">{{ (totalSum*-1)|formatAmount }}</td>
<td>{{ totalCount }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
{% endif %}
<div class="col-lg-6">
{% if topIncome|length > 0 %}
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'income'|_ }} ({{ trans('firefly.topX', {number: listLength}) }})</h3>
</div>
<div class="box-body">
<table class="table table-hover sortable">
<thead>
<tr>
<th data-defaultsort="disabled">{{ 'description'|_ }}</th>
<th data-defaultsign="month">{{ 'date'|_ }}</th>
<th data-defaultsign="az">{{ 'account'|_ }}</th>
<th data-defaultsign="_19" style="text-align:right;">{{ 'amount'|_ }}</th>
</tr>
</thead>
<tbody>
{% set totalSum = 0 %}
{% for row in topIncome %}
{% set totalSum = totalSum + row.transaction_amount %}
{% if loop.index > listLength %}
<tr class="overListLength">
{% else %}
<tr>
{% endif %}
<td>
<a href="{{ route('transactions.show', row.transaction_journal_id) }}">
{% if row.transaction_description|length > 0 %}
{{ row.transaction_description }} ({{ row.description }})
{% else %}
{{ row.description }}
{% endif %}
</a>
</td>
<td data-value="{{ row.date.format('Y-m-d H-i-s') }}">
{{ row.date.formatLocalized(monthAndDayFormat) }}
</td>
<td data-value="{{ row.source_account_name }}">
<a href="{{ route('accounts.show', row.source_account_id) }}">
{{ row.source_account_name }}
</a>
</td>
<td data-value="{{ row.transaction_amount*-1 }}" style="text-align:right;">
{{ (row.transaction_amount*-1)|formatAmount }}
</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
{% if topIncome.count > listLength %}
<tr>
<td colspan="3" class="active">
<a href="#" class="listLengthTrigger">{{ trans('firefly.show_full_list',{number:incomeTopLength}) }}</a>
</td>
</tr>
{% endif %}
<tr>
<td colspan="3">
{{ 'sum'|_ }}
</td>
<td style="text-align:right">{{ (totalSum*-1)|formatAmount }}</td>
</tr>
</tfoot>
</table>
</div>
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'average_spending_per_destination'|_ }}</h3>
</div>
{% endif %}
<div class="box-body table-responsive no-padding" id="avgExpensesHolder">
</div>
{# loading indicator #}
<div class="overlay">
<i class="fa fa-refresh fa-spin"></i>
</div>
</div>
</div>
<div class="col-lg-6">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'average_earning_per_source'|_ }}</h3>
</div>
<div class="box-body table-responsive no-padding" id="avgIncomeHolder">
</div>
{# loading indicator #}
<div class="overlay">
<i class="fa fa-refresh fa-spin"></i>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'expenses'|_ }} ({{ trans('firefly.topX', {number: listLength}) }})</h3>
</div>
<div class="box-body table-responsive no-padding" id="topExpensesHolder">
</div>
{# loading indicator #}
<div class="overlay">
<i class="fa fa-refresh fa-spin"></i>
</div>
</div>
</div>
<div class="col-lg-6">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'income'|_ }} ({{ trans('firefly.topX', {number: listLength}) }})</h3>
</div>
<div class="box-body table-responsive no-padding" id="topIncomeHolder">
</div>
{# loading indicator #}
<div class="overlay">
<i class="fa fa-refresh fa-spin"></i>
</div>
</div>
</div>
</div>
@@ -456,26 +250,37 @@
<script type="text/javascript" src="v1/js/ff/charts.js?v={{ FF_VERSION }}"></script>
<script type="text/javascript" src="v1/js/lib/bootstrap-sortable.js?v={{ FF_VERSION }}"></script>
<script type="text/javascript" src="v1/js/ff/reports/all.js?v={{ FF_VERSION }}"></script>
<script type="text/javascript">
// to report another URL:
var startDate = '{{ start.format('Ymd') }}';
var endDate = '{{ end.format('Ymd') }}';
var accountIds = '{{ accountIds }}';
var tagTags = '{{ tagTags }}';
var tagIds = '{{ tagIds }}';
// chart uri's
var tagIncomeUri = '{{ route('chart.tag.tag-income', [accountIds, tagIds, start.format('Ymd'), end.format('Ymd'),'OTHERS']) }}';
var tagExpenseUri = '{{ route('chart.tag.tag-expense', [accountIds, tagIds, start.format('Ymd'), end.format('Ymd'),'OTHERS']) }}';
var accountIncomeUri = '{{ route('chart.tag.account-income', [accountIds, tagIds, start.format('Ymd'), end.format('Ymd'),'OTHERS']) }}';
var accountExpenseUri = '{{ route('chart.tag.account-expense', [accountIds, tagIds, start.format('Ymd'), end.format('Ymd'),'OTHERS']) }}';
// html block URI's:
var accountsUri = '{{ route('report-data.tag.accounts', [accountIds, tagIds, start.format('Ymd'), end.format('Ymd')]) }}';
var tagsUri = '{{ route('report-data.tag.tags', [accountIds, tagIds, start.format('Ymd'), end.format('Ymd')]) }}';
var accountPerTagUri = '{{ route('report-data.tag.account-per-tag', [accountIds, tagIds, start.format('Ymd'), end.format('Ymd')]) }}';
// pie charts:
var tagOutUri = '{{ route('chart.tag.tag-expense', [accountIds, tagIds, start.format('Ymd'), end.format('Ymd')]) }}';
var tagInUri = '{{ route('chart.tag.tag-income', [accountIds, tagIds, start.format('Ymd'), end.format('Ymd')]) }}';
var categoryOutUri = '{{ route('chart.tag.category-expense', [accountIds, tagIds, start.format('Ymd'), end.format('Ymd')]) }}';
var categoryInUri = '{{ route('chart.tag.category-income', [accountIds, tagIds, start.format('Ymd'), end.format('Ymd')]) }}';
var budgetsOutUri = '{{ route('chart.tag.budget-expense', [accountIds, tagIds, start.format('Ymd'), end.format('Ymd')]) }}';
var sourceOutUri = '{{ route('chart.tag.source-expense', [accountIds, tagIds, start.format('Ymd'), end.format('Ymd')]) }}';
var sourceInUri = '{{ route('chart.tag.source-income', [accountIds, tagIds, start.format('Ymd'), end.format('Ymd')]) }}';
var destOutUri = '{{ route('chart.tag.dest-expense', [accountIds, tagIds, start.format('Ymd'), end.format('Ymd')]) }}';
var destInUri = '{{ route('chart.tag.dest-income', [accountIds, tagIds, start.format('Ymd'), end.format('Ymd')]) }}';
var avgExpensesUri = '{{ route('report-data.tag.avg-expenses', [accountIds, tagIds, start.format('Ymd'), end.format('Ymd')]) }}';
var topExpensesUri = '{{ route('report-data.tag.top-expenses', [accountIds, tagIds, start.format('Ymd'), end.format('Ymd')]) }}';
var avgIncomeUri = '{{ route('report-data.tag.avg-income', [accountIds, tagIds, start.format('Ymd'), end.format('Ymd')]) }}';
var topIncomeUri = '{{ route('report-data.tag.top-income', [accountIds, tagIds, start.format('Ymd'), end.format('Ymd')]) }}';
// two new charts
var tagBudgetUri = '{{ route('chart.tag.budget-expense', [accountIds, tagIds, start.format('Ymd'), end.format('Ymd')]) }}';
var tagCategoryUri = '{{ route('chart.tag.category-expense', [accountIds, tagIds, start.format('Ymd'), end.format('Ymd')]) }}';
var mainUri = '{{ route('chart.tag.main', [accountIds, tagIds, start.format('Ymd'), end.format('Ymd')]) }}';
</script>
<script type="text/javascript" src="v1/js/ff/reports/all.js?v={{ FF_VERSION }}"></script>
<script type="text/javascript" src="v1/js/ff/reports/tag/month.js?v={{ FF_VERSION }}"></script>
{% endblock %}

View File

@@ -0,0 +1,40 @@
<table class="table table-hover sortable">
<thead>
<tr>
<th data-defaultsign="az">{{ 'name'|_ }}</th>
{% for tag in tags %}
<th data-defaultsign="_19" style="text-align: right;">{{ tag.tag }}</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for account in report %}
{% for currency in account.currencies %}
<tr>
<td data-value="{{ account.name }} ({{ currency.currency_name }})">
<a href="{{ route('accounts.show', account.id) }}" title="{{ account.iban }}">{{ account.name }} ({{ currency.currency_name }})</a>
</td>
{% for tag in tags %}
<td style="text-align: right;">
{% if currency.tags[tag.id] %}
<span title="{{ 'earned'|_ }}: {{ formatAmountBySymbol(currency.tags[tag.id].earned, currency.currency_symbol, currency.currency_decimal_places, false) }}, {{ 'spent'|_ }}: {{ formatAmountBySymbol(currency.tags[tag.id].spent, currency.currency_symbol, currency.currency_decimal_places, false) }}"
{{ formatAmountBySymbol(currency.tags[tag.id].sum, currency.currency_symbol, currency.currency_decimal_places) }}
{% else %}
&mdash;
{% endif %}
</td>
{% endfor %}
</tr>
{% endfor %}
{% endfor %}
</tbody>
<tfoot>
<tr>
<td colspan="{{ 1 + tags|length }}">
<p class="text-info">
<em>{{ 'tag_report_expenses_listed_once'|_ }}</em>
</p>
</td>
</tr>
</tfoot>
</table>

View File

@@ -0,0 +1,46 @@
<table class="table table-hover sortable">
<thead>
<tr>
<th data-defaultsign="az">{{ 'name'|_ }}</th>
<th data-defaultsign="_19" style="text-align: right;">{{ 'spent'|_ }}</th>
<th data-defaultsign="_19" style="text-align: right;">{{ 'earned'|_ }}</th>
<th data-defaultsign="_19" style="text-align: right;">{{ 'sum'|_ }}</th>
</tr>
</thead>
<tbody>
{% for account in report %}
{% for currency in account.currencies %}
<tr>
<td data-value="{{ account.name }} ({{ currency.currency_name }})">
<a href="{{ route('accounts.show', account.id) }}" title="{{ account.iban }}">{{ account.name }} ({{ currency.currency_name }})</a>
</td>
<td data-value="{{ currency.spent }}" style="text-align: right;">
{{ formatAmountBySymbol(currency.spent, currency.currency_symbol, currency.currency_decimal_places) }}
</td>
<td data-value="{{ currency.earned }}" style="text-align: right;">
{{ formatAmountBySymbol(currency.earned, currency.currency_symbol, currency.currency_decimal_places) }}
</td>
<td data-value="{{ currency.sum }}" style="text-align: right;">
{{ formatAmountBySymbol(currency.sum, currency.currency_symbol, currency.currency_decimal_places) }}
</td>
</tr>
{% endfor %}
{% endfor %}
</tbody>
<tfoot>
{% for sum in sums %}
<tr>
<td>{{ 'sum'|_ }} ({{ sum.currency_name }})</td>
<td style="text-align: right;">
{{ formatAmountBySymbol(sum.spent_sum, sum.currency_symbol, sum.currency_decimal_places) }}
</td>
<td style="text-align: right;">
{{ formatAmountBySymbol(sum.earned_sum, sum.currency_symbol, sum.currency_decimal_places) }}
</td>
<td style="text-align: right;">
{{ formatAmountBySymbol(sum.total_sum, sum.currency_symbol, sum.currency_decimal_places) }}
</td>
</tr>
{% endfor %}
</tfoot>
</table>

View File

@@ -0,0 +1,46 @@
<table class="table table-hover sortable">
<thead>
<tr>
<th data-defaultsign="az">{{ 'account'|_ }}</th>
<th data-defaultsign="_19" style="text-align: right;">{{ 'spent_average'|_ }}</th>
<th data-defaultsign="_19" style="text-align: right;">{{ 'total'|_ }}</th>
<th data-defaultsign="_19">{{ 'transaction_count'|_ }}</th>
</tr>
</thead>
<tbody>
{% for row in result %}
{% if loop.index > listLength %}
<tr class="overListLength">
{% else %}
<tr>
{% endif %}
<td data-sortable="false">
<a href="{{ route('accounts.show', row.destination_account_id) }}">
{{ row.destination_account_name }}
</a>
</td>
<td data-value="{{ row.avg }}" style="text-align: right;">
{{ formatAmountBySymbol(row.avg, row.currency_symbol, row.currency_decimal_places) }}
</td>
<td data-value="{{ row.sum }}" style="text-align: right;">
{{ formatAmountBySymbol(row.sum, row.currency_symbol, row.currency_decimal_places) }}
</td>
<td data-value="{{ row.transactions }}">
{{ row.transactions }}
</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
{% if result|length > listLength %}
<tr>
<td colspan="5" class="active">
<a href="#" class="listLengthTrigger">{{ trans('firefly.show_full_list',{number:incomeTopLength}) }}</a>
</td>
</tr>
{% endif %}
</tfoot>
</table>

View File

@@ -0,0 +1,46 @@
<table class="table table-hover sortable">
<thead>
<tr>
<th data-defaultsign="az">{{ 'account'|_ }}</th>
<th data-defaultsign="_19" style="text-align: right;">{{ 'spent_average'|_ }}</th>
<th data-defaultsign="_19" style="text-align: right;">{{ 'total'|_ }}</th>
<th data-defaultsign="_19">{{ 'transaction_count'|_ }}</th>
</tr>
</thead>
<tbody>
{% for row in result %}
{% if loop.index > listLength %}
<tr class="overListLength">
{% else %}
<tr>
{% endif %}
<td data-sortable="false">
<a href="{{ route('accounts.show', row.source_account_id) }}">
{{ row.source_account_name }}
</a>
</td>
<td data-value="{{ row.avg }}" style="text-align: right;">
{{ formatAmountBySymbol(row.avg, row.currency_symbol, row.currency_decimal_places) }}
</td>
<td data-value="{{ row.sum }}" style="text-align: right;">
{{ formatAmountBySymbol(row.sum, row.currency_symbol, row.currency_decimal_places) }}
</td>
<td data-value="{{ row.transactions }}">
{{ row.transactions }}
</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
{% if result|length > listLength %}
<tr>
<td colspan="5" class="active">
<a href="#" class="listLengthTrigger">{{ trans('firefly.show_full_list',{number:incomeTopLength}) }}</a>
</td>
</tr>
{% endif %}
</tfoot>
</table>

View File

@@ -0,0 +1,64 @@
<table class="table table-hover sortable">
<thead>
<tr>
<th data-defaultsign="az">{{ 'name'|_ }}</th>
<th data-defaultsign="_19" style="text-align: right;">{{ 'spent'|_ }}</th>
<th data-defaultsign="_19" style="text-align: right;">{{ 'earned'|_ }}</th>
<th data-defaultsign="_19" style="text-align: right;">{{ 'sum'|_ }}</th>
</tr>
</thead>
<tbody>
{% for tag in report %}
{% if tag.currencies|length == 0 %}
<tr>
<td data-value="{{ tag.name }}">
<a href="{{ route('tags.show', tag.id) }}" title="{{ tag.name }}">{{ tag.name }}</a>
</td>
<td style="text-align: right;">&mdash;</td>
<td style="text-align: right;">&mdash;</td>
<td style="text-align: right;">&mdash;</td>
</tr>
{% endif %}
{% for currency in tag.currencies %}
<tr>
<td data-value="{{ tag.name }} ({{ currency.currency_name }})">
<a href="{{ route('tags.show', tag.id) }}" title="{{ tag.name }}">{{ tag.name }} ({{ currency.currency_name }})</a>
</td>
<td data-value="{{ currency.spent }}" style="text-align: right;">
{{ formatAmountBySymbol(currency.spent, currency.currency_symbol, currency.currency_decimal_places) }}
</td>
<td data-value="{{ currency.earned }}" style="text-align: right;">
{{ formatAmountBySymbol(currency.earned, currency.currency_symbol, currency.currency_decimal_places) }}
</td>
<td data-value="{{ currency.sum }}" style="text-align: right;">
{{ formatAmountBySymbol(currency.sum, currency.currency_symbol, currency.currency_decimal_places) }}
</td>
</tr>
{% endfor %}
{% endfor %}
</tbody>
<tfoot>
{% for sum in sums %}
<tr>
<td>{{ 'sum'|_ }} ({{ sum.currency_name }})</td>
<td style="text-align: right;">
{{ formatAmountBySymbol(sum.spent_sum, sum.currency_symbol, sum.currency_decimal_places) }}
</td>
<td style="text-align: right;">
{{ formatAmountBySymbol(sum.earned_sum, sum.currency_symbol, sum.currency_decimal_places) }}
</td>
<td style="text-align: right;">
{{ formatAmountBySymbol(sum.total_sum, sum.currency_symbol, sum.currency_decimal_places) }}
</td>
</tr>
{% endfor %}
<tr>
<td colspan="4">
<p class="text-info">
<em>{{ 'tag_report_expenses_listed_once'|_ }}</em>
</p>
</td>
</tr>
</tfoot>
</table>

View File

@@ -0,0 +1,54 @@
<table class="table table-hover sortable">
<thead>
<tr>
<th data-defaultsort="disabled">{{ 'description'|_ }}</th>
<th data-defaultsign="month">{{ 'date'|_ }}</th>
<th data-defaultsign="az">{{ 'account'|_ }}</th>
<th data-defaultsign="az">{{ 'tag'|_ }}</th>
<th data-defaultsign="_19" style="text-align: right;">{{ 'amount'|_ }}</th>
</tr>
</thead>
<tbody>
{% for row in result %}
{% if loop.index > listLength %}
<tr class="overListLength">
{% else %}
<tr>
{% endif %}
<td data-sortable="false">
<a href="{{ route('transactions.show', row.transaction_group_id) }}">
{{ row.description }}
</a>
</td>
<td data-sortable="false">
{{ row.date }}
</td>
<td data-sortable="false">
<a href="{{ route('accounts.show', row.destination_account_id) }}">
{{ row.destination_account_name }}
</a>
</td>
<td data-sortable="false">
<a href="{{ route('tags.show', row.tag_id) }}">
{{ row.tag_name }}
</a>
</td>
<td data-value="{{ row.amount }}" style="text-align: right;">
{{ formatAmountBySymbol(row.amount, row.currency_symbol, row.currency_decimal_places) }}
</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
{% if result|length > listLength %}
<tr>
<td colspan="5" class="active">
<a href="#" class="listLengthTrigger">{{ trans('firefly.show_full_list',{number:incomeTopLength}) }}</a>
</td>
</tr>
{% endif %}
</tfoot>
</table>

View File

@@ -0,0 +1,54 @@
<table class="table table-hover sortable">
<thead>
<tr>
<th data-defaultsort="disabled">{{ 'description'|_ }}</th>
<th data-defaultsign="month">{{ 'date'|_ }}</th>
<th data-defaultsign="az">{{ 'account'|_ }}</th>
<th data-defaultsign="az">{{ 'tag'|_ }}</th>
<th data-defaultsign="_19" style="text-align: right;">{{ 'amount'|_ }}</th>
</tr>
</thead>
<tbody>
{% for row in result %}
{% if loop.index > listLength %}
<tr class="overListLength">
{% else %}
<tr>
{% endif %}
<td data-sortable="false">
<a href="{{ route('transactions.show', row.transaction_group_id) }}">
{{ row.description }}
</a>
</td>
<td data-sortable="false">
{{ row.date }}
</td>
<td data-sortable="false">
<a href="{{ route('accounts.show', row.source_account_id) }}">
{{ row.source_account_name }}
</a>
</td>
<td data-sortable="false">
<a href="{{ route('tags.show', row.tag_id) }}">
{{ row.tag_name }}
</a>
</td>
<td data-value="{{ row.amount }}" style="text-align: right;">
{{ formatAmountBySymbol(row.amount, row.currency_symbol, row.currency_decimal_places) }}
</td>
</tr>
{% endfor %}
</tbody>
<tfoot>
{% if result|length > listLength %}
<tr>
<td colspan="5" class="active">
<a href="#" class="listLengthTrigger">{{ trans('firefly.show_full_list',{number:incomeTopLength}) }}</a>
</td>
</tr>
{% endif %}
</tfoot>
</table>