Make budget tables multi-currency

This commit is contained in:
James Cole
2019-08-27 10:25:23 +02:00
parent 33d0b8ca22
commit 7eb9086a28
5 changed files with 54 additions and 39 deletions

View File

@@ -10,7 +10,7 @@
</thead>
<tbody>
{% for bill in report.bills %}
{% if bill.expected_dates|length > 0 and bill.paid_moments|length > 0 and bill.active %}
{% if (bill.expected_dates|length > 0 or bill.paid_moments|length > 0) and bill.active %}
<tr>
<td>
<a href="{{ route('bills.show',bill.id) }}">{{ bill.name }}</a>

View File

@@ -9,32 +9,33 @@
</tr>
</thead>
<tbody>
{% for id, info in report %}
{% for key, info in report %}
<tr>
<td>
{% if id != 0 %}
<a class="btn btn-default btn-xs" href="{{ route('budgets.show', [id]) }}"><i class="fa fa-external-link"></i></a>
{% if info.id != 0 %}
<a class="btn btn-default btn-xs" href="{{ route('budgets.show', [info.id]) }}"><i class="fa fa-external-link"></i></a>
{% else %}
<a class="btn btn-default btn-xs" href="{{ route('budgets.no-budget') }}"><i class="fa fa-external-link"></i></a>
{% endif %}
</td>
<td data-value="{{ info.name }}">
<a title="{{ info.name }}" href="#" data-budget="{{ id }}" class="budget-chart-activate">{{ info.name }}</a>
<a title="{{ info.name }}" href="#" data-budget="{{ info.id }}" data-currency="{{ info.currency_id }}" class="budget-chart-activate">{{ info.name }}</a>
</td>
{% for key, period in periods %}
{% if(info.entries[key]) %}
<td data-value="{{ info.entries[key] }}" style="text-align: right;">
{{ info.entries[key]|formatAmount }}
{{ formatAmountBySymbol(info.entries[key], info.currency_symbol, info.currency_decimal_places) }}
</td>
{% else %}
<td data-value="0" style="text-align: right;">
{{ 0|formatAmount }}
{{ formatAmountBySymbol(0, info.currency_symbol, info.currency_decimal_places) }}
</td>
{% endif %}
{% endfor %}
<td data-value="{{ info.sum }}" style="text-align: right;">
{{ info.sum|formatAmount }}
{{ formatAmountBySymbol(info.sum, info.currency_symbol, info.currency_decimal_places) }}
</td>
</tr>
{% endfor %}