专业版13.0 采购建议计算错误。很严重的错误!!!!!
金蝶云社区-奔跑的猴子
奔跑的猴子
0人赞赏了该文章 468次浏览 未经作者许可,禁止转载编辑于2016年06月13日 13:59:28

问题描述:制作 BOM 成品 456 子件789制作生产任务单,通过采购建议计算错误。



Create table #T_Produc(FItemID int,FProducQty decimal(23, 10) default 0,FAuxPropID int)
Insert Into #T_Produc select u1.FItemID,sum(IsNull(s.FQty,0)) as FProducQty,u1.FAuxPropID
From (select DISTINCT FInterID from #Data where FTranType=85) D
inner join ICMO v1 on D.FInterID=v1.FInterID
inner join ICMOEntry u1 on v1.FInterID=u1.FInterID
left join icstockbillentry S on s.FSourceinterid = u1.finterid and s.fsourceentryid = u1.fentryid
left join icstockbill S1 on s.finterid = s1.finterid where s1.FCheckerID > 0
group by u1.FItemID,u1.FAuxPropID ;
update #Data set FAuxProp =t1.FName From t_AuxItem t1 where #Data.FAuxPropID=t1.FItemID and #Data.FBomItemID>0

计算已领数量的时候 把 源单内码与生产任务单内码相同 的采购入库单也计算进来了