firefly-iii/resources/views/reports/default/year.twig
2016-10-26 19:37:19 +02:00

159 lines
6.1 KiB
Twig

{% extends "./layout/default.twig" %}
{% block breadcrumbs %}
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, start, end, reportType, accountIds) }}
{% endblock %}
{% block content %}
<div class="row">
<div class="col-lg-8 col-md-8 col-sm-12">
<div class="box" id="year-inc-exp">
<div class="box-header with-border">
<h3 class="box-title">{{ 'incomeVsExpenses'|_ }}</h3>
</div>
<div class="box-body">
<canvas height="400" id="income-expenses-chart" style="width:100%;height:400px;"></canvas>
</div>
</div>
</div>
<div class="col-lg-4 col-md-4 col-sm-12">
<div class="box" id="year-inc-exp-sum">
<div class="box-header with-border">
<h3 class="box-title">{{ 'incomeVsExpenses'|_ }}</h3>
</div>
<div class="box-body">
<canvas height="400" id="income-expenses-sum-chart" style="width:100%;height:400px;"></canvas>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'accountBalances'|_ }}</h3>
</div>
<div class="box-body table-responsive no-padding loading" id="accountReport">
</div>
</div>
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'incomeVsExpenses'|_ }}</h3>
</div>
<div class="box-body table-responsive no-padding loading" id="incomeVsExpenseReport">
</div>
</div>
</div>
<div class="col-lg-3 col-md-3 col-sm-3">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'income'|_ }}</h3>
</div>
<div class="box-body table-responsive no-padding loading" id="incomeReport">
</div>
</div>
</div>
<div class="col-lg-3 col-md-3 col-sm-3">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'expenses'|_ }}</h3>
</div>
<div class="box-body table-responsive no-padding loading" id="expenseReport">
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-6">
{% include 'reports/partials/tags.twig' %}
</div>
</div>
<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">{{ 'net_worth'|_ }}</h3>
</div>
<div class="box-body">
<canvas height="400" id="net-worth" style="width:100%;height:400px;"></canvas>
</div>
</div>
</div>
</div>
<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">{{ 'budgets'|_ }}</h3>
</div>
<div class="box-body">
<table class="table table-condensed table-hover">
<thead>
<tr>
<th>&nbsp;</th>
{% for date, header in budgets.get('headers') %}
<th>{{ header }}</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% set spentData = budgets.get('spent') %}
{% for budgetId, budgetName in budgets.get('budgets') %}
<tr>
<th>
<a title="{{ budgetName }}" href="#" data-budget="{{ budgetId }}" class="budget-chart-activate">{{ budgetName }}</a>
</th>
{% for date, header in budgets.get('headers') %}
<td>{{ spentData[budgetId][date]|formatAmount }}</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
<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">{{ 'chart'|_ }}</h3>
</div>
<div class="box-body">
<canvas height="400" id="budget_chart" style="width:100%;height:400px;"></canvas>
</div>
</div>
</div>
</div>
{% endblock %}
{% block scripts %}
<script type="text/javascript" src="js/lib/Chart.bundle.min.js"></script>
<script type="text/javascript" src="js/ff/charts.js"></script>
<script type="text/javascript">
var year = '{{ start.year }}';
// to report another URL:
var startDate = '{{ start.format('Ymd') }}';
var endDate = '{{ end.format('Ymd') }}';
var reportType = '{{ reportType }}';
var accountIds = '{{ accountIds }}';
<!-- some URL's -->
var accountReportUrl = '{{ route('reports.data.accountReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';
var inOutReportUrl = '{{ route('reports.data.inOutReport', [start.format('Ymd'), end.format('Ymd'), accountIds]) }}';
</script>
<script type="text/javascript" src="js/ff/reports/default/all.js"></script>
<script type="text/javascript" src="js/ff/reports/default/year.js"></script>
{% endblock %}