firefly-iii/resources/views/transactions/show.twig
2016-01-30 08:42:04 +01:00

173 lines
8.5 KiB
Twig

{% extends "./layout/default.twig" %}
{% block breadcrumbs %}
{{ Breadcrumbs.renderIfExists(Route.getCurrentRoute.getName, journal) }}
{% endblock %}
{% block content %}
<div class="row">
<div class="col-lg-6 col-md-6 col-sm-12">
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">Metadata</h3>
</div>
<div class="box-body table-responsive no-padding">
<table class="table table-hover sortable">
<tr>
<td>{{ trans('list.date') }}</td>
<td>{{ journal.date.formatLocalized(monthAndDayFormat) }}</td>
</tr>
<tr>
<td>{{ trans('list.type') }}</td>
<td>{{ journal.transactiontype.type|_ }}</td>
</tr>
<tr>
<td>{{ trans('list.completed') }}</td>
<td>
{% if journal.completed %}
<span class="text-success">{{ 'yes'|_ }}</span>
{% else %}
<span class="text-danger">{{ 'no'|_ }}</span>
{% endif %}
</td>
</tr>
{% for budget in journal.budgets %}
<tr>
<td>{{ 'budget'|_ }}</td>
<td><a href="{{ route('budgets.show',budget.id) }}">{{ budget.name }}</a></td>
</tr>
{% endfor %}
{% for category in journal.categories %}
<tr>
<td>{{ 'category'|_ }}</td>
<td><a href="{{ route('categories.show',category.id) }}">{{ category.name }}</a></td>
</tr>
{% endfor %}
{% if journal.bill %}
<tr>
<td>{{ 'bill'|_ }}</td>
<td><a href="{{ route('bills.show', journal.bill_id) }}">{{ journal.bill.name }}</a></td>
</tr>
{% endif %}
{% if journal.tags|length > 0 %}
<tr>
<td>{{ 'tags'|_ }}</td>
<td>
{% for tag in journal.tags %}
<h4 style="display: inline;"><a class="label label-success" href="{{ route('tags.show',tag) }}">
{% if tag.tagMode == 'nothing' %}
<i class="fa fa-fw fa-tag"></i>
{% endif %}
{% if tag.tagMode == 'balancingAct' %}
<i class="fa fa-fw fa-refresh"></i>
{% endif %}
{% if tag.tagMode == 'advancePayment' %}
<i class="fa fa-fw fa-sort-numeric-desc"></i>
{% endif %}
{{ tag.tag }}</a>
</h4>
{% endfor %}
</td>
</tr>
{% endif %}
</table>
</div>
<div class="box-footer">
<div class="pull-right">
<a class="btn btn-default" href="{{ route('transactions.edit',journal.id) }}">{{ 'edit'|_ }}</a>
<a href="{{ route('transactions.delete',journal.id) }}" class="btn btn-danger">{{ 'delete'|_ }}</a>
</div>
</div>
</div>
<!-- attachments -->
{% if journal.attachments|length > 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 journal.attachments %}
<tr>
<td>
<div class="btn-group btn-group-xs">
<a href="{{ route('attachments.edit', att.id) }}" class="btn btn-default"><i class="fa fa-pencil"></i></a>
<a href="{{ route('attachments.delete', att.id) }}" class="btn btn-danger"><i class="fa fa-trash"></i></a>
</div>
</td>
<td>
<i class="fa {{ att.mime|mimeIcon }}"></i>
<a href="{{ route('attachments.download', att.id) }}" tle="{{ att.filename }}">
{% if att.title %}
{{ att.title }}
{% else %}
{{ att.filename }}
{% endif %}
</a>
({{ att.size|filesize }})
{% if att.description %}
<br/>
<em>{{ att.description }}</em>
{% endif %}
</td>
<td style="width:100px;">
<img src="{{ route('attachments.preview', att.id) }}"></img>
</td>
</tr>
{% endfor %}
</table>
</div>
</div>
{% endif %}
<!-- events, if present -->
{% if journal.piggyBankEvents|length > 0 %}
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'piggyBanks'|_ }}</h3>
</div>
<div class="box-body">
{% include 'list/piggy-bank-events' with {'events': events, 'showPiggyBank':true} %}
</div>
</div>
{% endif %}
</div>
<div class="col-lg-6 col-md-6 col-sm-12">
{% for t in journal.transactions %}
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ t.account.name }}</h3>
</div>
<table class="table table-hover sortable">
<tr>
<td>{{ 'account'|_ }}</td>
<td><a href="{{ route('accounts.show',t.account.id) }}">{{ t.account.name }}</a></td>
</tr>
<tr>
<td>{{ 'account_type'|_ }}</td>
<td>{{ t.account.accounttype.type|_ }}</td>
</tr>
<tr>
<td>{{ 'amount'|_ }}</td>
<td>{{ t|formatTransaction }}</td>
</tr>
<tr>
<td>{{ 'newBalance'|_ }}</td>
<td>{{ t.before|formatAmount }} &rarr; {{ t.after|formatAmount }}</td>
</tr>
{% if t.description %}
<tr>
<td>Description</td>
<td>{{ t.description }}</td>
</tr>
{% endif %}
</table>
</div>
{% endfor %}
</div>
</div>
{% endblock %}