SELECT DISTINCT G.GROUP_ID FROM PS_ITEM_ACTIVITY A , PS_ITEM_DST B , PS_GROUP_CONTROL G WHERE A.GROUP_BU=G.GROUP_BU AND A.GROUP_ID=G.GROUP_ID AND A.BUSINESS_UNIT=B.BUSINESS_UNIT AND A.CUST_ID= B.CUST_ID AND A.ITEM= B.ITEM AND A.ITEM_LINE=B.ITEM_LINE AND A.ITEM_SEQ_NUM= B.ITEM_SEQ_NUM AND B.GL_DISTRIB_STATUS='N' AND (1 = ( SELECT 1 FROM PS_INSTALLATION I WHERE I.COMMITMENT_CNTL_AR <> 'Y') OR (A.ARRE_STATUS <> ' ' AND (A.ARRE_STATUS IN ('B', 'N') OR (EXISTS ( SELECT 'X' FROM PS_AR_CC_TRAN_HDR R WHERE R.BUSINESS_UNIT = A.BUSINESS_UNIT AND R.CUST_ID = A.CUST_ID AND R.ITEM = A.ITEM AND R.ITEM_LINE = A.ITEM_LINE AND R.ITEM_SEQ_NUM = A.ITEM_SEQ_NUM AND R.BUDGET_HDR_STATUS = 'V')))))
|