Shared Currencies And Exchange Rates For Microsoft Dynamics AX 2012

1y ago
28 Views
2 Downloads
556.58 KB
16 Pages
Last View : 2d ago
Last Download : 3m ago
Upload by : Shaun Edmunds
Transcription

Microsoft Dynamics AX 2012 Shared Currencies andExchange Rates for MicrosoftDynamics AX 2012White PaperThis document highlights the key concepts and APIs related tothe calculation, display, and storage of currency and exchangerate information.http://microsoft.com/dynamics/axDate: April 2011Author: Paul Winje, Senior Development LeadSend suggestions and comments about this document toadocs@microsoft.com. Please include the title with yourfeedback.1

Table of ContentsOverview. 3Audience. 3Terminology . 3Currency calculations . 4Working with currency calculations. 4Calculate the accounting currency amount from a transaction currency . 4Calculate the transaction currency amount from an accounting currency. 5Calculate using exchange rates that have been provided . 5Calculate by overriding the default exchange rate type from the ledger . 6Calculate outside the context of a ledger. . 6Upgrading legacy currency calculation calls . 7Exchange rates . 9Retrieving exchange rates . 9Retrieve the exchange rates between a transaction currency and the accounting currency . 9Retrieve the exchange rates between a transaction currency and the accounting currency usingstatic methods. 10Retrieve exchange rates outside the context of a ledger . 10Storing and displaying exchange rates .11Display a stored exchange rate . 11Store an exchange rate entered by a user. 12Determine whether an exchange rate should be enabled on a form . 12Upgrading old exchange rate calls .12Data model. 14Data upgrade .142SHARED CURRENCIES AND EXCHANGE RATES FOR MICROSOFT DYNAMICS AX 2012

OverviewIn Microsoft Dynamics AX 2012, the currency and exchange rate framework has been enhanced toshare information across multiple legal entities. As part of this work, the data model has beenredesigned, the calculation engine has been rewritten, and the APIs have been updated. Thisdocument highlights the key concepts and APIs related to the calculation, display, and storage ofcurrency and exchange rate information, and illustrates the appropriate patterns to use in applicationcode.AudienceThis white paper targets developers who are building new applications for Microsoft Dynamics AX 2012and developers who are updating their existing application code and data.TerminologyMicrosoft Dynamics AX 2012 terms:TermDefinitionExchange rateThe value of one currency expressed in terms of another on a particulardate.Currency pairThe two currencies used in an exchange rate quotation.Exchange rate typeA grouping that allows users to set up different exchange rates for acurrency pair. Examples include Buy, Sell, Spot, and Budget.LedgerThe part of an accounting system that is used for classifying themonetary value of economic transactions by using a chart of accounts, afiscal calendar, and one or more currencies. A ledger has a one-to-onerelationship with a legal entity. Transactions are performed in the contextof a ledger that provides key pieces of information, such as accountingcurrency, reporting currency, default exchange rate type, fiscal calendar,and the chart of accounts.Transaction currencyThe currency in which a transaction originates.Accounting currencyThe primary currency in which a legal entity maintains its financialrecords. The accounting currency is stored in the Ledger table.Reporting currencyThe reporting currency of the ledger. The reporting currency is stored inthe Ledger table. It is optional.Default exchange rate typeAn exchange rate type stored in the Ledger table that is used to specifywhich set of exchange rates should be used for the Ledger.3SHARED CURRENCIES AND EXCHANGE RATES FOR MICROSOFT DYNAMICS AX 2012

Currency calculationsFour pieces of information are necessary to perform a currency calculation in Microsoft Dynamics AX2012: From currencyTo currencyDateExchange rate typeWhen performing a calculation in the context of a given legal entity, the exchange rate type and oneof the currencies can be derived from the ledger that is associated with that legal entity. For example,assume that an accounting currency of USD and an exchange rate type of SELL have been set up for agiven ledger. When that ledger is passed to the calculation engine and thecalculateTransactionToAccounting method is called, the calculation engine is able to automaticallydetermine that the accounting currency is USD and the exchange rate type is SELL.In most cases, calculations will be performed in the context of a given ledger. When performing acalculation outside of the context of a ledger, it is still possible to provide all of the necessaryinformation via parm methods on the calculation engine.Working with currency calculationsThe CurrencyExchangeHelper class was added in Microsoft Dynamics AX 2012 and is therecommended API to perform calculations between currencies. The following examples illustrate itsusage for the most common scenarios.Calculate the accounting currency amount from a transaction currencyThis example calculates the amount in the context of the current ledger. This is indicated by passingLedger::current() to the constructor method of the CurrencyExchangeHelper class.CurrencyExchangeHelper currencyExchangeHelper;TransDate transactionDate;CurrencyCode transactionCurrency 'CAD';AmountCur amountToConvert 100.50;boolean shouldRoundResult true;AmountMst result;currencyExchangeHelper rrent(),transactionDate);result undResult);4SHARED CURRENCIES AND EXCHANGE RATES FOR MICROSOFT DYNAMICS AX 2012

Calculate the transaction currency amount from an accounting currencyThis example calculates the amount in the context of a ledger other than the current ledger. This isindicated by the use of the Ledger::primaryLedger method.CurrencyExchangeHelper currencyExchangeHelper;TransDate transactionDate;CurrencyCode transactionCurrency 'CAD';AmountMst amountToConvert 100.50;boolean shouldRoundResult true;AmountCur result;currencyExchangeHelper ecId),transactionDate);result undResult);Calculate using exchange rates that have been providedThere are two important things to note in this example: (1) whenever calculations are performed,both ExchangeRate1 and ExchangeRate2 must always be considered due to Euro triangulation, and(2) the rates are always stored in terms of a transaction currency to the accounting currency.Therefore, if the example called the calculateAccountToTransaction method instead, the exchangerates should still be passed in the same order.CurrencyExchangeHelper currencyExchangeHelper;TransDate transactionDate;CurrencyCode transactionCurrency 'CAD';AmountMst result;currencyExchangeHelper ExchangeRate2(2.54321);result nting(transactionCurrency,543.34,true);5SHARED CURRENCIES AND EXCHANGE RATES FOR MICROSOFT DYNAMICS AX 2012

Calculate by overriding the default exchange rate type from the ledgerCalculating an exchange rate by overriding the default exchange rate type would be useful when it isnecessary to use a different set of exchange rates for a calculation scenario. Examples might includebudget processing or consolidations.CurrencyExchangeHelper currencyExchangeHelper;TransDate transactionDate;CurrencyCode transactionCurrency 'CAD';AmountMst result;currencyExchangeHelper pecialRateType').RecId);result nting(transactionCurrency,200.75,true);Calculate outside the context of a ledger.Nearly every time a calculation is performed, it will be in the context of a ledger; however, there aresome scenarios where a ledger might not be involved. The following example shows how to performsuch a calculation.CurrencyExchangeHelper currencyExchangeHelper;TransDate transactionDate;CurrencyCode fromCurrency 'CAD';CurrencyCode toCurrency 'USD';AmountCur result;currencyExchangeHelper ype::findByName('SpecialRateType').RecId);result (fromCurrency,toCurrency,123.45,true);Additional, less common scenarios are also supported. Refer to the CurrencyExchangeHelper classdocumentation for additional information. Always check to see whether theCurrencyExchangeHelper class has the method required when converting any amount in theapplication. We recommend that you always perform the calculations by using the engine because theengine takes all necessary factors into account.6SHARED CURRENCIES AND EXCHANGE RATES FOR MICROSOFT DYNAMICS AX 2012

Upgrading legacy currency calculation callsPreviously, developers calculated amounts by using the CurrencyExchHelper class or the Currencytable methods. The CurrencyExchHelper class has been removed, therefore any calls referencing itwill need to be refactored. Many methods on the Currency table have also been removed and will needto be refactored.The following table documents the methods that have been removed from the Currency table alongwith the corresponding replacement method, where applicable.Old methodReplacement methodeditConsAvgRateNonMonetaryN/A – Exchange rate types are now used to store exchange rates specificto the consolidation processeditConsClosingRateMonetaryN/A – Exchange rate types are now used to store exchange rates specificto the consolidation processFindExchRateVarious methods on the ExchangeRateHelper classFindExchRateTxtexchRateTxt method on the Currency tableisCurrencyInTriangulationN/A – This method does not need a replacement because thetriangulation flag is not used by the tExchangeRateCurrencyPair (FK,AK1)ValidFrom ncyCode (FK,AK1)Affix ominationRecIdbigintCurrencyCode meric(32,16)LedgerExisting TablesExisting Tables modified by this featureNew TableFigure 1: New currency data model15SHARED CURRENCIES AND EXCHANGE RATES FOR MICROSOFT DYNAMICS AX 2012

Microsoft Dynamics is a line of integrated, adaptable business management solutions that enables you and yourpeople to make business decisions with greater confidence. Microsoft Dynamics works like and with familiarMicrosoft software, automating and streamlining financial, customer relationship and supply chain processes in away that helps you drive business success.U.S. and Canada Toll Free 1-888-477-7989Worldwide 1-701-281-6500www.microsoft.com/dynamicsThis document is provided “as-is.” Information and views expressed in this document, including URL and otherInternet Web site references, may change without notice. You bear the risk of using it.Some examples depicted herein are provided for illustration only and are fictitious. No real association orconnection is intended or should be inferred.This document does not provide you with any legal rights to any intellectual property in any Microsoft product. Youmay copy and use this document for your internal, reference purposes. You may modify this

Transaction currency The currency in which a transaction originates. Accounting currency The primary currency in which a legal entity maintains its financial records. The accounting currency is stored in the Ledger table. Reporting currency The reporting currency of the ledger. The reporting currency is stored in the Ledger table. It is optional.

Related Documents:

Exchange Rate Systems (continued) In a fixed-exchange-rate system exchange rates are set at officially determined levels. The official rates are maintained by the commitment of nations' central banks to buy and sell their own currencies at the fixed exchange rate. Real Exchange Rate The real exchange rate is the number of

dates and exchange rates). The exchange rates offered by HiFX in a FX Swap are determined by: The amount of the currencies being swapped; The exchange rates on offer in the foreign exchange market place for the currencies involved; The future date (far leg date) wh

FLOATING EXCHANGE RATES. 1 A Model of Parallel Currencies Under Free Floating Exchange Rates By Juan Castañeda, Sebastian Damrich, and Pedro Schwartz . each currency. A fully floating exchange rate between the two would keep the issuers of the new local currency in check. This bottom-up solution based on currency choice could also be applied

Listing Exchange Exchange Exchange Exchange); Exchange Exchange listing Exchange Exchange listing. Exchange Exchange. Exchange ExchangeExchange Exchange .

XI-1- AVERAGE RATES OF THE CURRENCIES QUOTED ON THE INTERBANK EXCHANGE MARKET - Rate at the last working day of the period (1st line) Currencies Symbol

6-1-6 Starting with the 9.0 release, it is possible to set an item's price in each price list in up to three different currencies - the primary currency and two additional currencies. This is useful where there is a need to define exact pricing for different countries instead of using currency exchange rates. In the sales pricelist at OEC Computers, the primary currency remains the default .

REFERENCES: Effective Exchange Rates n i 1 TCB i *w i n i 1 w i n i 1 FL i FL i As mentioned before, bilateral exchange rates express a two-currency exchange ratio. Since we live in a world of many countries and currencies, it might be interesting to know whether a particular currency has strengthened or

Daily Exchange Rates It provides daily exchange rates for a specific date, against the euro, the US dollar or the Italian lira, for one or more requested currencies, which are valid and for which the rates for the selected date are available. If no currency is specified, the