afadil / wealthfolio

A Beautiful Private and Secure Desktop Investment Tracking Application
https://wealthfolio.app
GNU Affero General Public License v3.0
4.39k stars 228 forks source link

Issues with accounts in other currencies #106

Closed maelp closed 1 month ago

maelp commented 2 months ago

My settings are in EUR, but when you check quotes you use dollars, but this is all mixed up in the interface, so when I go to my holdings, I see the correct price in DOLLARS and the correct value in DOLLARS... but then in the main interface (summary of all my holdings) the DOLLAR AMOUNT is used but with a EURO sign instead of DOLLAR... so it shows a supposed euro value which is actually the number of dollars and not euros...

I guess perhaps the easiest would be to convert EVERYTHING to dollars, and only when visualizing to show EUR?

maelp commented 2 months ago

This seems to be the code : https://github.com/afadil/wealthfolio/blob/main/src/pages/holdings/components/holdings-table.tsx#L138

For me it shows the currency as "eur" but the corresponding displayed amount is the dollar value, not the EUR value

Not sure where the bug is... when I go to the corresponding holding page, it shows the right share price (in USD with the correct USD amount), the correct number of shares, and the correct total value (as dollars), but when I go on the table with the list of holdings, the currencies / values are mixed up

afadil commented 2 months ago

What is your base currency in settings ?

maelp commented 2 months ago

Euros

-- Maël Primet

On 13 September 2024 at 13:46:36, Aziz FADIL @.***) wrote:

What is your base currency in settings ?

— Reply to this email directly, view it on GitHub https://github.com/afadil/wealthfolio/issues/106#issuecomment-2348763754, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAADYYV75PAI3FI7CQQFYT3ZWLGBZAVCNFSM6AAAAABOFBJPQGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNBYG43DGNZVGQ . You are receiving this because you authored the thread.Message ID: @.***>

maelp commented 2 months ago

Have you managed to make progress on this? I still have the issue...

afadil commented 2 months ago

@maelp Can you please check if this issues is fixed in v1.0.14

maelp commented 2 months ago

Issue is still there, when I go in holdings and click on a line I get something in USD (with correct USD prices) like

image

and then when I go back to the view with all my lines I get the exact same number, but wrongly displayed in EUR instead of USD (or equivalently: should be a different number, but displayed in EUR)

image
afadil commented 2 months ago

Can you please check what currencies do you have now in Settings->Exchange Rates?

maelp commented 2 months ago

@afadil it's empty

image
afadil commented 2 months ago

@maelp Can you please try now with latest version 1.0.16. Thanks

maelp commented 2 months ago

Still the same issue unfortunately, I tried to also switch back to USD in my general settings, then reload the app, but it didn't change anything (even if in my settings I use "dollars" for global currency it shows the individual holdings in EUR in the "table view" with all the holdings, and in USD in the "individual view" when clicking on one particular holding)

I reverted back to EUR for global currency but it didn't change anything either (still the wrong numbers)

Can this come from the fact that I set my individual accounts to be in EUR? (which is the case)

maelp commented 2 months ago

If there's anyway I can help? Perhaps you can tell me what methods I should debug

afadil commented 1 month ago

Can you please provide with you holding symbol. Actually there 3 currencies in play:

maelp commented 1 month ago

Base currency: EUR

image

Account currency: EUR

image

Stock currency: no idea how this is set? stock is this, so I guess dollars?

image image
maelp commented 1 month ago

Here's for instance an example of error when I print it in holdings-table.tsx

image image

(rectangles in the same color means exact same value)

And when I log the same asset in the asset-profile-page.tsx

image image
maelp commented 1 month ago

The asset seems to be in currency: USD marketPrice: 338, which seems to match what I'm seeing on my bank dashboard, so that's the correct USD price

But on the holdings-table.tsx page the marketPrice is still the same, but now the currency is EUR (display currency) although I assume we should have a marketPriceConverted somewhere?

also the bookValue and bookValueConverted are the same (as though they are both in euros, so that Wealthfolio is assuming that the asset is in EUR and converting to display=EUR)

maelp commented 1 month ago

To summariez: display currency = EUR, account ccurency = EUR, asset currency = USD

But when displaying the holding value, it shows them in EUR, but acts as though the asset currency was already EUR, and does not convert the price from orig "USD 338" to "EUR 306" or something like this before, so it shows the wrong value

afadil commented 1 month ago

I tested a simple scenario and seems ok for me:

maelp commented 1 month ago

hmm weird, but when you are going in the holdings page with all the holdings, and then the individual holding asset page, what does it show?

Perhaps it's because I created my values with an old version of WealthFolio and I should recreate it with a new version? But I guess the setup is similar to yours, except for me the conversion to dollars is not done properly

maelp commented 1 month ago

As you can see in the screenshots above, when I print out the holdings value, the marketPrice and marketPriceConverted are the same... although the marketPrice is the values which corresponds to the USD price of EQAC.SW, but the marketPriceConverted is supposed to be in euros... and the conversion wasn't done

373578150-fadeeafb-8f88-4be3-87e8-128da7e116eb

is there a way I can help you debug?

maelp commented 1 month ago

Is your account set in EUR or in USD ? I set my account in EUR because most of the values and the deposits are in EUR, but perhaps the EQAC.SW is in USD and this causes issues?

maelp commented 1 month ago

Also weirdly, when I change my "base currency" in the settings, it just change the symbol (eg EUR or USD) in the main dashboard page with the summary of my holdings, but NOT the values

eg

if I set the base currency to EUR it shows

account 1 : XXXX EUR account 2: YYYY EUR

and then I set the base currency to USD and it shows

account 1 : XXXX USD account 2 : YYYY USD

(eg the exact same numbers)

maelp commented 1 month ago

Seems that removing the transactions and re-adding them with the new version solves the issue