Skip to Content
Former Member
Oct 09, 2017 at 03:46 PM

Query for Days to Pay

42 Views Last edit Oct 03, 2017 at 02:40 PM 3 rev

SELECT t2.docnum,t2.cardname,T2.[CardCode] ,t2.docstatus, T2.[DocDate] AS [Invoice Date], T2.[VatSum] AS [VAT Paid], t2.doctotal as [Invoiced Amount], t0.docdate as [Payment Date], T1.[SumApplied]

FROM ORCT T0 INNER JOIN RCT2 T1 ON T0.DocNum = T1.DocNum INNER JOIN OINV T2 ON T1.DocEntry = T2.DocEntry

WHERE t2.receiptnum=t1.docnum AND T2.[CardCode] = 'cardcode'

I have hit a fork in the road whilst creating my Days to Pay Query the aim of the Query is to display all the invoices based on a specific partner along with the posting date and payment date (if there is one) however I am unable to produce this whilst still including open invoices, please see the query below.

I am also certain that there are open invoices.

Thanks in advance.