Open rmagon opened 4 years ago
@rmagon ok, so this is how I see this in near future:
everywhere in UI where we display amount of money, we should add the currency code, e.g. on your first screenshot where we have the "Value" column we should display "5 BGN", "$5", etc. (same as on the second screenshot with dashboard we already display values with BGN). Same, everywhere in DB, we store Value and also currency code for it. So we prepared to use currency conversions in the future with minimum (no) changes in how we store data and how we display it.
at the same time, we do NOT want for now to mess up with exchange rates (currency conversion) in all the system for now. It's complex. So we will allow users to enter values for income/expenses only in the currency selected for the company (we can call it "default" currency). So say for "Company A", the currency can be "USD" and all inputs and outputs will be in USD currency. For "Company B" it can be currency "BGN" used everywhere, etc.
in all input boxes for income/expenses, we currently should have a dropdown that allows selecting currency (with default value equal to what selected for the company). For now, let's just make sure such dropdowns are "read-only" (we still need all current logic/code, just let's not allow the user to change the currency for now so we don't need to use currency conversion).
At later stages, we can use a DB table with currency exchange rates (per day, between currency A and B) which will be used to do conversions between entered values in one currency to the currency which is the default for the company. Such exchange rates can be loaded from different APIs (mostly paid APIs), e.g.:
Sounds good!
@rmagon yes, so basically we need to go over all pages/components and make sure currencies used according to the description in this ticket.
Currency drop downs made read-only and it will default to the organization currency in create-mode in the following places:
Added currency to the following tables:
@evereq Now that all currency dropdowns default to the organization currency and have been disabled .. should we close this ticket or keep it open for future (part 2)?
@rmagon let's keep for the future :) We will soon address it again for part 2 :)
Since we are allowing multiple currencies, wherever we are adding, subtracting any currency value, I am a little confused on how will we handle that?
For example: Let's say we have two Income: 5BGN and 5USD, like the screenshot below:
Now, if we check the dashboard, it will show 10BGN as the total income, which is wrong.
We'll need to decide how to handle any addition/subtraction when we have multiple currencies.
Suggestions: