Create 3 total amount fields with different currencies

r-p
Member Posts: 33
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.
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
-
Hi,
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,
WillyFostering a homeless, abused child is the hardest yet most rewarding thing I have ever done.0 -
KYDutchie wrote:Hi,
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.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions