Display for bills.

This commit is contained in:
James Cole
2024-12-26 11:28:31 +01:00
parent 71cf6c6a5e
commit 286a29ca3e
5 changed files with 127 additions and 96 deletions

View File

@@ -66,7 +66,13 @@
<td>{{ trans('firefly.average_bill_amount_year', {year: year}) }}</td>
<td>
{% for avg in yearAverage %}
{{ formatAmountBySymbol(avg.avg, avg.currency_symbol, avg.currency_decimal_places, true) }}<br>
{{ formatAmountBySymbol(avg.avg, avg.currency_symbol, avg.currency_decimal_places, true) }}
{% if convertToNative %}
({{ formatAmountBySymbol(avg.native_avg,
defaultCurrency.symbol, defaultCurrency.decimal_places, true) }})
{% endif %}
<br>
{% endfor %}
</td>
</tr>
@@ -74,7 +80,12 @@
<td>{{ 'average_bill_amount_overall'|_ }}</td>
<td>
{% for avg in overallAverage %}
{{ formatAmountBySymbol(avg.avg, avg.currency_symbol, avg.currency_decimal_places, true) }}<br>
{{ formatAmountBySymbol(avg.avg, avg.currency_symbol, avg.currency_decimal_places, true) }}
{% if convertToNative %}
({{ formatAmountBySymbol(avg.native_avg,
defaultCurrency.symbol, defaultCurrency.decimal_places, true) }})
{% endif %}
<br>
{% endfor %}
</td>
</tr>
@@ -174,7 +185,7 @@
{% block scripts %}
<script type="text/javascript" nonce="{{ JS_NONCE }}">
var billCurrencySymbol = "{{ object.data.currency.symbol }}";
var billCurrencySymbol = "{{ convertToNative ? defaultCurrency.symbol : object.data.currency.symbol }}";
var billUrl = '{{ route('chart.bill.single', [object.data.id]) }}';
</script>
<script type="text/javascript" src="v1/js/lib/Chart.bundle.min.js?v={{ FF_VERSION }}" nonce="{{ JS_NONCE }}"></script>

View File

@@ -69,7 +69,7 @@
~ {{ 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) }})
(~ {{ formatAmountBySymbol((entry.native_amount_max + entry.native_amount_min)/2, defaultCurrency.symbol, defaultCurrency.decimal_places) }})
{% endif %}
</span>
</td>