multi currency account
See original GitHub issueIf you were to implement a multi-currency version of Medici, how would you do it?
I guess
.debit('Assets:Cash', 1000, {meta})
would need another parameters, ie: .debit('Assets:Cash', 1000, {meta}, "USD")
A transaction would still equal out with multiple currencies. ie Alice sending 10 USD for 12 EUR to Bob:
.credit('Alice', 10, {}, 'USD')
.debit('Bob", 10, {}, USD')
.debit('Alice', 12, {}, 'EUR')
.credit('Alice, 12, {}, 'EUR')
Now the issue would be that, if we try to fetch a balance like this, we will have currency co-mingled.
ie:
const balance = await myBook.balance({
account: "Assets:Accounts Receivable",
client: "Joe Blow"
});
So we would need to have a mandatory currency field here. And filter that out.
I’m wondering what the most efficient way to do it would be?
Simply adding a currency field in transaction, and modifying the balance function? Any other idea?
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (7 by maintainers)
Top Results From Across the Web
Multicurrency Account: What Is It And How Does It Work?
A multicurrency account is a type of demand deposit account that allows you to send, hold and receive various currencies in one place....
Read more >Multicurrency Account: What Is It and How Does It Work?
A multicurrency account is typically an account at a bank or financial tech firm that lets you spend, receive and hold multiple currencies....
Read more >Multi Currency Account - Wise
Meet the Wise multi-currency account. ... Holding multiple currencies is completely free, and we use the real exchange rate to convert. See all...
Read more >What Is A Multicurrency Account? - Bankrate
A multicurrency account, sometimes called a foreign currency account, allows consumers and businesses to hold different currencies in one ...
Read more >Multicurrency Bank Accounts | Foreign Currency - HSBC Expat
Bank multiple currencies around the world with a HSBC Expat offshore account. Save in 19 currencies and manage your foreign exchange needs with...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I have currently being using
with no issue so far. as long as every balance() call includes currency the balance seems correctly fetch with the currency flag.
closing this for now.
Just proposed a PR to remove what I believe is not correct in the README