firefly-iii/resources/views/split/journals/show.twig
2016-05-15 12:26:40 +02:00

211 lines
10 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">
<tr>
<td style="width:30%;">{{ trans('list.date') }}</td>
<td>{{ journal.date.formatLocalized(monthAndDayFormat) }}</td>
</tr>
{% if journal.interest_date %}
<tr>
<td>{{ trans('list.interest_date') }}</td>
<td>{{ journal.interest_date.formatLocalized(monthAndDayFormat) }}</td>
</tr>
{% endif %}
{% if journal.book_date %}
<tr>
<td>{{ trans('list.book_date') }}</td>
<td>{{ journal.book_date.formatLocalized(monthAndDayFormat) }}</td>
</tr>
{% endif %}
{% if journal.process_date %}
<tr>
<td>{{ trans('list.process_date') }}</td>
<td>{{ journal.process_date.formatLocalized(monthAndDayFormat) }}</td>
</tr>
{% endif %}
<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>
<tr>
<td>{{ 'budgets'|_ }}</td>
<td>{{ journalBudgets(journal)|raw }}</td>
</tr>
<tr>
<td>{{ 'categories'|_ }}</td>
<td>{{ journalCategories(journal)|raw }}</td>
</tr>
<tr>
<td>{{ 'source_accounts'|_ }}</td>
<td>{{ sourceAccount(journal)|raw }}</td>
</tr>
<tr>
<td>{{ 'destination_accounts'|_ }}</td>
<td>{{ destinationAccount(journal)|raw }}</td>
</tr>
{% 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>
<!-- 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">
{% 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) }}" title="{{ 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) }}"/>
</td>
</tr>
{% endfor %}
</table>
</div>
</div>
{% endif %}
</div>
</div>
<!-- more than two transactions-->
<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">Transactions</h3>
</div>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>{{ trans('list.description') }}</th>
<th>{{ trans('list.account') }}</th>
<th>{{ trans('list.amount') }}</th>
<th>{{ trans('list.new_balance') }}</th>
<th>{{ trans('list.budget') }}</th>
<th>{{ trans('list.category') }}</th>
</tr>
</thead>
<tbody>
{% for index, t in transactions %}
<tr>
<td>
{% if (index+1) != transactions|length or what == 'transfer' %}
{{ t.description }}
{% endif %}
</td>
<td><a href="{{ route('accounts.show',t.account.id) }}">{{ t.account.name }}</a> ({{ t.account.accounttype.type|_ }})</td>
<td>{{ t.sum|formatAmount }}</td>
<td>{{ t.before|formatAmount }} &rarr; {{ (t.sum+t.before)|formatAmount }}</td>
<td>
{% if (index+1) != transactions|length or what == 'transfer' %}
{{ transactionBudgets(t)|raw }}
{% endif %}
</td>
<td>
{% if (index+1) != transactions|length or what == 'transfer' %}
{{ transactionCategories(t)|raw }}
{% endif %}
</td>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
<!-- end -->
{% endblock %}