spliit-app / spliit

Free and Open Source Alternative to Splitwise. Share expenses with your friends and family.
https://spliit.app
MIT License
642 stars 111 forks source link

Ability to select different currency for each transaction #53

Open vladartym opened 5 months ago

vladartym commented 5 months ago

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

scastiel commented 5 months ago

Interesting suggestion! So that would mean:

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 commented 5 months ago

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 commented 5 months ago

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 commented 5 months ago

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 commented 5 months ago

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 commented 5 months ago

A few thoughts about implementation:

ashaw93 commented 4 months ago

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 commented 4 months ago

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 commented 3 months ago

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.

J0B10 commented 5 days ago

Has there been any progress on currency support? I'm planning an USA-Trip with a couple of friends and we will have to mange expenses in both $ and €, so this would be a killer feature 😅.