mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-05 21:45:23 +02:00
Multi-currency support (#425)
* Initial foundational pass at multi-currency * Default format currency * More work on currency and exchanging * Re-build currencies on change * Currency import/setup * Background job overhaul + cheaper OXR plan support * Lint fixes * Test fixes * Multi-currency setup instructions * Allow decimals in the balance field * Spacing fix for form --------- Signed-off-by: Josh Pigford <josh@joshpigford.com>
This commit is contained in:
parent
94f7b4ea8f
commit
aa351ae616
41 changed files with 634 additions and 176 deletions
|
@ -2,13 +2,13 @@
|
|||
|
||||
<% accounts = Current.family.accounts.where(accountable_type: type.name) %>
|
||||
|
||||
<% if accounts.sum(&:balance) > 0 %>
|
||||
<% if accounts.sum(&:converted_balance) > 0 %>
|
||||
<details class="mb-1 text-sm group">
|
||||
<summary class="flex gap-4 px-2 py-3 items-center w-full rounded-[10px] font-medium hover:bg-[#f2f2f2]">
|
||||
<%= lucide_icon("chevron-down", class: "hidden group-open:block text-[#737373] w-5 h-5") %>
|
||||
<%= lucide_icon("chevron-right", class: "group-open:hidden text-[#737373] w-5 h-5") %>
|
||||
<div class="text-left"><%= type.model_name.human %></div>
|
||||
<div class="ml-auto"><%= humanized_money_with_symbol accounts.sum(&:balance) %></div>
|
||||
<div class="ml-auto"><%= format_currency accounts.sum(&:converted_balance) %></div>
|
||||
</summary>
|
||||
|
||||
<% accounts.each do |account| %>
|
||||
|
@ -19,7 +19,7 @@
|
|||
<p class="text-xs text-[#737373]"><%= account.subtype&.humanize %></p>
|
||||
<% end %>
|
||||
</div>
|
||||
<p class="ml-auto font-medium"><%= humanized_money_with_symbol account.balance %></p>
|
||||
<p class="ml-auto font-medium"><%= format_currency account.converted_balance %></p>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue