static void CurrentExchangeRate(Args _args)
{
ExchangeRate exchangeRate;
ExchangeRateType ExchangeRateType;
ExchangeRateCurrencyPair exchangeRateCurrencyPair;
real exchRate;
CurrencyCode fromCurrency = "USD";
CurrencyCode toCurrency = "PKR";
TransDate transDate = today();
select firstonly exchangeRateCurrencyPair
where
exchangeRateCurrencyPair.ExchangeRateType
== Ledger::find(Ledger::current()).DefaultExchangeRateType
&& exchangeRateCurrencyPair.FromCurrencyCode == fromCurrency
&& exchangeRateCurrencyPair.ToCurrencyCode == toCurrency;
exchRate = exchangeRate::findByDate(exchangeRateCurrencyPair.RecId,
transDate).ExchangeRate;
info(strFmt("Exchange Rate = %1",exchRate/100));
}
No comments:
Post a Comment