Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8533

Re: PO until Outgoing Payment

$
0
0

Hi
Please check whether below query is helpful for you

 

Select F.DocNum[PO No]
  ,(Select P.U_NAME from OUSR P where P.USERID = F.UserSign)[PO User]
  , A.CardCode[Vendor Code], A.CardName[Vendor Name], F.DocDate[PO Date],F.DocTotal [PO Total]
  , D.DocNum[GRN No]
  ,(Select P.U_NAME from OUSR P where P.USERID = D.UserSign)[GRN User]
  , D.DocDate[GRN Date],D.DocTotal [GRN Total]
  , A.DocNum[Invoice No]
  ,(Select P.U_NAME from OUSR P where P.USERID = A.UserSign)[AP Invoice User]
  , A.DocDate[Invocie Date],A.DocType [Invoice Type]
  ,A.DocTotal[Inv Total],A.DpmAmnt[DownPayment Adj], A.PaidSum [Amt Paid], A.PaidToDate[Applied Amt], (A.DocTotal-A.PaidToDate)[Balance Due]

From dbo.OPCH A
Inner Join PCH1 B on A.DocEntry = B.DocEntry
Left Outer Join PDN1 C on B.BaseType = C.ObjType and B.BaseEntry = C.DocEntry and B.BaseLine = C.LineNum
Left Outer Join OPDN D on C.DocEntry = D.DocEntry
Left Outer Join POR1 E on C.BaseType = E.ObjType and C.BaseEntry = E.DocEntry and C.BaseLine = E.LineNum and B.BaseLine = E.LineNum
Left Outer Join OPOR F on E.DocEntry = F.DocEntry

 

Where A.CANCELED='N'
    and A.DocDate >= [%0]
   and A.DocDate <= [%1]

 

Warm Regards
Unnikrishnan


Viewing all articles
Browse latest Browse all 8533

Trending Articles