SELECT T.BUSINESS_UNIT , T.INV_ITEM_ID , T.DT_TIMESTAMP , T.SEQ_NBR , T.SOURCE_BUS_UNIT , T.ORDER_NO , O.RT_TYPE , R.RATE_MULT , R.RATE_DIV , C.DECIMAL_POSITIONS FROM PS_CM_SHIPONBEHALF S , PS_ORD_HEADER O , PS_CURRENCY_CD_TBL C , PS_RT_RATE_TBL R , PS_RT_INDEX_TBL I , PS_TRANSACTION_INV T , PS_BUS_UNIT_TBL_GL D WHERE S.BUSINESS_UNIT = T.BUSINESS_UNIT AND S.INV_ITEM_ID = T.INV_ITEM_ID AND S.DT_TIMESTAMP = T.DT_TIMESTAMP AND S.SEQ_NBR = T.SEQ_NBR AND S.TRANSACTION_GROUP = '034' AND T.SOURCE_BUS_UNIT = O.BUSINESS_UNIT AND T.ORDER_NO = O.ORDER_NO AND D.BUSINESS_UNIT = S.CM_BU_DESTIN_GL AND S.BASE_CURRENCY <> D.BASE_CURRENCY AND S.BASE_CURRENCY = R.FROM_CUR AND D.BASE_CURRENCY = R.TO_CUR AND O.RT_TYPE = R.RT_TYPE AND R.EFFDT = ( SELECT MAX(F.EFFDT) FROM PS_RT_DFLT_VW F WHERE F.FROM_CUR = R.FROM_CUR AND F.TO_CUR = R.TO_CUR AND F.RT_TYPE = R.RT_TYPE AND F.EFFDT <= T.TRANSACTION_DATE) AND R.TO_CUR = C.CURRENCY_CD AND C.EFFDT = ( SELECT MAX(E.EFFDT) FROM PS_CURRENCY_CD_TBL E WHERE C.CURRENCY_CD = E.CURRENCY_CD AND E.EFFDT <= T.TRANSACTION_DATE) AND R.RT_RATE_INDEX = I.RT_RATE_INDEX AND R.TERM = 0 AND I.DEFAULT_INDEX = 'Y'
|