制作销售订单按期交货率统计报表
1、问题描述
创新互联自2013年起,先为依兰等服务建站,依兰等地企业,进行企业商务咨询服务。为依兰企业网站制作PC+手机+微官网三网同步一站式服务解决您的所有建站问题。
按照教科书的解释, 按期交货率就是用供应商按时交货的数量(或者金额, 或者订单行数), 除以该时间内应该交货的数量(或者金额,或者订单行数),在实际工作中,我们的统计方法是按订单的笔数来计算的,即同一个客户同一个交货日期为一笔订单,可能各家的计算方法稍有不同,但基本上大同小异。
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、效果展示
新闻名称:制作销售订单按期交货率统计报表
文章分享:http://ybzwz.com/article/jehhgi.html