Skip to Content
author's profile photo Former Member
Former Member

SAP B1 AR Invoice and Incoming Payments Query

Hi Experts

Posting Date Doc Num Card Code Card Name Ref Num Inv Doc Total DueDate Incoming DocNum Incoming Applied Amount Balance Due

11/6/2015 2452 112 Customer A 145 1000 11/10/2015 2642 500 500

Can anyone help me with this kind of query, I would like to generate reports all AR invoice with incoming payments.

Thank you.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    Posted on Nov 06, 2015 at 06:49 AM

    Hi ,

    Try below query

    SELECT T0.[DocDate] AS 'Invoice Posting Date' ,

    T0.[DocNum] AS 'Inv Document Number',

    T2.[CardCode] AS 'Customer/Vendor Code', T2.[CardName] AS 'Customer/Vendor Name',

    T0.[NumAtCard], T0.[DocTotal],T1.[SumApplied] AS 'Paid to Invoice', T2.[DocNum],

    T2.[DocDate] AS 'Posting Date', T0.[DocTotal]- T1.[SumApplied]

    FROM [dbo].[OINV] T0 INNER JOIN [dbo].[RCT2] T1 ON T1.[DocEntry] = T0.[DocEntry]

    INNER JOIN [dbo].[ORCT] T2 ON T2.[DocNum] = T1.[DocNum]

    WHERE T2.[DocDate] >= [%0] AND T2.[DocDate] <= [%1]

    Rgds,

    Kamlesh Naware

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 06, 2015 at 07:25 AM

    Hi Erwin,

    Please try the below query, it also includes status of the invoices.

    SELECT dbo.OINV.DocNum as [DocNum ], CONVERT(VARCHAR, dbo.OINV.DocDate, 103) AS DocDate, dbo.OINV.CardName as Customer, dbo.OINV.DocTotal [DocTotal ], dbo.OINV.PaidToDate AS [Amount Rec'd], CASE WHEN oinv.DocTotal = oinv.PaidToDate THEN 'Fully received' WHEN oinv.PaidToDate > 0 THEN 'Partially Received' ELSE 'Not Received' END AS Status FROM dbo.OCTG INNER JOIN dbo.OINV ON dbo.OCTG.GroupNum = dbo.OINV.GroupNum WHERE (dbo.OCTG.PymntGroup = N'Cash/Cheque') AND (dbo.OINV.CANCELED = 'N')

    GROUP BY dbo.OINV.DocNum, CONVERT(VARCHAR, dbo.OINV.DocDate, 103), dbo.OINV.CardName, dbo.OINV.DocTotal, dbo.OINV.PaidToDate

    Regards,

    Isaac Kalii.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.