Hello
I have on report and i want to get:
Depending the currency you pay, the receipt needs to do fill 3 differents fields with the total amount each one with the correct currency amount.
Ex.:
Pay in EUR:
Amount EUR = Amount
Amount USD = Amount * USD Currency Exchange Rate
Amount MZM = Amount * MZM Currency Exchange Rate
Pay in USD:
Amount USD = Amount
Amount EUR = Amount / USD Currency Exchange Rate
Amount MZM = Amount * MZM Currency Exchange Rate
Pay in MZM:
Amount MZM = Amount
Amount EUR = Amount / EUR Currency Exchange Rate
Amount USD = Amount / MZM Currency Exchange Rate
Can you help me building this code with all conditions?
Thanks.
0
Comments
The trick here is to always use the local currency amount as the base for your calculations.
Then create 2 decimal variables that will represent the converted amount in the alternate currencies.
When you calculate the alternate currency amounts, be sure to use the currency exchange rate that was in effect on the posting date of the transaction. If you do not go back to retrieve the correct currency exchange rate, you will have different results each time.
I am not going to provide the code, but I will help you in the right direction so you will be able to solve this issue yourself.
Hope this helps,
Regards,
Willy
Thanks, i created the code with all the conditions, using the posting date.
works fine.