project QadFinancials > class BExchangeRate > business logic query ExchangeRateByCurrencies

Description

Determine if an exchange rate exists for a specified to & from currency combination.


Parameters


iiCompanyIdintegerCompany id
iiFromCurrency_IDinteger
iiToCurrency_IDinteger


query condition


  each ExchangeRate where
ExchangeRate.SharedSet_Id = vi_EXCHANGERATE_sharedset(iiCompanyId) AND
(ExchangeRate.FromCurrency_ID = iiFromCurrency_ID AND
ExchangeRate.ToCurrency_ID = iiToCurrency_ID ) OR
(ExchangeRate.FromCurrency_ID = iiToCurrency_ID AND
ExchangeRate.ToCurrency_ID = iiFromCurrency_ID )

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


query resultset tqExchangeRateByCurrencies


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.
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.
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 BDInvoice.DefaultValuesOwnVatNumber
method BExchangeRate.ApiCalculateDerivedExchangeRates
method BExchangeRate.ApiSaveDerivedExchangeRates