From 55f899608db644afd1162c10b7e9f0d58f47cfc9 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sat, 9 Aug 2025 15:33:03 +0200 Subject: [PATCH] Add multi currency to piggy overview. --- resources/views/list/piggy-banks.twig | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/resources/views/list/piggy-banks.twig b/resources/views/list/piggy-banks.twig index 961d6fcbd9..01dd93ec6e 100644 --- a/resources/views/list/piggy-banks.twig +++ b/resources/views/list/piggy-banks.twig @@ -46,8 +46,12 @@ {% endif %} - {{ formatAmountBySymbol(piggy.current_amount,piggy.currency_symbol,piggy.currency_decimal_places) }} + + {{ formatAmountBySymbol(piggy.current_amount,piggy.currency_symbol,piggy.currency_decimal_places) }} + {% if convertToPrimary and piggy.currency_id != primaryCurrency.id and null != piggy.pc_current_amount %} + ({{ formatAmountBySymbol(piggy.pc_current_amount,primaryCurrency.symbol,primaryCurrency.decimal_places) }}) + {% endif %} + {% if piggy.current_amount > 0 %} @@ -86,16 +90,25 @@ {% if null != piggy.target_amount and 0 != piggy.target_amount %} {{ formatAmountBySymbol(piggy.target_amount,piggy.currency_symbol,piggy.currency_decimal_places) }} + {% if convertToPrimary and piggy.currency_id != primaryCurrency.id and null != piggy.pc_target_amount %} + ({{ formatAmountBySymbol(piggy.pc_target_amount,primaryCurrency.symbol, primaryCurrency.decimal_places) }}) + {% endif %} {% endif %} {% if piggy.left_to_save > 0 %} {{ formatAmountBySymbol(piggy.left_to_save,piggy.currency_symbol,piggy.currency_decimal_places) }} + {% if convertToPrimary and piggy.currency_id != primaryCurrency.id and null != piggy.pc_left_to_save %} + ({{ formatAmountBySymbol(piggy.pc_left_to_save, primaryCurrency.symbol,primaryCurrency.decimal_places) }}) + {% endif %} {% endif %} {% if piggy.target_date and piggy.save_per_month %} {{ formatAmountBySymbol(piggy.save_per_month, piggy.currency_symbol, piggy.currency_decimal_places) }} + {% if convertToPrimary and piggy.currency_id != primaryCurrency.id and null != piggy.pc_save_per_month %} + ({{ formatAmountBySymbol(piggy.pc_save_per_month, primaryCurrency.symbol, primaryCurrency.decimal_places) }}) + {% endif %} {% endif %}