feature: Show total balance in family currency in accounts. #2283

Merged
Joelute merged 1 commits from convert-currency into main 2025-05-25 23:54:23 +08:00
Joelute commented 2025-05-23 08:43:37 +08:00 (Migrated from github.com)

For accounts in a different currency from the family currency, show a total balance in the family currency for a better financial overview.

Fixes #2145.

image

For accounts in a different currency from the family currency, show a total balance in the family currency for a better financial overview. Fixes #2145. ![image](https://github.com/user-attachments/assets/2be56be8-9ff6-483a-86db-8ad2b9869394)
Firontiu (Migrated from github.com) approved these changes 2025-05-23 10:14:56 +08:00
Shpigford commented 2025-05-23 18:33:19 +08:00 (Migrated from github.com)

bugbot run

bugbot run
cursor[bot] (Migrated from github.com) reviewed 2025-05-23 18:35:27 +08:00
cursor[bot] (Migrated from github.com) left a comment

Bug: Money Conversion Loses Currency Data

The new line displaying the converted balance calls .amount on the Money object returned by exchange_to, stripping its currency information. The format_money helper, which expects a Money object, receives a raw number instead. This can result in incorrect currency formatting or runtime errors. Remove .amount to pass the Money object directly.

app/views/accounts/show/_chart.html.erb#L20-L23

a5b0c93915/app/views/accounts/show/_chart.html.erb (L20-L23)

Fix in Cursor


Was this report helpful? Give feedback by reacting with 👍 or 👎

<details open> <summary><h3>Bug: Money Conversion Loses Currency Data</h3></summary> The new line displaying the converted balance calls `.amount` on the Money object returned by `exchange_to`, stripping its currency information. The `format_money` helper, which expects a Money object, receives a raw number instead. This can result in incorrect currency formatting or runtime errors. Remove `.amount` to pass the Money object directly. <p></p> <details> <summary><code>app/views/accounts/show/_chart.html.erb#L20-L23</code></summary> https://github.com/maybe-finance/maybe/blob/a5b0c93915a9d173b74a9292ddae0fdb17b8d70d/app/views/accounts/show/_chart.html.erb#L20-L23 </details> <a href="https://cursor.com/open?data=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6ImJ1Z2JvdC12MSJ9.eyJ0eXBlIjoiQlVHQk9UX0ZJWF9JTl9DVVJTT1IiLCJkYXRhIjp7ImJ1ZyI6ImV5SnNiMk5oZEdsdmJuTWlPbH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Y1MjYsImV4cCI6MTc0ODYwMTMyNn0.nDe3qwYHAKhW8Kzpbv5pnpYZKBC_FDDrg5GJcx_PjLBw4VACpw2tcNcBYukY7bRN_E3zVifLixW17t6_BibFnK4gvH8K3vy0xMu5s7spRujSIGP-yTUjY9UR2AGVwbMZ4LRXH1F5xvjWMO0xQleDpm6VUA1nxcvmpbzZJvQf6QLbj39WXHRZWSWn9NMjk_beXvdrtHYVoCB077KcnnbBPxCNupt5inZAp3jdb3ziYpmcmC0v6xsTDwumrkZLSODvwpM6KpV2ecqcyW2wUn1k-oqOegcGT9yui5ZmeKxJF_ikL25cc1VsR2Tj5_AN3UjjJH_haeeGqqnhQgV97yThZw">Fix in Cursor</a> </details> --- _Was this report helpful? Give feedback by reacting with 👍 or 👎_
zachgoll commented 2025-05-23 18:51:33 +08:00 (Migrated from github.com)

@Joelute we can accept this change, but I think we may have a few little design tweaks to make with where we're placing it. Also, see the bugbot report as I think I agree with its analysis. We should be passing the money object directly to format_money.

Let me see if we can get a Figma file for this.

@Joelute we can accept this change, but I think we may have a few little design tweaks to make with where we're placing it. Also, see the bugbot report as I think I agree with its analysis. We should be passing the money object directly to format_money. Let me see if we can get a Figma file for this.
Joelute commented 2025-05-25 08:16:11 +08:00 (Migrated from github.com)

Hey @zachgoll, just implemented the changes to follow the Figma file. Looks better now with the new design, thank you! I also passed the Money object to format_money.

Hey @zachgoll, just implemented the changes to follow the Figma file. Looks better now with the new design, thank you! I also passed the Money object to `format_money`.
Firontiu (Migrated from github.com) reviewed 2025-05-27 05:13:14 +08:00
Firontiu (Migrated from github.com) left a comment

Finish

Finish
Sign in to join this conversation.