跳至主要內容

生产收货明细查询(显示成品料号)

五六零网校小于 1 分钟

提示

逻辑:查询生产收货明细 条件:日期范围必选

代码示例

SELECT T0.[DocNum] AS '收货单号', T0.[DocDate], T1.[BaseRef] AS '生产订单号',TA.itemcode AS'产成品编号',TA.itemname AS'产成品描述',
T1.[ItemCode], T1.[Dscription]
	, T1.[Quantity], T1.[WhsCode], T2.[WhsName], T1.[Price] AS '物料成本', T1.[LineTotal]
FROM OIGN T0
	INNER JOIN IGN1 T1 ON T0.[DocEntry] = T1.[DocEntry]
	INNER JOIN OWHS T2 ON T1.[WhsCode] = T2.[WhsCode]
INNER JOIN 
(SELECT T0.docentry, T0.[ItemCode], T1.[ItemName] FROM OWOR T0 INNER JOIN  OITM T1 ON T0.itemcode=t1.itemcode ) TA ON TA.docentry=T1.[BaseRef] 
WHERE T1.[BaseType] = '202'
	AND T0.[DocDate] >= [%0]
	AND T0.[DocDate] <= [%1]
ORDER BY T0.[DocNum] DESC