您好,登錄后才能下訂單哦!
1、問題描述
按照教科書的解釋, 按期交貨率就是用供應商按時交貨的數量(或者金額, 或者訂單行數), 除以該時間內應該交貨的數量(或者金額,或者訂單行數),在實際工作中,我們的統計方法是按訂單的筆數來計算的,即同一個客戶同一個交貨日期為一筆訂單,可能各家的計算方法稍有不同,但基本上大同小異。
2、實現方法
2.1 用分組實現訂單筆數的統計,用序號來代表,一個序號代表一筆訂單:
2.2 用SQL把與銷售訂單對應的生產任務單、產品入庫單數據提取出來,前提是必須進行了MRP運算,并且不允許手工合并相關需求單據且不得手工下達生產任務單,否則會因為各單據之間沒有關聯而無法獲取數據,語句如下:
- SELECT * FROM (SELECT t1.FBillNo,u1.FName AS FCustID,case when u1.FName='零售戶' then '預測訂單' else '銷售訂單' end as FCustID1,t1.FDate,
- u2.FName AS FEmpID,
- case when t1.FMultiCheckLevel1=16403 or t1.FMultiCheckLevel1=16507 then '昆崳路工廠'
- else '四產路工廠' end
- AS fparentid,t2.FEntryID,t100.FNumber,t100.FName,t100.FModel,
- CASE WHEN t2.FUnitID=0 THEN '' ELSE u4.FName END AS FUnitID,
- t2.FAuxQty As FQty,t2.FDate AS FOutStockDate,t2.FAdviceConsignDate,u5.FBOMNumber,t1.FInterID
- ,t2.FAuxStockQty as FStockQty,t51.FName as FCUUnitID,t2.FQty/t51.FCoefficient as FCUQty,
- t2.FStockQty/t51.FCoefficient as FCUStockQty
- ,cast(t2.finterid as varchar)+cast(t2.fentryid as varchar) finteridfentryid,t800.fqty fstockqty1,t800.fcheckdate,t2.FHaveMrp,t1.FExchangeRate,t2.fauxpricediscount,t900.fqty fqty900
- FROM SEOrder t1 INNER JOIN SEOrderEntry t2 ON t1.FInterID = t2.FInterID and t1.fstatus in (1,2,3)
- and t1.FChangeMark=0 AND Isnull(t1.FClassTypeID,0)<>1007100 and t2.FMrpAutoClosed in ${是否手工行關閉} left outer join icmo t900 on t900.FOrderInterID =t2.FInterID and t900.FSourceEntryID=t2.FEntryID and t900.fitemid=t2.fitemid
- left outer join (select b.FICMOInterID,b.fitemid,b.fqty,a.fdate as fcheckdate from icstockbill a join icstockbillentry b
- on a.finterid=b.finterid where a.ftrantype=2 and a.fstatus=1) t800 on t800.FICMOInterID=t900.finterid
- LEFT OUTER JOIN t_Organization u1 ON t1.FCustID=u1.FItemID
- LEFT OUTER JOIN t_Emp u2 ON t1.FEmpID=u2.FItemID
- LEFT OUTER JOIN t_ICItem t100 ON t2.FItemID = t100.FItemID
- LEFT OUTER JOIN t_MeasureUnit u4 ON t2.FUnitID = u4.FItemID
- LEFT OUTER JOIN t_MeasureUnit t51 ON t100.FProductUnitID=t51.FItemID
- LEFT OUTER JOIN ICBOM u5 ON t2.FBomInterID = u5.FInterID ) tt
- WHERE 1=1 and tt.FOutStockDate>='${開始日期}' and tt.FOutStockDate<='${結束日期}'
- and tt.FCustID1='銷售訂單' and tt.FNumber>'3.01'
- ${if(len(fparentid)==0,"","and fparentid = '"+fparentid+"'")}
- order by ${cname} ${orderby}
3、效果展示
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。