Hi All
Please help rectify this GRPO Draft base on posted PO Query as the posted PO Posting Date (T5.DocDate) is incorrect?
SELECT T0.CardCode as 'Vendor Code', T0.CardName as 'Vendor Name', T0.DocNum as 'PO No.', T0.Docentry,
T0.DocDate as 'PO Date', T5.DocDate as 'PO Date', T1.VisOrder+1 as 'Line No.', T1.SubCatNum as 'Vendor Item No.', T2.ItemCode as 'Item Code', T2.ItemName as 'Item Description',
T1.U_A_Color, T1.U_A_Grade, T1.U_A_Temper, T1.U_A_TotalWeight,
T1.Quantity as 'PO Qty', T1.OpenCreQty as 'Open Qty', T2.[IsCommited] as Committed,
T1.Quantity-T1.OpenCreQty as 'Delivered Qty', T0.DocCur as 'Currency', T1.Price, T1.OpenCreQty*T1.Price as 'Open Amt',
T1.ShipDate as 'Est. Delivered Date', T1.U_A_Remarks, T0.Comments as 'Remarks'
FROM ODRF T0
INNER JOIN DRF1 T1 ON T0.DocEntry=T1.DocEntry
INNER JOIN OITM T2 ON T1.ItemCode=T2.ItemCode
INNER JOIN OCRD T4 ON T0.CardCode=T4.CardCode
LEFT JOIN OPOR T5 ON T0.[DocEntry] = T5.[DocEntry]
-----INNER JOIN OITW T5 ON T5.Itemcode = T2.Itemcode
WHERE T0.Canceled<>'Y' AND T0.DocStatus='O' AND T1.OPENCREQTY >0 AND T0.DocType='I' and T0.[ObjType] ='20'
ORDER BY T0.DocNum, T1.VisOrder
Kedalene