From e1b81ef879d21658dab0766bc7cc10bb06519ce6 Mon Sep 17 00:00:00 2001 From: Joseph Ho Date: Sun, 25 May 2025 11:54:22 -0400 Subject: [PATCH] feature: Show total balance in family currency in accounts (#2283) --- app/views/accounts/show/_chart.html.erb | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/app/views/accounts/show/_chart.html.erb b/app/views/accounts/show/_chart.html.erb index 57c57a4a..bf23efd2 100644 --- a/app/views/accounts/show/_chart.html.erb +++ b/app/views/accounts/show/_chart.html.erb @@ -13,12 +13,16 @@ <%= render "investments/value_tooltip", balance: account.balance_money, holdings: account.balance_money - account.cash_balance_money, cash: account.cash_balance_money %> <% end %> - - <% if account.syncing? %> -
- <% else %> - <%= tag.p format_money(account.balance_money), class: "text-primary text-3xl font-medium truncate" %> - <% end %> +
+ <% if account.syncing? %> +
+ <% else %> + <%= tag.p format_money(account.balance_money), class: "text-primary text-3xl font-medium truncate" %> + <% if account.currency != Current.family.currency %> + <%= tag.p format_money(account.balance_money.exchange_to(Current.family.currency, fallback_rate: 1)), class: "text-sm font-medium text-secondary" %> + <% end %> + <% end %> +
<%= form_with url: request.path, method: :get, data: { controller: "auto-submit-form" } do |form| %>