firefly-iii/resources/views/reports/partials/balance.twig
2016-02-05 21:29:03 +01:00

60 lines
2.3 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 %}
<td>
<a href="{{ route('budgets.show',balanceLine.getBudget.id) }}">{{ balanceLine.getTitle }}</a>
</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>
{% 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>