How to Convert Transaction Currency Amount to Company Ledger Currency in D365FO



Introduction

Currency conversion is a crucial aspect of financial management, especially for businesses operating in multiple countries. In Dynamics 365 Finance and Operations (D365FO), converting transaction currency amounts to the company ledger currency ensures accurate financial reporting and compliance. Let's dive into how you can achieve this seamlessly in D365FO. 

In Many situations an organization must do transaction with foreign currencies. Every ERP system has the option for converting Transaction Currency Amount to Company Ledger Currency.

How to Convert Transaction Currency Amount to Company Ledger Currency in D365FO

Understanding Currency Conversion

Definition and Purpose

Currency conversion involves translating amounts from one currency to another using exchange rates. This is essential for businesses to consolidate their financial statements, manage risks, and comply with local regulations.

Key Terms and Concepts

Base Currency: The primary currency used by a company for its financial reports. The default currency, also known as the base currency, is set during the initial setup of the ledger.

Transaction Currency: The currency in which a transaction is initially recorded.

Exchange Rate: The rate at which one currency can be exchanged for another.

Setting Up Currencies in D365FO

Configuring Base and Transaction Currencies

In D365FO, you can set up both the base currency (company ledger currency) and transaction currencies. Navigate to the General ledger > Ledger setup > Ledger and specify the base currency.

Convert Transaction Currency to Company Ledger Currency using X++ Code

class CurrencyConverter

{

    public static void main(Args _args)

    {       

CurrencyExchangeHelper currencyExchangeHelper;

CurrencyCode transCurrencyCode = 'INR';

AmountCur amountCur = 2500.00;

AmountMst amountMST;       

currencyExchangeHelper = CurrencyExchangeHelper::newExchangeDate(Ledger::current(), systemDateGet());

amountMST = currencyExchangeHelper.calculateTransactionToAccounting(transCurrencyCode, amountCur ,true);

     info(strFmt('Accounting Currency Amount = %1',amountMST));

    }

}

This line declares a variable currencyExchangeHelper of type CurrencyExchangeHelper. This helper class is used to manage currency exchange operations in Dynamics 365 Finance and Operations (D365FO). 

Set Transaction Currency Code int 'INR', which stands for Indian Rupees. This variable specifies the currency of the transaction that needs to be converted.

Then set Transaction Amount amountCur variable is set to 2500.00. This represents the amount in the transaction currency (INR) that needs to be converted to the accounting currency.

Variable amountMST is declared to store the converted amount in the accounting currency (also known as the ledger currency).

Next line initializes the currencyExchangeHelper object. The newExchangeDate method takes two parameters: 

  • Ledger::current(): This gets the current ledger, which is used to determine the base accounting currency. 
  • systemDateGet(): This gets the current system date, which is used to fetch the relevant exchange rate.
Then Calculate the Converted Amount, The calculateTransactionToAccounting method is called on the currencyExchangeHelper object. This method takes three parameters:
  • transCurrencyCode: The currency code of the transaction (INR).
  • amountCur: The amount in the transaction currency (2500.00). 
  • true: This parameter typically specifies whether to include certain adjustments or not (it can depend on the specific implementation in D365FO). The method returns the converted amount in the accounting currency, which is then assigned to amountMST.

The method returns the converted amount in the accounting currency, which is then assigned to amountMST.

Finally, the info function is used to display a message in the Infolog. The strFmt function formats the string by replacing %1 with the value of amountMST. This displays the converted amount in the accounting currency.

In the browser window you can see the output of the above code,

How to Convert Transaction Currency Amount to Company Ledger Currency in D365FO

Conclusion

Converting transaction currency amounts to the company ledger currency in D365FO is vital for accurate financial reporting and compliance. By understanding the process, setting up the necessary configurations, and following best practices, businesses can ensure smooth and error-free currency conversions. D365FO can handle multiple exchange rates for different transaction types and periods. Best practices include maintaining accurate exchange rates, conducting regular audits, and using automated tools for updating rates.

0 Comments