集团部张**要求
报表的难点与痛点:
3.1、《发货通知单》----想了解还有多少没有发完或没有发货?
3.2、《调拨单--发货》----处理打包发货的数据:
3.3、《调拨单--退货》
常用的报表内容:
1、《发货通知单》--《调拨单》来明确有多少货没有发或已发:
2、报表的内码:
发货通知单:内码:
调拨单:内码:
发货通知单: seoutstock
fdate fempid fbillno fcheckdate
日期 业务员 单据编号 审核人
发货通知单分录:seoutstockentry
fentryid fitemid forderbillno forderentry fqty fauxcommitqty fstockqty
分录号 物料内码 订单编号 订单分录 数量 调拨出库数量 出库数量
调拨单:icstockbill -ftrantype='41'
fdate fbillno ftrantype ‘
日期 订单编号 单据类型-调拨单类型
调拨单分录内码:icstockbillentry
fentryid fitemid fqty forderbillno forderentry
分录号 物料内码 数量 订单编号 订单分录
----发货通知单信息
set nocount on
select a.fdate , a.fbillno , c.FName as fywname , b.fentryid ,b.fitemid , b.fqty , b.fcommitqty ,b.FOrderBillNo ,b.FOrderEntryID
into #tempT1
from seoutstock a
left join seoutstockentry b on b.finterid=a.finterid
left join t_Emp c on c.FItemID=a.fempid
where a.FCancellation='0' and a.fdate>='********' AND a.FDate<='########' and c.FName='张林伟'
ORDER BY A.FDate
select a.fbillno as fchgbillno, a.fdate as fchgdate ,
b.fitemid , b.forderbillno , b.FOrderEntryID
into #tempT2
from icstockbill a
left join icstockbillentry b on b.finterid=a.finterid
where a.ftrantype='41' and a.fdate>='********'
select a.fbillno as fddbillno , b.fentryid as fddentryid , b.fitemid ,b.fentryselfs0175
into #tempT3
from seorder a
left join seorderentry b on b.finterid=a.finterid
where a.FCancellation=0 and a.fdate>='********'
select t1.fdate , t1.fbillno ,
t1.fywname,
t1.fentryid,
t1.fitemid , d.fnumber ,d.fname,
t1.fqty ,t1.fcommitqty,
t2.fchgbillno ,t2.fchgdate,
t2.forderbillno,t3.fentryselfs0175
from #tempT1 t1
left join #tempT2 t2 ON T2.fitemid=t1.fitemid and t2.forderbillno=t1.forderbillno and t2.forderentryid=t1.forderentryid
left join #tempT3 t3 on t3.fitemid=t1.fitemid and t3.fddbillno=t1.forderbillno and t3.fddentryid=t2.forderentryid
left join t_icitem d on d.fitemid=t1.fitemid
order by t1.FDate ,t1.FBillNo
drop table #tempT1
drop table #tempT2
drop table #tempT3