SELECT A.SF_PMT_REF_NBR , A.COMMON_ID , A.STRM , A.INSTITUTION_SET , B.BUSINESS_UNIT , A.CURRENCY_CD , A.CR_CARD_DIGITS , %DecMult(-1, A.PAYMENT_AMT) ,'Y' FROM PS_SF_PAYMENT A , PS_BUS_UNIT_TBL_SF B , PS_ISET_BU_DTL C , PS_INSTITUTION_SET D WHERE A.INSTITUTION_SET <> ' ' AND C.INSTITUTION_SET = A.INSTITUTION_SET AND C.BUSINESS_UNIT = B.BUSINESS_UNIT AND B.SF_ENABLE_WEB_PAY = 'Y' AND D.INSTITUTION_SET = C.INSTITUTION_SET AND D.SF_ALLOW_EXCESS = 'Y' AND A.SA_ID_TYPE = 'P' AND (A.SF_PAYMENT_STATUS = 'S' OR A.SF_PAYMENT_STATUS = 'A' OR A.SF_PAYMENT_STATUS = 'B') AND A.SF_POST_STATUS <> 'S' AND A.CR_CARD_TRANS_SRC = 'P' AND C.PRIORITY = ( SELECT MIN(X.PRIORITY) FROM PS_ISET_BU_DTL X , PS_BUS_UNIT_TBL_SF Y WHERE X.INSTITUTION_SET = C.INSTITUTION_SET AND X.BUSINESS_UNIT = Y.BUSINESS_UNIT AND Y.SF_ENABLE_WEB_PAY = 'Y')
|