SELECT E.SETID , E.CNTRCT_ID , E.LINE_NBR , SUM(A.QTY_RETURNED) , %Round(SUM(%DecMult(A.QTY_RETURNED, A.NET_UNIT_PRICE)) ,3) FROM PS_RMA_LINE A , PS_SCN_ORD_LINE_VW B , PS_SCN_SETCNTL_VW C , PS_SCON_LINE E WHERE A.REF_BUS_UNIT_OM=B.BUSINESS_UNIT AND A.REF_ORDER_NO=B.ORDER_NO AND A.REF_LINE_NBR=B.ORDER_INT_LINE_NO AND A.UNIT_OF_MEASURE=B.UNIT_OF_MEASURE AND C.SETCNTRLVALUE=B.BUSINESS_UNIT AND C.RECNAME = 'SCON_LINE' AND E.SETID=C.SETID_UNIQUE AND E.CNTRCT_ID=B.CNTRCT_ID_UNIQUE AND E.LINE_NBR=B.CNTRCT_LINE_NBR AND E.UNIT_OF_MEASURE=B.UNIT_OF_MEASURE GROUP BY E.SETID, E.CNTRCT_ID, E.LINE_NBR
|