public display Amount TIDF_ExchangeRate()
{
ExchangeRate exchangeRate;
ExchangeRateType ExchangeRateType;
ExchangeRateCurrencyPair exchangeRateCurrencyPair;
real exchRate;
CurrencyCode fromCurrency = this.CurrencyCode;
CurrencyCode toCurrency = Ledger::find(Ledger::current()).AccountingCurrency ; //"AED";
TransDate transDate = this.TransDate;
select firstonly exchangeRateCurrencyPair
where
exchangeRateCurrencyPair.ExchangeRateType == Ledger::find(Ledger::current()).DefaultExchangeRateType
&& exchangeRateCurrencyPair.FromCurrencyCode == fromCurrency
&& exchangeRateCurrencyPair.ToCurrencyCode == toCurrency;
// if ( date2str(this.TransDate ,1,1,1) == 5/9/2018);
exchRate = exchangeRate::findByDate(exchangeRateCurrencyPair.RecId,transDate).ExchangeRate;
//info(strFmt("%1",exchRate/100));
return exchRate/100;
}
No comments:
Post a Comment