Skip to Content
0

Customer Payment Query

Dec 26, 2016 at 12:43 PM

54

avatar image

Dear Experts,

The query below gives details of customer invoice details and payments received against those invoices but small issues its also showing entries for brs is done for those entries the payment date is showing null but amount paid showing full amount but when checked there is no incoming payment for those entry. need help to display date for brs done entry

/*select T0.docdate from oinv t0*/ Declare @fdate as date set @fdate = [%0] /*select T0.docdate from oinv t0*/ Declare @tdate as date set @tdate = [%1] SELECT T0.DocNum as 'Invoice Code',T0.DocDate as 'Invoice Date',T0.DocDueDate as 'Invoice DueDate', T0.DocTotal AS 'Invoice Value', (select top 1 a.DocDate from ORCT a Inner Join RCT2 B on a.DocEntry=b.DocNum where b.DocEntry = t0.DocEntry ) AS 'Payment Date', isnull(T0.PaidSum,0) 'Amount Paid' FROM OINV T0 WHERE T0.CANCELED ='N' and T0.DocDate Between @fdate and @tdate

Regards,

Karthik B

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers