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

💡 [Feature Request] - Multi-currency Support #816

Open
njmulsqb opened this issue Jan 19, 2024 · 6 comments
Open

💡 [Feature Request] - Multi-currency Support #816

njmulsqb opened this issue Jan 19, 2024 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@njmulsqb
Copy link

Summary

I would love Frappe to have multi-currency support, as I have two accounts one has amount in PKR and other one has in USD;

What problem are you trying to solve?

Freelancers/agencies who earn in USD but have different local currency will be able to maintain both the balances in Frappe.

Basic Example

For example, I have balance in Payoneer that is in USD, but since all my local dealings and bank account balance is in PKR so I have set it to be my default currency. It would be amazing if I could also include my payoneer USD balance in frappe with realtime currency conversion rates to my default currency

Drawbacks

I can't think of any, this is an optional feature and will help online businesses greatly.

Reference Issues

No response

@njmulsqb njmulsqb added the enhancement New feature or request label Jan 19, 2024
@mildred
Copy link
Contributor

mildred commented Jan 19, 2024

I'm wondering how this works with accounting... When you pay taxes in a country, you always declare everything in the currency of that country.

I'm not really an expert at accounting and I don't know the way it should be handled

I see two ways to handle multi currency from a naive point of view:

  • all accounts are expressed in the reference currency: at transaction time, you make a conversion to the reference currency, everything is handled as the reference currency but you can express invoices or payments in foreign currencies. If there is a rate mismatch between the invoice and the payment, I believe there is a way to register this gain or loss in accounting. The foreign currency is only for external documents and you cannot track a bank account expressed in a foreign currency.

  • accounts can be expressed in a currency of your choice: transactions must generally reference accounts that have the same currency but then you must have as many bank accounts as you use different currencies. This means that customers and producers as well as stock items are associated with a given currency. It means you can track in real-time your bank account in foreign currency but then transferring funds between bank accounts needs conversion. Financial reports become non trivial with the need to merge accounts from different currencies under the same name with the need of a conversion rate, and there are probably accounting rules that apply that I don't know of.

  • perhaps simpler, accounts can receive funds from any currency: this means that accounts can have funds in mixed currencies such as your client account could have 10 USD + 20 PKR. Transactions with mixed currencies need to have a conversion rate, and reports needs to apply a conversion rate on the fly. Still, there are perhaps more accounting rules to follow.

edit: from the little of what I know of accounting in France, you need to do accounting in the country currency (first option above). I don't know how to follow that rule if one of the last options is implemented.

@njmulsqb
Copy link
Author

njmulsqb commented Jan 23, 2024

Thank you for detailed response @mildred

What I am looking for is probably the third option you mentioned

* **perhaps simpler, accounts can receive funds from any currency:** this means that accounts can have funds in mixed currencies such as your client account could have 10 USD + 20 PKR. Transactions with mixed currencies need to have a conversion rate, and reports needs to apply a conversion rate on the fly. Still, there are perhaps more accounting rules to follow.

We can do everything in our reference currency i.e. PKR in this case, but we need to have hold of what income/reserves do we have in other accounts. As most of my retained earnings are in USD, I am not able to properly keep track of my profits in Frappe. We can fetch the real-time exchange rates of the currencies from APIs like https://exchangeratesapi.io/ (each user has to feed its own API key in Frappe) or free options like https://github.com/fawazahmed0/currency-api In this way, users with earnings in foreign currency will be able to see it in their reference currency. We can use multiple bank accounts here but just need to create transactional entries in foreign currencies.

This should not be very challenging as it is somewhat similar to https://docs.frappebooks.com/transactions/multi-currency-invoicing.html except that we're fetching the exchange rates on the fly now instead of hard-coded entries by the user.

As for invoices, I can make the purchase invoices in foreign currency as I am going from my reference currency PKR to USD so it happens immediately, e.g. I buy something in USD online, but I cannot do sales invoices in USD because I can't store USD in my balances and I dont immediately convert from USD to PKR so can't specify exchange rate there.

This can be a groundbreaking feature as its being offered by other paid solutions behind big paywalls. Here are some links that you can refer to, to understand their implementation:

  1. https://www.zoho.com/books/kb/banking/multi-currency-bank-account.html
  2. https://help.zoho.com/portal/en/kb/crm/organization-settings/company-settings/articles/multiple-currencies

edit: Just found a similar issue already opened: #183, same feature request submitted by another user 3 years ago -- so now you know which feature needs priority implementation :)

@njmulsqb
Copy link
Author

I have started using GNUCash as it brilliantly handles Multi-currency; reference: https://gnucash.org/docs/v5//C/gnucash-guide/chapter_currency.html

@Isaac-GC Isaac-GC self-assigned this Jan 30, 2024
@mildred
Copy link
Contributor

mildred commented Feb 1, 2024

So, an account could have funds in multiple currencies. Reports could either show the amount in those accounts in all of their currencies or would use a conversion rate (either automatic or manual) to show a unified value.

Under the hood, this probably means that AccountingLedgerEntry would need to have a currency field, and everywhere these are summed, they should be summed per account, but also per currency to then being displayed with the conversion rate.

I see those sums to happen in

  • GeneralLedget.ts
  • but also in bespoke.ts in getTopExpenses(),
  • in AccountReport.ts (_getGroupedByDateRanges())
  • in GeneralLedger.ts in _getTotalsAndSetBalance()
  • in TrialBalance.ts
  • In LedgerPosting.ts there is a sum being made for a single transaction. To ensure validation, each transaction with mixed currencies should have the exchange rate applied fixed in database. Perhaps an optional exchange rate and exchange currency should appear in an AccountingLedgerEntry as extra fields to ensure a single transaction can be expressed as the same currency.

@Isaac-GC
Copy link
Collaborator

Isaac-GC commented Feb 2, 2024

@njmulsqb There already looks to be a similar multi-currency abilities here: https://docs.frappebooks.com/transactions/multi-currency-invoicing.html#multi-currency-invoicing

Not sure if this is what you are looking for?

@KashifAhmed
Copy link

@Isaac-GC, I believe they are seeking a solution that supports multiple currency accounts. Currently, the software only allows for saving in a single currency.

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
Development

No branches or pull requests

4 participants