SELECT C.VENDOR_ID, C.VENDOR_NAME_SHORT, A.BUSINESS_UNIT, A.VOUCHER_ID,
A.INVOICE_ID, A.INVOICE_DT, A.GROSS_AMT,
SUM(A.GROSS_AMT) OVER (ORDER BY C.VENDOR_ID, A.BUSINESS_UNIT) "RUNNING TOTAL"
FROM PS_VOUCHER A, PS_VENDOR C
WHERE (A.PROCESS_MAN_CLOSE = 'N' OR A.CLOSE_STATUS <> 'C')
AND A.ENTRY_STATUS <> 'X'
AND A.VENDOR_SETID = C.SETID
AND A.VENDOR_ID = C.VENDOR_ID
AND C.VENDOR_ID = '0000000001'
GROUP BY C.VENDOR_ID, C.VENDOR_NAME_SHORT, A.BUSINESS_UNIT, A.VOUCHER_ID,
A.INVOICE_ID, A.INVOICE_DT, A.GROSS_AMT
ORDER BY A.GROSS_AMT, C.VENDOR_ID, A.BUSINESS_UNIT, A.VOUCHER_ID