Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Currency: switching back to "no currency" gives unexpected results #599

Closed
zorun opened this issue Apr 30, 2020 · 5 comments · Fixed by #661
Closed

Currency: switching back to "no currency" gives unexpected results #599

zorun opened this issue Apr 30, 2020 · 5 comments · Fixed by #661
Labels
Milestone

Comments

@zorun
Copy link
Collaborator

zorun commented Apr 30, 2020

When using a default currency in a project, it is possible to add bills in various currencies and they will be converted to the default currency.

However, switching back to "No currency" in the options gives unexpected results:

  • new bills are added without currencies (this is expected)
  • existing bills keep their currency (this is expected)
  • however, the converted amounts still reflect the previous default currency!

This is really weird: for existing bills that had a currency, "How much?" and "Amount" may show different values, without any way to know the currency in which "Amount" is displayed. In addition, if changing again to a new default currency, bills with no currency will be converted to the new default currency while they were probably intended as the old default currency. In short: it's a mess.

I see no easy way to fix this in the general case. I think the simplest way is to disallow switching back to "No currency".

An alternative solution (but more complicated) is to allow switching back to "No currency" only if all bills are in the same currency, and remove the currency from all bills.

@zorun
Copy link
Collaborator Author

zorun commented Apr 30, 2020

Here is an extreme example:

  • set default currency to JPY
  • add bills in EUR and GBP
  • switch back to "No currency"
  • add a new bill (without currency)

The result is shown below:

ihm-no-currency

For the bills in EUR and GBP, the "Amount" column is still in JPY but this is not shown anywhere. For the new bill without currency, it only makes sense to interpret it as JPY because otherwise it's inconsistent with other bills.

Then I switch the default currency to PLN:

ihm-no-currency-2

The bill with no currency has been converted to PLN.

@indatwood indatwood added the bug label Apr 30, 2020
@MagicFab
Copy link

MagicFab commented May 3, 2020

Where do you see default currency ? I don't see this in the web interface.

@zorun
Copy link
Collaborator Author

zorun commented May 24, 2020

@MagicFab the default currency can be changed in the project settings

Obviously, you need a recent version of i hate money, currency support was added only recently.

@zorun zorun added this to the v5 milestone Jul 17, 2020
@Glandos
Copy link
Member

Glandos commented Jul 26, 2020

A third solution would be to convert everything to the same currency before switching to "No currency", and drop all of them.

But honestly, it would much simpler to check all bills currency, and disable "No currency" in the dropdown menu if some of them are different. We could add a small explanation.

@Glandos
Copy link
Member

Glandos commented Jul 26, 2020

But, I have to add that the current behavior is weird anyway. Switching back to "No currency" should remove currencies, and not keep the old ones "just in case".

Glandos added a commit that referenced this issue Jul 26, 2020
Glandos added a commit that referenced this issue Jul 26, 2020
Fixes #599

Be careful, when switching to no currency, all bills are first converted
to the last known currency, and currency is erased
Glandos added a commit that referenced this issue Aug 5, 2020
Glandos added a commit that referenced this issue Aug 5, 2020
Fixes #599

Be careful, when switching to no currency, all bills are first converted
to the last known currency, and currency is erased
Glandos added a commit that referenced this issue Jun 22, 2021
Glandos added a commit that referenced this issue Jun 22, 2021
Fixes #599

Be careful, when switching to no currency, all bills are first converted
to the last known currency, and currency is erased
Glandos added a commit that referenced this issue Jun 22, 2021
Glandos added a commit that referenced this issue Jun 22, 2021
Fixes #599

Be careful, when switching to no currency, all bills are first converted
to the last known currency, and currency is erased
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants