生产齐套分析报表
小于 1 分钟
代码示例
SELECT T0.[DocNum],
CASE WHEN T0.[Status]='P'
THEN '已计划'
WHEN T0.status='R'
then '已下达'
end as '订单状态'
, T0.[ItemCode]AS'产成品', T0.[PlannedQty]AS'计划数量', T0.[CmpltQty]as'已生产完成数量',
T1.[ItemCode]as'子件编码', T2.[ItemName], T1.[PlannedQty]as'子件计划数量', T1.[IssuedQty],
T3.[OnHand]as'当前库存'
FROM OWOR T0
INNER JOIN WOR1 T1 ON T0.[DocEntry] = T1.[DocEntry]
INNER JOIN OITM T2 ON T2.itemcode=t1.itemcode
INNER JOIN OITW T3 ON T1.[ItemCode] = T3.[ItemCode]
WHERE
T0.[ItemCode]='[%1]' and T3.[WhsCode] =[%0] and T0.[Status] <>'C'
ORDER BY T0.[DocNum] desc