Skip to Content
0
Former Member
Feb 25, 2011 at 05:45 AM

po

30 Views

Hi experts,

i have done this query for pending po.... but its shows pending for each and every grn but the po is one... to explain more precisely... im putting po for 100 qtys and it has been given in 5 split ups. first time i receive it 100 - 20 = 80. when the next time i receive it it should show 80-20=100 but it is showing 100 - 20 again...

SELECT T0.[CardCode] AS 'Vendor Code', T0.[CardName] as 'Vendor Name', T0.[DocNum] as 'PO Number', T0.[DocDate] as 'PO Date', T1.[ItemCode] as 'Item Code', T1.[Dscription] as 'Item Description',T1.[Quantity] as 'PO Qty',T3.[DocNum] as 'GRN No', T3.[DocDate] as 'GRN Date',T2.[Quantity] as 'GRN Qty',T3.[NumAtCard] as 'Vendor Ref',(T1.Quantity-T2.Quantity) as 'Balance Qty' FROM OPOR T0 left outer JOIN POR1 T1 ON T0.DocEntry = T1.DocEntry left outer join PDN1 T2 on t2.baseentry=t1.docentry and t2.itemcode=t1.itemcode and t2.linenum=t1.linenum left outer JOIN OPDN T3 ON T2.DocEntry = T3.DocEntry INNER JOIN OITM T4 ON T3.DocEntry = T4.DocEntry where t0.docdate between [%0] and [%1] and t0.doctype='I'

pls help.

regards,

Vignesh.R