1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-08-08 23:15:24 +02:00

Multi-currency support: Money + Currency class improvements (#553)

* Money improvements

* Replace all old money usage
This commit is contained in:
Zach Gollwitzer 2024-03-18 11:21:00 -04:00 committed by GitHub
parent e5750d1a13
commit fe2fa0eac1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
43 changed files with 2982 additions and 196 deletions

View file

@ -1,5 +1,5 @@
<%= turbo_stream_from @account %>
<% balance = Money.from_amount(@account.balance, @account.currency) %>
<% balance = Money.new(@account.balance, @account.currency) %>
<div class="space-y-4">
<div class="flex justify-between items-center">
<div class="flex items-center gap-3">
@ -11,7 +11,7 @@
<div class="flex items-center gap-3">
<div class="relative cursor-not-allowed">
<div class="flex items-center gap-2 px-3 py-2">
<span class="text-gray-900"><%= balance.currency %> <%= balance.symbol %></span>
<span class="text-gray-900"><%= balance.currency.iso_code %> <%= balance.currency.symbol %></span>
<%= lucide_icon("chevron-down", class: "w-5 h-5 text-gray-500") %>
</div>
</div>
@ -29,7 +29,7 @@
<%= render partial: "shared/balance_heading", locals: {
label: "Total Value",
period: @period,
balance: Money.from_amount(@account.balance, @account.currency),
balance: @account.balance_money,
trend: @balance_series.trend
}
%>