Fix test coverage.

This commit is contained in:
James Cole
2019-08-17 12:08:09 +02:00
parent 1d4434698e
commit b53cbbe469
16 changed files with 83 additions and 213 deletions

View File

@@ -25,9 +25,12 @@
<tbody>
{# Make sum: #}
{% set sum = 0 %}
{% set symbol = '' %}
{% set decimal_places =2 %}
{% for transaction in journals %}
{# add to sum #}
{% set symbol = transaction.currency_symbol %}
{% set decimal_places = transaction.currency_decimal_places %}
<tr class="drag" data-date="{{ transaction.date.format('Y-m-d') }}" data-id="{{ transaction.journal_id }}">
<td class="hidden-xs">
{% if transaction.transaction_type_type == 'Withdrawal' %}
@@ -134,8 +137,9 @@
<tr>
<td colspan="2" style="text-align: right;"><em>{{ 'sum'|_ }}:</em></td>
<td>
{# TODO avoid using formatAmount #}
{{ sum|formatAmount }}
{% if sum != 0 %}
{{ formatAmountBySymbol(sum, symbol, decimal_places) }}
{% endif %}
</td>
</tr>
</tfoot>

View File

@@ -9,11 +9,6 @@
<div class="modal-body">
{% set hideBudget = true %}
{% include 'popup/list/journals' %}
<p>
<small class="text-warning">
{{ 'sum_in_default_currency'|_ }}
</small>
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">{{ 'close'|_ }}</button>

View File

@@ -22,6 +22,9 @@
{% if budget.spent[account.id] %}
<td style="text-align: right;">
{{ formatAmountBySymbol(budget.spent[account.id].spent, budget.spent[account.id].currency_symbol, budget.spent[account.id].currency_decimal_places) }}
<i class="fa fa-fw fa-info-circle text-muted"></i>
{# TODO #}
{#data-location="category-entry" data-category-id="{{ category.id }}" data-currency-id="{{ category.currency_id }}"-->#}
</td>
{% else %}
{% if report.accounts[account.id].sum != 0 %}
@@ -32,7 +35,7 @@
{% endfor %}
<td style="text-align: right;">
{% for sum in report.sums[budget.budget_id] %}
{{ formatAmountBySymbol(sum.sum, sum.currency_symbol, sum.currency_decimal_places) }}<br />
{{ formatAmountBySymbol(sum.sum, sum.currency_symbol, sum.currency_decimal_places) }} <i class="fa fa-fw fa-info-circle text-muted"></i><br />
{% endfor %}
</td>
</tr>

View File

@@ -2,8 +2,8 @@
<thead>
<tr>
<th>{{ 'category'|_ }}</th>
<th style="text-align: right;">{{ 'earned'|_ }}</th>
<th style="text-align: right;">{{ 'spent'|_ }}</th>
<th style="text-align: right;">{{ 'earned'|_ }}</th>
<th>&nbsp;</th>
</tr>
</thead>
@@ -22,7 +22,7 @@
<td style="text-align: right;">{{ formatAmountBySymbol(category.earned, category.currency_symbol, category.currency_decimal_places, true) }}</td>
<td style="width:20px;">
<i class="fa fa-fw fa-info-circle text-muted firefly-info-button"
data-location="category-entry" data-category-id="{{ category.id }}"
data-location="category-entry" data-category-id="{{ category.id }}" data-currency-id="{{ category.currency_id }}"
></i>
</td>
</tr>

View File

@@ -26,8 +26,8 @@
<td data-value="{{ account.sum }}" style="text-align: right;">
{{ formatAmountBySymbol(account.sum, account.currency_symbol, account.currency_decimal_places) }}
</td>
<td class="hidden-xs" data-value="{{ entry.average }}" style="text-align: right;">
{% if entry.count > 1 %}
<td class="hidden-xs" data-value="{{ account.average }}" style="text-align: right;">
{% if account.count > 1 %}
{{ formatAmountBySymbol(account.average, account.currency_symbol, account.currency_decimal_places) }}
{% else %}
&mdash;
@@ -35,7 +35,7 @@
</td>
<td>
<i class="fa fa-fw text-muted fa-info-circle firefly-info-button" data-location="{{ type }}"
data-account-id="{{ account.id }}"></i>
data-account-id="{{ account.id }}" data-currency-id="{{ account.currency_id }}"></i>
</td>
</tr>
{% endfor %}