project QadFinancials > class BExchangeRate > business logic query ExchangeRateByCurrTypeFrToDate

Description

Query on Exchange Rate


Parameters


iiFromCurrencyIdintegerFrom Currency ID
iiToCurrencyIdintegerTo Currency ID
iiExchangeRateTypeIdintegerExchange Rate Type Id
itExchRateFromValidityDatedateFrom Validity Date
icFromCurrencyCodecharacterfrom currency code
icToCurrencyCodecharacterTo currency code
icExchangeRateTypecharacter
iiCompanyIdintegerCompany id
itExchRateToValidityDatedateTo Validity Date


query condition


  each ExchangeRate where
ExchangeRate.SharedSet_Id = vi_EXCHANGERATE_sharedset(iiCompanyId) AND
ExchangeRate.FromCurrency_ID = iiFromCurrencyId AND
ExchangeRate.ToCurrency_ID = iiToCurrencyId AND
ExchangeRate.ExchangeRateType_ID = iiExchangeRateTypeId AND
ExchangeRate.ExchangeRateValidDateFrom <= itExchRateToValidityDate AND
ExchangeRate.ExchangeRateValidDateTill >= itExchRateFromValidityDate

      first Currency1 (inner-join) where
Currency1.Currency_ID = ExchangeRate.FromCurrency_ID AND
Currency1.CurrencyCode = icFromCurrencyCode

      first Currency2 (inner-join) where
Currency2.Currency_ID = ExchangeRate.ToCurrency_ID AND
Currency2.CurrencyCode = icToCurrencyCode

      first ExchangeRateType (inner-join) where
ExchangeRateType.ExchangeRateType_ID = ExchangeRate.ExchangeRateType_ID AND
ExchangeRateType.ExchangeRateTypeCode = icExchangeRateType


query sort order


ExchangeRate.FromCurrency_ID (ascending)
ExchangeRate.ToCurrency_ID (ascending)
ExchangeRate.ExchangeRateType_ID (ascending)
ExchangeRate.ExchangeRateValidDateFrom (ascending)
ExchangeRate.ExchangeRateValidDateTill (ascending)


query resultset tqExchangeRateByCurrTypeFrToDate


field namedata typedb fielddescription
tcCurrencyCodecharacterCurrency1.CurrencyCodeCurrency Code
tcCurrencyCode2characterCurrency2.CurrencyCodeCurrency Code
tdExchangeRatedecimalExchangeRate.ExchangeRateExchange Rate: This number is specified as the amount by which you multiply a single unit of a From Currency to reach the equivalent number of the To Currency units.
tdExchangeRateScaledecimalExchangeRate.ExchangeRateScaleScale Factor: A number used in the exchange rate calculation to adjust the amount of the From Currency.
Typically used in hyperinflationary environments when the differences between currency values is large.
api annotation:Value for this field defaults to 1.0000000 .
tcExchangeRateTypeCodecharacterExchangeRateType.ExchangeRateTypeCodeA code identifying an exchange rate type. A number of types are predefined and required by the system.
ttExchangeRateValidDateFromdateExchangeRate.ExchangeRateValidDateFromValid from: The start date of the currency exchange relationship.
The effective period of an entry cannot overlap with another entry for the same relationship.
tiExchangeRateType_IDintegerExchangeRate.ExchangeRateType_IDExchange Rate Type
ttExchangeRateValidDateTilldateExchangeRate.ExchangeRateValidDateTillValid to: This field specify the date after which the exchange rate type becomes inactive.
api annotation:When creating a new exchange rate type, the system proposes a default validity end date based on the value you entered in the Default Validity field in Exchange Rate Type Create for the exchange rate type. However, you can overwrite the default value.
tiExchangeRate_IDintegerExchangeRate.ExchangeRate_IDid
tiFromCurrency_IDintegerExchangeRate.FromCurrency_IDFrom Currency Code
tiToCurrency_IDintegerExchangeRate.ToCurrency_IDTo Currency Code


Internal usage


QadFinancials
method BExchangeRate.ApiGetAverageExchangeRate