SELECT A.EMPLID , A.EMPL_RCD , A.DUR , A.SEQ_NBR , B.CURRENCY_CD %Concat ' (Global)' , %Round(%DECMULT(%DECDIV(A.EST_GROSS, D.RATE_DIV),D.RATE_MULT), 2) AS EST_GROSS FROM PS_TL_PAYABLE_TIME A , PS_HR_CUR_SETUP B , PS_HR_APPL_CUR C , PS_RT_RATE_TBL D WHERE B.HR_APPLID = 'TLKIB' AND B.HR_GLOBAL_CUR = 'Y' AND A.CURRENCY_CD <> B.CURRENCY_CD AND EXISTS ( SELECT 'X' FROM PS_HR_CUR_SETUP B1 WHERE B1.HR_APPLID = 'TLKIB' AND A.CURRENCY_CD = B1.CURRENCY_CD) AND B.HR_APPLID = C.HR_APPLID AND D.RT_RATE_INDEX = C.RT_RATE_INDEX AND D.TERM = C.TERM AND D.RT_TYPE = C.RT_TYPE AND D.FROM_CUR = A.CURRENCY_CD AND D.TO_CUR = B.CURRENCY_CD AND D.EFFDT = ( SELECT MAX(D_ED.EFFDT) FROM PS_RT_RATE_TBL D_ED WHERE D.RT_RATE_INDEX = D_ED.RT_RATE_INDEX AND D.TERM = D_ED.TERM AND D.FROM_CUR = D_ED.FROM_CUR AND D.TO_CUR = D_ED.TO_CUR AND D.RT_TYPE = D_ED.RT_TYPE AND D_ED.EFFDT <= A.DUR) UNION ALL SELECT A.EMPLID , A.EMPL_RCD , A.DUR , A.SEQ_NBR , A.CURRENCY_CD %Concat ' (Global)' , A.EST_GROSS FROM PS_TL_PAYABLE_TIME A , PS_HR_CUR_SETUP B WHERE A.CURRENCY_CD = B.CURRENCY_CD AND B.HR_APPLID = 'TLKIB' AND B.HR_GLOBAL_CUR = 'Y'
|