Make reports slightly more multi currency.

This commit is contained in:
James Cole
2018-09-06 19:47:29 +02:00
parent 1903292202
commit d5773ab5d0
11 changed files with 111 additions and 26 deletions

View File

@@ -1013,6 +1013,8 @@ return [
'in_out_per_category' => 'Earned and spent per category',
'out_per_budget' => 'Spent per budget',
'select_expense_revenue' => 'Select expense/revenue account',
'multi_currency_report_sum' => 'Because this list contains accounts with multiple currencies, the sum(s) you see may not make sense. The report will always fall back to your default currency.',
'sum_in_default_currency' => 'The sum will always be in your default currency.',
// charts:
'chart' => 'Chart',

View File

@@ -9,6 +9,11 @@
<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

@@ -13,10 +13,15 @@
<td data-value="{{ account.name }}">
<a href="{{ route('accounts.show',account.id) }}" title="{{ account.name }}">{{ account.name }}</a>
</td>
<td class="hidden-xs" data-value="{{ account.start_balance }}" style="text-align: right;">{{ account.start_balance|formatAmount }}</td>
<td class="hidden-xs" data-value="{{ account.end_balance }}" style="text-align: right;">{{ account.end_balance|formatAmount }}</td>
<td class="hidden-xs" data-value="{{ account.start_balance }}" style="text-align: right;">
{{ formatAmountByCurrency(account.currency, account.start_balance) }}
</td>
<td class="hidden-xs" data-value="{{ account.end_balance }}" style="text-align: right;">
{{ formatAmountByCurrency(account.currency, account.end_balance) }}</td>
<td style="text-align: right;"
data-value="{{ (account.end_balance - account.start_balance) }}">{{ (account.end_balance - account.start_balance)|formatAmount }}</td>
data-value="{{ (account.end_balance - account.start_balance) }}">
{{ formatAmountByCurrency(account.currency, (account.end_balance - account.start_balance)) }}
</td>
</tr>
{% endfor %}
</tbody>
@@ -27,5 +32,10 @@
<td class="hidden-xs" style="text-align: right;">{{ accountReport.end|formatAmount }}</td>
<td style="text-align: right;">{{ accountReport.difference|formatAmount }}</td>
</tr>
{% if accountReport.currencies > 1 %}
<tr>
<td colspan="4"><small class="text-warning">{{ 'multi_currency_report_sum'|_ }}</small></td>
</tr>
{% endif %}
</tfoot>
</table>

View File

@@ -22,14 +22,14 @@
{{ trans('firefly.bill_expected_between', {start: line.getPayDate.formatLocalized(monthAndDayFormat), end: line.getEndOfPayDate.formatLocalized(monthAndDayFormat) }) }}
</small>
</td>
<td class="hidden-xs" data-value="{{ line.getMin }}" style="text-align: right;">{{ line.getMin|formatAmount }}</td>
<td class="hidden-xs" data-value="{{ line.getMax }}" style="text-align: right;">{{ line.getMax|formatAmount }}</td>
<td class="hidden-xs" data-value="{{ line.getMin }}" style="text-align: right;">{{ formatAmountByCurrency(line.getCurrency, line.getMin) }}</td>
<td class="hidden-xs" data-value="{{ line.getMax }}" style="text-align: right;">{{ formatAmountByCurrency(line.getCurrency, line.getMax) }}</td>
{# if bill is hit, show hit amount #}
{% if line.isHit %}
<td data-value="{{ line.getAmount }}" style="text-align: right;">
<a href="{{ route('transactions.show', line.getTransactionJournalId) }}">
{{ line.getAmount|formatAmount }}
{{ formatAmountByCurrency(line.getCurrency, line.getAmount) }}
</a>
</td>
{% endif %}
@@ -42,7 +42,7 @@
{% endif %}
<td data-value="{{ (line.getMax - line.getAmount) }}" style="text-align: right;" class="hidden-xs">
{% if line.isHit %}
{{ (line.getMax + line.getAmount)|formatAmount }}
{{ formatAmountByCurrency(line.getCurrency, (line.getMax + line.getAmount)) }}
{% endif %}
</td>
</tr>

View File

@@ -26,7 +26,11 @@
{% endif %}
</td>
<td data-value="{{ entry.sum }}" style="text-align: right;">
{{ (entry.sum)|formatAmount }}
{% if entry.currencies == 1 %}
{{ formatAmountByCurrency(entry.single_currency, entry.sum) }}
{% else %}
{{ (entry.sum)|formatAmount }}
{% endif %}
</td>
<td class="hidden-xs" data-value="{{ entry.average }}" style="text-align: right;">
{% if entry.count > 1 %}
@@ -54,5 +58,8 @@
<td><em>{{ 'sum'|_ }}</em></td>
<td style="text-align: right;">{{ (sum)|formatAmount }}</td>
</tr>
<tr>
<td colspan="4"><small class="text-warning">{{ 'sum_in_default_currency'|_ }}</small></td>
</tr>
</tfoot>
</table>

View File

@@ -11,4 +11,9 @@
<td>{{ 'difference'|_ }}</td>
<td style="text-align: right;">{{ (incomeSum + expensesSum)|formatAmount }}</td>
</tr>
<tr>
<td colspan="2">
<small class="text-warning">{{ 'sum_in_default_currency'|_ }}</small>
</td>
</tr>
</table>