跳至主要內容

销售发运计划

五六零网校小于 1 分钟

示例代码

SELECT t0.DocEntry AS 销售订单,
       t0.DocNum,
       t0.CardCode AS 客户,
       t0.CardName AS 名称,
       t0.NumAtCard,
       t0.DocDate,
       t1.ShipDate,
       t1.ItemCode,
       t1.Dscription AS 描述,
       t1.Quantity AS 原始数量,
       t1.OpenCreQty AS 未交货数量,
       T1.WhsCode AS 发货仓库,
       t3.OnHand AS 库存量,
       t3.IsCommited AS 已承诺,
       t3.OnOrder AS 已订购,
       t3.OnHand + t3.OnOrder - t3.IsCommited AS 可用量,
       t2.SlpName
  FROM ORDR t0
       INNER JOIN RDR1 t1
          ON t0.DocEntry = t1.DocEntry
       LEFT OUTER JOIN OITW T3
          ON t1.ItemCode = t3.ItemCode AND t1.WhsCode = t3.WhsCode
       LEFT OUTER JOIN OSLP t2
          ON t0.SlpCode = t2.SlpCode
 WHERE t0.CANCELED = 'N' AND t0.DocStatus <> 'C' AND t1.OpenCreQty <> 0
ORDER BY t1.ShipDate