on 09-22-2008 10:32 PM
How can I query the A/R invoice table and determine the date an invoice was paid in full?
Closed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Closed.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Cindy,
A first step could be checking the ORCT table. This table stores the information regarding the payments. You can select the payment for a particular business partner and select the document from the OINV table.
You can start from something like that:
SELECT T0.DocNum, T0.DocType, T0.Canceled, T0.DocDate, T0.DocDueDate, T1.DocNum, T1.DocType, T1.DocDate, T1.DocDueDate FROM ORCT T0 INNER JOIN OINV T1 ON T0.DocEntry = T1.ReceiptNum WHERE T0.CardCode = 'c1008' and T1.CardCode = 'c1008'
Kind Regards,
Marcella Rivi
SAP Business One Forums Team
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is this for invoices which have paid through mutiple payments?
Are you looking at getting the latest date of all the payment which closed the invoice?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
But that doesn't give me the answer I need for thousands of invoices paid off in a month.
I assumed that each invoice would have a 'date invoice paid off' field as in MS Dynamics, a product I've worked with previously, but no.
I think I'm going to have to look at the payments table and find the max(docdate) of payments that were applied to invoice where the invoice is paid in full (oinv.doctotal - oinv.paidtodate = 0)
Hi Cindy,
If you want the exact date for the invoice paid in full, only query invoice table can not achieve that. If you just want to know which invoice is paid in full to date then a simple query is enough like:
Select T0.DocNum, T0.DocDate, T0.DocTotal From OINV T0 Where T0.PaidToDate = T0.DocTotal
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 |
---|---|
101 | |
14 | |
10 | |
5 | |
4 | |
3 | |
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.