project QadFinancials > class BExchangeRate > business logic query ExchangeRatePrim

Description

query that can be used find exchange rates based on the prim-key or based on the logical, unique key


Parameters


itValidDateFromdateValid Date From
iiFromCurrencyIdintegerFrom Currency ID
iiToCurrencyIdintegerTo Currency ID
iiExchangeRateTypeIdintegerExchange Rate Type Id
iiExchangeRateIdinteger
iiCompanyIdintegerCompany id
icFromCurrencyCodecharacter
icToCurrencyCodecharacter
icExchangeRateTypeCodecharacter


query condition


  each ExchangeRate where
ExchangeRate.SharedSet_Id = vi_EXCHANGERATE_sharedset(iiCompanyId) AND
ExchangeRate.ExchangeRateValidDateFrom = itValidDateFrom AND
ExchangeRate.FromCurrency_ID = iiFromCurrencyId AND
ExchangeRate.ToCurrency_ID = iiToCurrencyId AND
ExchangeRate.ExchangeRateType_ID = iiExchangeRateTypeId AND
ExchangeRate.ExchangeRate_ID = iiExchangeRateId

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

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

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


query resultset tqExchangeRatePrim


field namedata typedb fielddescription
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.
tiExchangeRate_IDintegerExchangeRate.ExchangeRate_IDid
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 .
tiExchangeRateType_IDintegerExchangeRate.ExchangeRateType_IDExchange Rate Type
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.
tiFromCurrency_IDintegerExchangeRate.FromCurrency_IDFrom Currency Code
tcFromCurrencyCodecharacterCurrency2.CurrencyCodeCurrency Code
tiSharedSet_IDintegerExchangeRate.SharedSet_IDLink to SharedSet
tiToCurrency_IDintegerExchangeRate.ToCurrency_IDTo Currency Code
tcToCurrencyCodecharacterCurrency1.CurrencyCodeCurrency Code
ti_sequenceintegercalculatedprimary index
tc_rowidcharactercalculated = rowid(ExchangeRate),rowid(Currency1),rowid(Currency2),rowid(ExchangeRateType)


Internal usage


QadFinancials
method BDomain.AdditionalUpdatesReplication
method BExchangeRate.ApiReplicateFromDaemon
method BExchangeRate.ApiStdMaintainTT
method BExchangeRate.ValidateComponent