SELECT
gltrans_id,
gltrans_amount,
- ROUND( _ar.arapply_applied / _citem.cashrcpt_curr_rate, 3 ) - ROUND(gltrans_amount, 3)
+ ROUND( _citem.cashrcptitem_amount / _citem.cashrcpt_curr_rate, 3 ) - ROUND(gltrans_amount, 3)
INTO
v_gl_id,
v_gltrans_amount,
-- if currency rate is off...
IF v_diff != 0.00 THEN
- v_new_rate := _ar.arapply_applied / v_gltrans_amount;
+ v_new_rate := _citem.cashrcptitem_amount / v_gltrans_amount;
- RAISE NOTICE 'arapply_id % change currency rate from % to %, applied % gl amount %', i_arapply_id, _citem.cashrcpt_curr_rate ,v_new_rate,_ar.arapply_applied,v_gltrans_amount ;
+ RAISE NOTICE 'arapply_id % change currency rate from % to %, applied % gl amount %', i_arapply_id, _citem.cashrcpt_curr_rate ,v_new_rate,_citem.cashrcptitem_amount,v_gltrans_amount ;
-- UPDATE
-- aropen