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

Ability to select different currency for each transaction #53

Open
vladartym opened this issue Jan 19, 2024 · 9 comments
Open

Ability to select different currency for each transaction #53

vladartym opened this issue Jan 19, 2024 · 9 comments
Labels
enhancement New feature or request

Comments

@vladartym
Copy link

vladartym commented Jan 19, 2024

FEATURE REQUEST: Ability to select different currency for each transaction, similar to splitwise. And choose the currency for reimbursment

@scastiel scastiel changed the title FEATURE REQUEST: Ability to select different currency for each transaction, similar to splitwise. And choose the currency for reimbursment Ability to select different currency for each transaction Jan 20, 2024
@scastiel scastiel added the enhancement New feature or request label Jan 20, 2024
@scastiel
Copy link
Member

Interesting suggestion! So that would mean:

  • defining a main currency for the group (among known currencies we are able to convert)
  • selecting the currency for each expense (defaulting to the group one)
  • calculating the converted amount for each expense (maybe storing it in the expense as well), ideally with the rate at the date of the expense, but maybe easier with the rate at the time the expense is entered.

We’d need to call an API to get conversion rates between currencies. Any API suggestion (cheap, or even better, free) is appreciated. Note that there wouldn’t be that many API calls, if we cache the conversion rates properly.

@vladartym
Copy link
Author

We’d need to call an API to get conversion rates between currencies. Any API suggestion (cheap, or even better, free) is appreciated. Note that there wouldn’t be that many API calls, if we cache the conversion rates properly.

Yep! Everything you mentioned is spot on! I just stumbled upon this guy: https://github.com/hakanensari/frankfurter
Gets updated everyday, I dont think we need anything more than that. https://api.frankfurter.app/latest

We can also get currency conversions based on the date of the transaction e.g. https://api.frankfurter.app/2019-01-04

@mertd
Copy link
Contributor

mertd commented Jan 25, 2024

What do you think about displaying the rate in an input? Allowing to overwrite the live rate may make the app more resilient to service interruptions of the currency API (see the recent issue at ihatemoney).

@vladartym
Copy link
Author

What do you think about displaying the rate in an input? Allowing to overwrite the live rate may make the app more resilient to service interruptions of the currency API (see the recent issue at ihatemoney).

Great idea!!

@dmlls
Copy link

dmlls commented Jan 29, 2024

We’d need to call an API to get conversion rates between currencies. Any API suggestion (cheap, or even better, free) is appreciated.

Might be worth taking a look at https://github.com/sal0max/currencies#features for further options and perhaps implementation details.

@scastiel
Copy link
Member

scastiel commented Jan 30, 2024

A few thoughts about implementation:

  • About getting rates: it’s pretty easy to call an API when needed (Frankfurter seems to be a great candidate) and cache the result to avoid too many API calls
  • About the storage: each expense should store 1- the actual amount and expense currency, 2- the used conversion rate, 3- the converted amount in the group’s currency. Maybe it would be interesting to be able to customize the rate when creating/updating an expense.
  • About display: the displayed amount should be with the expense’s currency (with converted amount but less visible or as a tooltip), but balances should be with the group’s currency
  • About the group’s currency: for backward compatibility, it should still be possible to use a custom currency symbol, additionally to an actual currency. The actual currency can be undefined (default value) but in this case the conversion won’t be available (on the expense form, we can tell the user that to access currency feature, they must first select a currency for the group).

@ashaw93
Copy link

ashaw93 commented Feb 17, 2024

Just to chime in, maybe instead of doing the conversion, if there are outstanding balances in other currencies, show them as another section in the balance tab. That way you can keep adding custom currencies and not have to deal with exchanges.

image

Although this can still go in hand with exchanging currencies :)

@Big-Hammer
Copy link

I have a use case for this - I do a few classic car trips with a crew of 2 or 2 people. We often travel around Europe and incur costs in GBP, EUR and other currencies. Converting to GBP at the time of the expense with one call to the conversion service would be good - after all, we're not dealing in huge sums and we only ever settle up in our 'base' currency having incurred the costs many days or even weeks before, often in cash exchanged in the distant past (i.e. no-one's really tracking gentle fluctuations). This is probably the most time consuming element of settling up as in the past I've just sat there and manually converted it all with a nominal 'average' rate.

@NotWoods
Copy link

It would be better to just store the amount and currency in the database, then look up the historical exchange rate and calculate the converted amount later. (Other apps just look at the current exchange rate and calculate all at once.) If you want to support offline mode later the app shouldn't rely on an external API to write to the database.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

7 participants