Total Cost in ppa_wip_values coming out to 0
Steps to Reproduce
1- Administration > Finance > Setup > "APPLY CURRENCY PRECISION FOR RATE/COST" is set to "Yes"
2- Create a Foreign Exchange Rate, for example:
From Currency: KZT
TO Currency: USD
Conversion Rate: 0.002236
Rate Calculation Method: Multiply
Exhange Rate Type: Average
Effective Date: 06/01/2023
3- Enable Currencies KZT and USD (if not already enabled)
4- Currency Precision in CMN_CURRENCIES
KZT and USD is 2
5- Do a Manual Transaction Entry
Voucher
Add a Transaction
Quantity: 11218573.000000
Cost: 1000
Rate: 1
6- Post to WIP
7- Look at values in PPA_WIP_VALUES table, "totalcost" comes out to "0"
Expected Results: totalcost would be the value greater than 0, or the value returned from cmn_get_onlyconverted_val_fct function
Actual Results: In some cases, the value is 0
Workaround:
none
Release : 16.1.1
The setting "Apply Currency Precision" was enabled, which rounded the number to "0" because the result was: 0.0022.
This query gets the corresponding record from the exchange rate table where the rate is available for any given currency and to currency whose effective date falls within the given range after checking for the appropriate exchange rate type (SPOT,AVERAGE,FIXED).Documentation on "Apply Currency Precision for Rate/Cost"
ROUND((Cost in From Currency * Exchange Rate) currency_precision))
(Cost in From Currency * Exchange rate)