Delivered SO

SELECT T0. DOCENTRY, T0.[DocNum] AS [NO. DO], T0.[DocDate], T0.[CardName], T0.[NumAtCard] AS [NO. PO CUST], t1.baseref AS [NO. SO],T1.[ItemCode], T1.[Dscription],T1.[Quantity], T1.[WhsCode] AS [WHS], T3.[DocNum] AS[NO RETURN], T2.[Quantity] AS [QTY RETURN], isnull(t1.quantity-t2.quantity, t1.quantity) as [Net Qty], t7.DOCNUM AS [NO CN], T6.QUANTITY AS[QTY CN], t0.comments, T5.DOCNUM AS [NO.INV]

FROM ODLN T0
LEFT JOIN DLN1 T1 ON T0.[DocEntry] = T1.[DocEntry]
LEFT JOIN RDN1 T2 ON T0.DOCENTRY=T2.BASEENTRY
LEFT JOIN ORDN T3 ON T2.[DocEntry] = T3.[DocEntry]
LEFT JOIN INV1 T4 ON T0.DOCENTRY = T4.BASEENTRY
LEFT JOIN OINV T5 ON T4.DOCENTRY = T5.DOCENTRY
LEFT JOIN RIN1 T6 ON T4.dOCENTRY = T6.BASEENTRY
LEFT JOIN ORIN T7 ON T6.DOCENTRY = T7.DOCENTRY

WHERE T1.[BaseRef] =[%0] AND T0.[CANCELED] =’N’ AND T5.[CANCELED] =’N’


menampilakn Daftar DO yang sudah di kirim Berdasarkan SO

Actual Production

Select Distinct A.docdate as tanggalInvoice, a.docnum as NoInv,f.docnum as NoSo,d.docdate as TanggalDO,d.DocNum as NoDO
,A.Cardcode as CustomerCode,A.CardName as CustomerName
,B.ItemCode as ItemNo
,B.Dscription as ItemName
,B.WhsCode as Warehouse
,B.Quantity
,B.Price
,B.StockPrice as Cost
,((B.StockPrice / B.Price)*100) as Persentase
,i.DistNumber as BatchNum
,l.DocNum as NoReceipt
,k.Quantity as QtyReceipt
From
OINV a
left join INV1 b on A.Docentry = B.DocEntry
left join DLN1 c on b.baseentry = c.docentry and b.basetype = c.objtype and b.baseline = c.linenum
left join ODLN d on c.docentry = d.docentry
left join RDR1 e on c.baseentry = e.docentry and c.basetype = e.objtype and c.baseline = e.linenum
left join ORDR f on e.docentry = f.docentry
–batch Delivery
left join OITL g on g.ApplyType = ’15’ and g.BaseType = ’17’ and g.docnum = d.docnum
left join ITL1 h on G.LogEntry = h.LogEntry
left join OBTN i on i.sysnumber = h.SysNumber and i.itemcode = c.ItemCode
–batch Production
left join OITL j on j.BaseType = ‘202’ and j.ApplyType = ’59’ and j.ItemCode = c.ItemCode
left join ITL1 k on k.sysnumber = i.SysNumber and k.itemcode = c.itemcode and k.LogEntry = j.LogEntry
left join OITL l on l.LogEntry = k.LogEntry and l.itemcode = c.ItemCode
where a.docdate >= [%0] and a.docdate <= [%1]
and ( (isnull(i.DistNumber,'') ”) and (isnull(k.quantity,0) 0) and (isnull(l.DocNum,”) ”) )


Menampilkan informasi lengkap dari Invoice hingga No Pruduction Order Selama Tanggal Tertentu

Actual Delivery Per Plant (OcrCode)

SELECT T0.[docentry] As ‘Num’, T0.[CreateDate], T0.[DocDate], T0.[DocNum] as ‘No. DO’, T1.[BaseDocNum] as ‘No. SO’, T0.[CardCode] As ‘BP Code’, T0.[CardName], T0.[NumAtCard], T1.[WhsCode] as ‘WHSE’, T1.[ItemCode], T1.[Dscription], T1.[Quantity], T1.[Price], T1.OCRCODE AS ‘PLANT’, T3.docnum as [No. return], t2.quantity as [Qty Return], ISNULL(T1.[Quantity]-T2.[Quantity],T1.[Quantity]) AS [NET QTY]

FROM ODLN T0
left JOIN DLN1 T1 ON T0.DocEntry = T1.DocEntry
LEFT JOIN RDN1 T2 ON T0.DOCENTRY=T2.BASEENTRY
LEFT JOIN ORDN T3 ON T2.[DocEntry] = T3.[DocEntry]

WHERE T0.[DocDate] between [%0] and [%1] and left(t1.whscode,3) = [%2] and T0.[Canceled] = ‘N’


menampilkan daftar Surat jalan berdasarkan Gudang (whscode), tanpa data yang di cancel.