Update various pages, clean up some code.

This commit is contained in:
James Cole
2024-12-26 09:16:17 +01:00
parent d313f5fdf5
commit 06049a9a28
8 changed files with 58 additions and 56 deletions

View File

@@ -27,7 +27,15 @@
<table class="table table-striped">
<tr>
<td colspan="2">
{{ trans('firefly.match_between_amounts', {low: formatAmountByCurrency(object.data.currency,object.data.amount_min), high: formatAmountByCurrency(object.data.currency,object.data.amount_max) })|raw }}
{% set lowAmount = formatAmountByCurrency(object.data.currency,object.data.amount_min) %}
{% set highAmount = formatAmountByCurrency(object.data.currency,object.data.amount_max) %}
{% if(0 != object.data.native_amount_min) %}
{% set lowAmount = lowAmount ~ ' (' ~ formatAmountByCode(object.data.native_amount_min, defaultCurrency.code) ~ ')' %}
{% endif %}
{% if(0 != object.data.native_amount_max) %}
{% set highAmount = highAmount ~ ' (' ~ formatAmountByCode(object.data.native_amount_max, defaultCurrency.code) ~ ')' %}
{% endif %}
{{ trans('firefly.match_between_amounts', {low: lowAmount, high: highAmount })|raw }}
{{ 'repeats'|_ }}
{{ trans('firefly.repeat_freq_' ~object.data.repeat_freq) }}.
</td>

View File

@@ -67,6 +67,10 @@
title="{{ formatAmountBySymbol(entry.amount_min, entry.currency_symbol, entry.currency_decimal_places, false)|escape }} -- {{ formatAmountBySymbol(entry.amount_max, entry.currency_symbol, entry.currency_decimal_places, false)|escape }}"
>
~ {{ formatAmountBySymbol((entry.amount_max + entry.amount_min)/2, entry.currency_symbol, entry.currency_decimal_places) }}
{% if '0' != entry.native_amount_max %}
({{ formatAmountBySymbol((entry.native_amount_max + entry.native_amount_min)/2, defaultCurrency.symbol, defaultCurrency.decimal_places) }})
{% endif %}
</span>
</td>