hi,
public ExchRate exchRate(
CurrencyCode _fromCurrency,
CurrencyCode _toCurrency = Ledger::find(Ledger::current()).AccountingCurrency,
TransDate _transDate = today(),
)
{
ExchangeRate exchangeRate;
ExchangeRateType ExchangeRateType;
ExchangeRateCurrencyPair exchangeRateCurrencyPair;
real exchRate;
CurrencyCode fromCurrency = this.CurrencyCode;
TransDate transDate = this.TransDate;
select firstonly exchangeRateCurrencyPair where
exchangeRateCurrencyPair.ExchangeRateType == Ledger::find(Ledger::current()).DefaultExchangeRateType
&& exchangeRateCurrencyPair.FromCurrencyCode == _fromCurrency
&& exchangeRateCurrencyPair.ToCurrencyCode == _toCurrency;
return exchangeRate::findByDate(exchangeRateCurrencyPair.RecId,_transDate).ExchangeRate;
}