firefly-iii/resources/views/reports/partials/balance.twig
James Cole a0ea3882e1
Various code cleanup.
Signed-off-by: James Cole <thegrumpydictator@gmail.com>
2016-08-27 03:50:35 +02:00

71 lines
3.1 KiB
Twig

<div class="box">
<div class="box-header with-border">
<h3 class="box-title">{{ 'budgets'|_ }} ({{ 'splitByAccount'|_|lower }})</h3>
</div>
<div class="box-body table-responsive no-padding">
<table class="table table-hover">
<!-- build balance report header -->
<thead>
<tr>
<th colspan="2">{{ 'budgets'|_ }}</th>
{% for account in balance.getBalanceHeader.getAccounts %}
<th><a href="{{ route('accounts.show',account.id) }}">{{ account.name }}</a></th>
{% endfor %}
<th>
{{ 'leftInBudget'|_ }}
</th>
</tr>
</thead>
<tbody>
<!-- make rows -->
{% for balanceLine in balance.getBalanceLines %}
<tr>
{% if balanceLine.getBudget.id %}
<td>
<a href="{{ route('budgets.show',balanceLine.getBudget.id) }}">{{ balanceLine.getTitle }}</a>
{% if balanceLine.getStartdate and balanceLine.getEnddate %}
<span class="small"><br>
{{ balanceLine.getStartdate.formatLocalized(monthAndDayFormat) }}
&mdash;
{{ balanceLine.getEnddate.formatLocalized(monthAndDayFormat) }}
</span>
{% endif %}
</td>
<td>
{% if(balanceLine.getBudget.amount) %}
{{ balanceLine.getBudget.amount|formatAmount }}
{% else %}
{{ '0'|formatAmount }}
{% endif %}
</td>
{% else %}
<td colspan="2">{{ balanceLine.getTitle }}</td>
{% endif %}
{% for balanceEntry in balanceLine.getBalanceEntries %}
<td>
{% if balanceEntry.getSpent != 0 %}
<span class="text-danger">{{ (balanceEntry.getSpent)|formatAmountPlain }}</span>
<i class="fa fa-fw text-muted fa-info-circle firefly-info-button" data-location="balance-amount"
data-account-id="{{ balanceEntry.getAccount.id }}"
data-budget-id="{{ balanceLine.getBudget.id }}" data-role="{{ balanceLine.getRole }}"></i>
{% endif %}
{% if balanceEntry.getLeft != 0 %}
<span class="text-success">{{ (balanceEntry.getLeft)|formatAmountPlain }}</span>
{% endif %}
</td>
{% endfor %}
<td>
{{ balanceLine.leftOfRepetition|formatAmount }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>