0. Introductions
when the document currency and the local currency are different , we need to convert the foreign amount to the local amount. We usually use these funcitons
· READ_EXCHANGE_RATE
· CONVERT_TO_LOCAL_CURRENCY or CONVERT_TO_LOCAL_CURRENCY_N
Anyway, when we call these functions. We have something to attention.
1 If there is no exchange rate entried in the date we input. funciton will find the latest exchange rate according the import conditions. So these function can not deem is the exchange date existed in the input date
2
Before calculate the exchange rate. The foreign amount has already been calculated with its currency factor.
Ex: we found the amount “JPY
100.00”
from database. In actually, the real amount is JPY 10,000. because the currency factor of JPY is 100.
3
hese functions will export 2 factors with currencu unit
These 2 factors is different from the factor with currency.
If we set the exchange ratio(from) and ratio(to) in the SPRO. Like this: 100 JPY to 1 USD. It means the value of exchange rate is using 100 jpy to change 1 usd.
EX: if we set 100 * JPY = 0.7795 USD * 1 … 1 JPY is 0.007795 for 1 usd.
So, we calculate the foreign amount only using exchange rate. Maybe is not the right result we want.
The right fomula is :
foreign amount * currency factor (foreign) * ( exchange rate / currency unit factor (foreign) *
currency unit factor (local)) / currency factor (local) = local amount
ps. The return LOCAL_AMOUNT when called the CONVERT_TO_LOCAL_CURRENCY. Also need to calculate with the factor of currency units. Local amount = local amount / foreign factor * local factor