Show sum [skip ci]

Signed-off-by: James Cole <thegrumpydictator@gmail.com>
This commit is contained in:
James Cole 2016-11-02 07:16:46 +01:00
parent 5be317d73c
commit 4ba34ab511
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
2 changed files with 18 additions and 8 deletions

View File

@ -185,8 +185,8 @@
<h3 class="box-title">{{ 'inactiveBudgets'|_ }}</h3> <h3 class="box-title">{{ 'inactiveBudgets'|_ }}</h3>
</div> </div>
<div class="box-body"> <div class="box-body">
{% for index,budget in inactive %} {% for budget in inactive %}
{% if index != inactive|length-1 %} {% if loop.index == inactive.count() %}
<a href="{{ route('budgets.show',budget.id) }}">{{ budget.name }}</a> <a href="{{ route('budgets.show',budget.id) }}">{{ budget.name }}</a>
{% else %} {% else %}
<a href="{{ route('budgets.show',budget.id) }}">{{ budget.name }}</a>, <a href="{{ route('budgets.show',budget.id) }}">{{ budget.name }}</a>,

View File

@ -95,24 +95,34 @@
<table class="table table-hover sortable"> <table class="table table-hover sortable">
<thead> <thead>
<tr> <tr>
<th>Budget</th> <th>{{ 'budget'|_ }}</th>
{% for year in years %} {% for year in years %}
<th>{{ year }}</th> <th>{{ year }}</th>
{% endfor %} {% endfor %}
<th>{{ 'sum'|_ }}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for id, info in budgetMultiYear %} {% for id, info in budgetMultiYear %}
<tr> <tr>
<td><a href="{{ route('budgets.show', id) }}">{{ info.name }}</a></td> <td>
{% if id == 0 %}
<a href="{{ route('budgets.noBudget') }}">{{ info.name }}</a>
{% else %}
<a href="{{ route('budgets.show', id) }}">{{ info.name }}</a>
{% endif %}
</td>
{% set sum = 0 %}
{% for amount in info.entries %} {% for amount in info.entries %}
<td> <td data-value="{{ amount }}">
{{ amount|formatAmount }} {{ amount|formatAmount }}
</td> </td>
{% set sum = sum + amount %}
{% endfor %} {% endfor %}
<td data-value="{{ sum }}">
{{ sum|formatAmount }}
</td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>