mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-26 13:36:15 +00:00
Various report updates and code cleanup.
This commit is contained in:
@@ -85,4 +85,5 @@ return [
|
||||
'file' => 'The :attribute must be a file.',
|
||||
'in_array' => 'The :attribute field does not exist in :other.',
|
||||
'present' => 'The :attribute field must be present.',
|
||||
'amount_zero' => 'The total amount cannot be zero',
|
||||
];
|
||||
|
||||
@@ -113,14 +113,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>
|
||||
@@ -164,7 +177,9 @@
|
||||
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 categoryPeriodReportUri = '{{ route('reports.data.categoryPeriodReport', [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]) }}';
|
||||
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" src="js/ff/reports/default/all.js"></script>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for id, info in budgets %}
|
||||
{% for id, info in report %}
|
||||
<tr>
|
||||
<td data-value="{{ info.name }}">
|
||||
<a title="{{ info.name }}" href="#" data-budget="{{ id }}" class="budget-chart-activate">{{ info.name }}</a>
|
||||
|
||||
@@ -1,75 +1,44 @@
|
||||
<table class="table table-hover sortable table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th rowspan="2" data-defaultsort="disabled">{{ 'category'|_ }}</th>
|
||||
<th data-defaultsort="disabled">{{ 'category'|_ }}</th>
|
||||
{% for period in periods %}
|
||||
<th colspan="2" data-defaultsort="disabled">{{ period }}</th>
|
||||
<th data-defaultsort="disabled">{{ period }}</th>
|
||||
{% endfor %}
|
||||
<th colspan="2" data-defaultsort="disabled">{{ 'sum'|_ }}</th>
|
||||
</tr>
|
||||
<tr>
|
||||
{% for period in periods %}
|
||||
<th data-defaultsign="_19">In</th>
|
||||
<th data-defaultsign="_19">Out</th>
|
||||
{% endfor %}
|
||||
<th data-defaultsign="_19">In</th>
|
||||
<th data-defaultsign="_19">Out</th>
|
||||
<th data-defaultsort="disabled">{{ 'sum'|_ }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for category in categories %}
|
||||
{% if report.income[category.id] or report.expense[category.id] %}
|
||||
<tr>
|
||||
<td data-value="{{ category.name }}">
|
||||
<a title="{{ category.name }}" href="#" data-category="{{ category.id }}" class="category-chart-activate">{{ category.name }}</a>
|
||||
{% for id, info in report %}
|
||||
<tr>
|
||||
<td data-value="{{ info.name }}">
|
||||
<a title="{{ info.name }}" href="#" data-category="{{ id }}" class="category-chart-activate">{{ info.name }}</a>
|
||||
</td>
|
||||
|
||||
{% for key, period in periods %}
|
||||
{# income first #}
|
||||
{% if(info.entries[key]) %}
|
||||
<td data-value="{{ info.entries[key] }}">
|
||||
{{ info.entries[key]|formatAmount }}
|
||||
</td>
|
||||
{% else %}
|
||||
<td data-value="0">
|
||||
{{ 0|formatAmount }}
|
||||
</td>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{# if sum of income, display: #}
|
||||
{% if info.sum %}
|
||||
<td data-value="{{ info.sum }}">
|
||||
{{ info.sum|formatAmount }}
|
||||
</td>
|
||||
|
||||
{% for key, period in periods %}
|
||||
{# income first #}
|
||||
{% if(report.income[category.id].entries[key]) %}
|
||||
<td data-value="{{ report.income[category.id].entries[key] }}">
|
||||
{{ report.income[category.id].entries[key]|formatAmount }}
|
||||
</td>
|
||||
{% else %}
|
||||
<td data-value="0">
|
||||
{{ 0|formatAmount }}
|
||||
</td>
|
||||
{% endif %}
|
||||
|
||||
{# expenses #}
|
||||
{% if(report.expense[category.id].entries[key]) %}
|
||||
<td data-value="{{ report.expense[category.id].entries[key] }}">
|
||||
{{ report.expense[category.id].entries[key]|formatAmount }}
|
||||
</td>
|
||||
{% else %}
|
||||
<td data-value="0">
|
||||
{{ 0|formatAmount }}
|
||||
</td>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
{# if sum of income, display: #}
|
||||
{% if report.income[category.id].sum %}
|
||||
<td data-value="{{ report.income[category.id].sum }}">
|
||||
{{ report.income[category.id].sum|formatAmount }}
|
||||
</td>
|
||||
{% else %}
|
||||
<td data-value="0">
|
||||
{{ 0|formatAmount }}
|
||||
</td>
|
||||
{% endif %}
|
||||
{# if sum of expense, display: #}
|
||||
{% if report.expense[category.id].sum %}
|
||||
<td data-value="{{ report.expense[category.id].sum }}">
|
||||
{{ report.expense[category.id].sum|formatAmount }}
|
||||
</td>
|
||||
{% else %}
|
||||
<td data-value="0">
|
||||
{{ 0|formatAmount }}
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<td data-value="0">
|
||||
{{ 0|formatAmount }}
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
Reference in New Issue
Block a user