project QadFinancials > class BExchangeRate > business logic query ExchangeRateForCheckOverlap

Description

Check if there is an exchange rate that overlaps with the new exchange rate you want to create.


Parameters


iiSharedSetIdinteger
iiExchangeRateTypeIdinteger
iiFromCurrencyIdinteger
iiToCurrencyIdinteger
itValidDateFromdate
itValidDateTilldate
iiNotExchangeRateIdinteger


query condition


  each ExchangeRate where
ExchangeRate.ExchangeRate_ID <> iiNotExchangeRateId AND
ExchangeRate.SharedSet_ID = iiSharedSetId AND
ExchangeRate.ExchangeRateType_ID = iiExchangeRateTypeId AND
ExchangeRate.FromCurrency_ID = iiFromCurrencyId AND
ExchangeRate.ToCurrency_ID = iiToCurrencyId AND
((ExchangeRate.ExchangeRateValidDateFrom >= itValidDateFrom AND
ExchangeRate.ExchangeRateValidDateFrom <= itValidDateTill ) OR
(ExchangeRate.ExchangeRateValidDateTill >= itValidDateFrom AND
ExchangeRate.ExchangeRateValidDateTill <= itValidDateTill ))


query resultset tqExchangeRateForCheckOverlap


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
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.
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.
tiFromCurrency_IDintegerExchangeRate.FromCurrency_IDFrom Currency Code
tiSharedSet_IDintegerExchangeRate.SharedSet_IDLink to SharedSet
tiToCurrency_IDintegerExchangeRate.ToCurrency_IDTo Currency Code


Internal usage


QadFinancials
method BExchangeRate.ValidateComponent