on 09-14-2008 11:54 AM
I need to generate a query report for AP DRAFT Invoices.
Doc. No. / Doc. Date / BP Name / Bp Code / GL Account Code / Description / Row total Total / GST value
This information is required for a AP Purchase - Invoice type Service DRAFT
But I can't able to pick the proper GL Account code and other required infromation from the Draft table.
I have tried incorporate the following tables without success.
invoice table OPCH
invoice lines table PCH1
G/L table OACT
Draft document table ODRF
Can anyone assist me please.
regards, Lisa
Lisa,
Please note that the DocNum you would get through the query is not the actual DocNum as the DocNum do not get confirmed till you actually add the AP Invoice.
Please make the correction to Gordon's Query...there was a small typo instead of ODRF the table name is typed as PDRF
SELECT T0.DocNum, T0.DocDate, T0.CardName, T0.CardCode, T2.FormatCode, T1.Dscription, T1.LineTotal, T1.VatSum
FROM [dbo\].[ODRF\] T0 Inner Join [dbo\].[DRF1\] T1 ON T1.DocEntry = T0.DocEntry
Inner Join [dbo\].[OACT\] T2 ON T2.AcctCode = T1.AcctCode
Where T0.ObjType = '18' and T0.DocType = 'S'
Suda
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
wonderful thank you Gordon and Suda!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Lisa,
Please try this to start:
SELECT T0.DocNum, T0.DocDate, T0.CardName, T0.CardCode,
T2.FormatCode, T1.Dscription, T1.LineTotal, T1.VatSum
Fom ODRF T0 Inner Join DRF1 T1 ON T1.DocEntry = T0.DocEntry
Inner Join OACT T2 ON T2.AcctCode = T1.AcctCode
Where T0.ObjType = '18' and T0.DocType = 'S'
Thanks,
Gordon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.