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

Target Type

Hi Experts,

I am trying to create a query where i have to filter which of the Purchase Orders are already processed with AP Downpayment Invoice. Unfortunately, I cannot locate the target entry or any field that would identify the said Purchase Orders.

Thanks in advance.

Arlene

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on May 21, 2015 at 03:45 AM

    Hi Arlene,

    In Purchase order Target Type will be GRPO reference.

    You will get PO reference in AP down payment invoice Line level as Base reference.

    Please try below query

    SELECT T0.DocNum[PONum], T0.DocDate[PO Date], T0.CardCode, T0.CardName, T1.ItemCode, T4.ItemName, T1.Quantity, T1.Price, T3.DocNum[AP DPM Invoice Num], T3.DocDate[AP DPM Invoice Dt]

    FROM OPOR T0

    INNER JOIN POR1 T1 ON T0.DocEntry = T1.DocEntry

    Left Outer Join DPO1 T2 on T2.BaseType = 22 and T2.BaseEntry = T1.DocEntry and T2.BaseLine = T1.LineNum

    LEFT OUTER JOIN ODPO T3 ON T2.DocEntry = T3.DocEntry

    INNER JOIN OITM T4 ON T1.[ItemCode] = T4.[ItemCode]

    WHERE T0.DocDate >=[%0] and T0.DocDate <=[%1]

    Thanks

    Unnikrishnan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 21, 2015 at 03:47 AM

    Hi Arlene,

    Hope this helps you. This are PO's with corresponding AP Downpayment Invoice No.

    SELECT

    T0.[DocNum] 'PO Number', T0.[DocDate], T0.[CardCode], T0.[CardName], T1.[ItemCode], T1.[Dscription], T1.[Quantity], T1.[Price], T3.[DocNum] 'AP Downpayment Invoice'


    FROM OPOR T0

    INNER JOIN POR1 T1 ON T0.DocEntry = T1.DocEntry

    INNER JOIN DPO1 T2 ON T1.TrgetEntry = T2.DocEntry and T1.LineNum = T2.BaseLine

    INNER JOIN ODPO T3 ON T2.DocEntry = T3.DocEntry

    Regards,

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 22, 2015 at 12:43 AM

    Hi Arlene,

    Try:

    SELECT

    T0.[DocNum] 'PO Number', T0.[DocDate], T0.[CardCode], T0.[CardName], T1.[ItemCode], T1.[Dscription], T1.[Quantity], T1.[Price], T3.[DocNum] 'AP Downpayment Invoice'

    FROM OPOR T0

    INNER JOIN POR1 T1 ON T0.DocEntry = T1.DocEntry

    INNER JOIN DPO1 T2 ON T2.BaseEntry = T0.DocEntry and T1.LineNum = T2.BaseLine and T2.BaseType='22'

    INNER JOIN ODPO T3 ON T2.DocEntry = T3.DocEntry

    Thanks,

    Gordon

    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.