It sounds like you need to query paid vouchers. But just in case you need to query others, here are all of the locations for vouchers:
Unposted vouchers: PM10000 (PM Transaction Work)
Posted "Open" (unpaid or partially paid) vouchers: PM20000 (PM Transaction Open)
"History" vouchers (fully paid): PM30200 (PM Transaction History)
These tables will also contain credits and payments, not just vouchers, so you may need to filter based on DOCTYPE. (1=Invoice, 4=Return, 5=Credit memo, 6=Check, etc.)
Since you mention you need to know what vouchers hit what GL accounts, you will probably want to join against the associated PM distributions table:
Unposted voucher distributions: PM10100
Open voucher distributions: PM20200
History voucher distributions: PM30600
Attached are two queries that I've used to query vouchers and their associated distributions. The first is just separate queries for Open and History (adjust and tweak as needed), and I'll separately post a stored procedure that I wrote that does Unions so they all return in a single result set.
Hope that helps, and if you need any other info, just let me know.
Dynamics GP Certified Trainer
Dynamics GP Certified Business Solution Professional
/*OPEN AP FILES*/ SELECT TOP 10 * FROM PM20000 --Remove "TOP 10" for real query SELECT TOP 10 'PM20000' AS TableName, 'Open' AS DocumentStatus, A.VENDORID, B.BACHNUMB, B.DOCNUMBR, B.PSTGDATE, B.DOCDATE, A.VCHRNMBR, A.TRXSORCE, A.DEBITAMT, A.CRDTAMNT, RTRIM(C.ACTNUMST) AS ACTNUMST, RTRIM(D.ACTDESCR) AS ACTDESCR, C.ACTNUMBR_3, B.DOCTYPE, A.DISTTYPE FROM PM10100 A JOIN PM20000 B ON B.VCHRNMBR = A.VCHRNMBR JOIN GL00105 C ON C.ACTINDX = A.DSTINDX JOIN GL00100 D ON D.ACTINDX = C.ACTINDX WHERE A.VENDORID = '10-04004' AND B.PSTGDATE > '2005-05-01' ORDER BY B.DOCDATE, A.VCHRNMBR /*Historical AP Files*/ SELECT TOP 10 * FROM PM30200 SELECT TOP 10 'PM30200' AS TableName, 'History' AS DocumentStatus, A.VENDORID, B.BACHNUMB, B.DOCNUMBR, B.PSTGDATE, B.DINVPDOF, B.DOCDATE, A.VCHRNMBR, A.TRXSORCE, A.DEBITAMT, A.CRDTAMNT, RTRIM(C.ACTNUMST) AS ACTNUMST, RTRIM(D.ACTDESCR), C.ACTNUMBR_3, B.DOCTYPE, A.DISTTYPE FROM PM30600 A JOIN PM30200 B ON B.VCHRNMBR = A.VCHRNMBR JOIN GL00105 C ON C.ACTINDX = A.DSTINDX JOIN GL00100 D ON D.ACTINDX = C.ACTINDX WHERE A.VENDORID = '10-04004' --AND B.PSTGDATE < '2005-09-01' AND B.DOCTYPE <> 6 --Not a check ORDER BY B.DOCDATE, A.VCHRNMBR