Functional Description
Purpose
This function retrieves the exchange rate from the Currency Exchange Rates table (F0015) based on
currency code from, currency code to, address number and transaction date. If an exact date match is not
found, this function will pick up the most recent rates. If triangulation does not occur between the
"From" and "To" currencies, then both the multiplier and divisor rates are returned. In addition, a
default rate is returned based on the currency conversion method stored in the Currency Exchange Rates
table. However, if triangulation does occur, the triangulation rates will be returned. The
multiplier, divisor, and default rates will all be returned as zero.
Setup Notes and Prerequisites
Special Logic
This function should be called only when the exchange rate is 0 (meaning the user did not key in a
spot rate).
This function will first attempt to fetch using a specified address book number. If a rate is not
found, a fetch is made using zero in the address number field.
'b7'b7'b7'b7'b7'b7'b7'b7'b7'b7'b7'b7'b7'b7'b7'b7'b7
'b7'b7'b7'b7
Technical Specification
First attempt to fetch based on the currency code from, currency code to, address book and
transaction date.
If a record was not found try using an address book number of zero.
If we have a "Triangulation" currency (determined by the calculation method parameter in the
record), return the multiplier rate as the triangulation rate 1 and the divisor as the triangulation rate 2.
Zero out the multiplier, divisor, and default rate parameters to be returned. Set the date effective
rates parameter equal to the effective date.
If we don't have triangulation (step 3 above is not true) then retrieve the current exchange rate
based on the transaction date passed in. If no rates are found then set an error and return. If rates
are found then load the multiplier and divisor rates. Load the date effective rates parameter with
the effective date of the rates. Set the conversion method equal to the conversion method set up in the
record that was retrieved. If the conversion method is 'Y' then set the default rate equal to the
multiplier rate, if not then set the default rate equal to the divisor rate.
'b7'b7'b7'b7'b7'b7'b7'b7'b7'b7'b7'b7'b7'b7'b7'b7'b7
'b7'b7'b7'b7
D0000033 - Get Exchange Rate
Parameter Name | Data Item | Data Type | Req/Opt | I/O/Both |
---|---|---|---|---|
szCurrencyCodeFrom | CRCD | char | OPT | NONE |
Special Input Expected | ||||
szCurrencyCodeTo | CRDC | char | OPT | NONE |
Special Input Expected
| ||||
mnAddressNumber | AN8 | MATH_NUMERIC | OPT | NONE |
Special Input Expected
| ||||
jdTransactionDate | DGJ | JDEDATE | OPT | NONE |
Special Input Expected
| ||||
mnCurrConvRateMult | CRR | MATH_NUMERIC | OPT | NONE |
Special Output Returned
| ||||
mnCurrConvRateDiv | CRRD | MATH_NUMERIC | OPT | NONE |
Special Output Returned
| ||||
jdDateEffectiveRates | EFT | JDEDATE | OPT | NONE |
Special Output Returned
| ||||
mnDefaultRate | CRR | MATH_NUMERIC | OPT | NONE |
Special Output Returned
| ||||
mnTriangulationRate1 | CRRD | MATH_NUMERIC | OPT | NONE |
Special Output Returned
| ||||
mnTriangulationRate2 | CRR | MATH_NUMERIC | OPT | NONE |
Special Output Returned
| ||||
cConversionMethod | CRCM | char | OPT | NONE |
Special Output Returned
| ||||
jdOverrideEffectiveDate | EFT | JDEDATE | OPT | NONE |
Special Output Returned
|
None |
F0015 Currency Exchange Rates |