I would like to have a generic enquiry that lists out any AP invoices that are still open and have multiple payments applied. Can someone advise how to get started. I don’t know which tables I would need and how to join them.
Thanks
Here is an example of the data I am looking for:
Best answer by Naveen Boga
@pcraske31 Below is the SQL query, and you can refer this query and add the JOINS in the GI to fetch the AP Bill and Payment details.
Select * from APInvoice AI Innerjoin APAdjust AA ON
AI.DocType = AA.AdjdDocType and AI. RefNbr = AA.AdjdRefNbr
Where AI.RefNbr='005295'
I recommend starting with APAdjust. APAdjust holds the relationship between AP Bill documents and the documents that pay them (Debit Adjustments, Payments, Prepayments).
To identify bills that have multiple payments, you’ll want to add a Count field to count the number of times the same Bill-Reference number appears in the results.
We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.