firefly-iii/resources/views/bills/show.twig
2018-06-24 16:17:42 +02:00

185 lines
8.8 KiB
Twig

{% extends "./layout/default" %}
{% block breadcrumbs %}
{{ Breadcrumbs.render(Route.getCurrentRoute.getName, bill) }}
{% endblock %}
{% block content %}
<div class="row">
<div class="col-lg-6 col-sm-12 col-md-12">
<div class="box" id="billInfo">
<div class="box-header with-border">
<h3 class="box-title">{{ object.data.name }}</h3>
<div class="box-tools pull-right">
<div class="btn-group">
<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('bills.edit',object.data.id) }}"><i class="fa fa-fw fa-pencil"></i> {{ 'edit'|_ }}</a></li>
<li><a href="{{ route('bills.delete',object.data.id) }}"><i class="fa fa-fw fa-trash-o"></i> {{ 'delete'|_ }}</a></li>
</ul>
</div>
</div>
</div>
<div class="box-body">
<table class="table table-striped">
<tr>
<td colspan="2">
{{ trans('firefly.match_between_amounts', {low: object.data.amount_min|formatAmount, high: object.data.amount_max|formatAmount })|raw }}
{{ 'repeats'|_ }}
{{ trans('firefly.repeat_freq_' ~object.data.repeat_freq) }}.
</td>
</tr>
<tr>
<td style="width:50%;">{{ 'bill_is_active'|_ }}</td>
<td>
{% if object.data.active %}
<i class="fa fa-check fa-fw" title="{{ 'active'|_ }}"></i> {{ 'yes'|_ }}
{% else %}
<i class="fa fa-times fa-fw" title="{{ 'inactive'|_ }}"></i> {{ 'no'|_ }}
{% endif %}
</td>
</tr>
<tr>
<td>{{ 'next_expected_match'|_ }}</td>
<td>
{% if object.data.next_expected_match|length > 0 %}
{{ formatDate(object.data.next_expected_match, monthAndDayFormat) }}
{% else %}
{{ 'unknown'|_ }}
{% endif %}
</td>
</tr>
<tr>
<td>{{ trans('firefly.average_bill_amount_year', {year: year}) }}</td>
<td>{{ yearAverage|formatAmount }}</td>
</tr>
<tr>
<td>{{ 'average_bill_amount_overall'|_ }}</td>
<td>{{ overallAverage|formatAmount }}</td>
</tr>
</table>
</div>
<div class="box-footer">
<div class="btn-group">
<a class="btn btn-default" href="{{ route('bills.edit', [object.data.id]) }}">{{ 'edit'|_ }}</a>
<a class="btn btn-danger" href="{{ route('bills.delete', [object.data.id]) }}">{{ 'delete'|_ }}</a>
</div>
</div>
</div>
</div>
<div class="col-lg-6 col-sm-12 col-md-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'bill_related_rules'|_ }}</h3>
</div>
<div class="box-body">
{% if rules.count > 0 %}
<ul>
{% for rule in rules %}
<li><a href="{{ route('rules.edit', [rule.id]) }}">{{ rule.title }}</a>
{% if not rule.active %}({{ 'list_inactive_rule'|_|lower }}){% endif %}
</li>
{% endfor %}
</ul>
{% endif %}
</div>
<div class="box-footer">
<a href="{{ route('bills.rescan',object.data.id) }}" class="btn btn-default">{{ 'rescan_old'|_ }}</a>
</div>
</div>
{% if object.data.notes.data[0] %}
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'notes'|_ }}</h3>
</div>
<div class="box-body table-responsive">
{{ object.data.notes.data[0].markdown|raw }}
</div>
</div>
{% endif %}
{% if object.data.attachments_count > 0 %}
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'attachments'|_ }}</h3>
</div>
<div class="box-body table-responsive no-padding">
<table class="table table-hover">
{% for att in bill.data.attachments.data %}
<tr>
<td>
<div class="btn-group btn-group-xs">
<a href="{{ route('attachments.edit', att.data.id) }}" class="btn btn-default"><i class="fa fa-pencil"></i></a>
<a href="{{ route('attachments.delete', att.data.id) }}" class="btn btn-danger"><i class="fa fa-trash"></i></a>
</div>
</td>
<td>
<i class="fa {{ att.data.mime|mimeIcon }}"></i>
<a href="{{ route('attachments.download', att.data.id) }}" title="{{ att.data.filename }}">
{% if att.data.title %}
{{ att.data.title }}
{% else %}
{{ att.data.filename }}
{% endif %}
</a>
({{ att.data.size|filesize }})
{% if att.data.description %}
<br/>
<em>{{ att.data.description }}</em>
{% endif %}
</td>
<td style="width:100px;">
<img src="{{ route('attachments.preview', att.data.id) }}"/>
</td>
</tr>
{% endfor %}
</table>
</div>
</div>
{% endif %}
</div>
</div>
<div class="row">
<div class="col-lg-12 col-sm-12 col-md-12">
<div class="box" id="billChart">
<div class="box-header with-border">
<h3 class="box-title">{{ 'chart'|_ }}</h3>
</div>
<div class="box-body">
<canvas id="bill-overview" style="width:100%;height:400px;" height="400" width="100%"></canvas>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-lg-12 col-sm-12 col-md-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'connected_journals'|_ }}</h3>
</div>
<div class="box-body">
{% include 'list.journals' %}
</div>
</div>
</div>
</div>
{% endblock %}
{% block scripts %}
<script type="text/javascript">
var billUri = '{{ route('chart.bill.single', [object.data.id]) }}';
</script>
<script type="text/javascript" src="js/lib/Chart.bundle.min.js?v={{ FF_VERSION }}"></script>
<script type="text/javascript" src="js/ff/charts.defaults.js?v={{ FF_VERSION }}"></script>
<script type="text/javascript" src="js/ff/charts.js?v={{ FF_VERSION }}"></script>
<script type="text/javascript" src="js/ff/bills/show.js?v={{ FF_VERSION }}"></script>
<script type="text/javascript" src="js/ff/transactions/list.js?v={{ FF_VERSION }}"></script>
{% endblock %}