服务热线:

400-665-0027

知识资讯
联系我们

电话:400-665-0027


您当前位置:首页 > 知识资讯  > 知识学习 > 正文知识学习
金蝶专业版kis生产任务单上的实际领料数量异常?
服务热线:400-665-0027 新购有特价、金蝶老客户升级金蝶云产品可以享受5折优惠,送手机、送话费,好礼不断!
【问题描述】
专业版生产任务单上的实际领料数量异常?

【原因分析】
ICMOEntry生产任务分录表的实际领料数量FDiscountQty、FAuxDiscountQty反写异常导致。

【解决方案】
可参考以下脚本执行处理:
declare @sql varchar(max)
set @sql = replace(( replace( (replace( (replace( (convert(varchar(100),getdate(),121)),char(32),'')) ,char(45),'' )), char(58),'')) ,char(46),'')
set @sql = 'temp_ICMOEntry_' + @sql
set @sql = 'select b.* into ' + @sql + '
From ICMO a
Inner Join ICMOEntry b On a.FInterID = b.FInterID
Left Join
(Select FMOInterID,FMOEntryID,FItemID,isnull(Sum(fqty),0) fqty
From ICStockBill a
Inner Join ICStockBillEntry b On a.FInterID = b.FInterID
Where FTranType = 24 and fcancellation=0
Group By FMOInterID,FMOEntryID,FItemID
) c On a.FInterID = c.FMOInterID And b.FEntryID = c.FMOEntryID
Inner Join t_ICItem e On b.FItemID = e.FItemID
Inner Join t_MeasureUnit f On b.FUnitID = f.FMeasureUnitID
Where b.FDiscountQty <> isnull(c.fqty,0)'
exec (@sql)
go

Update b Set b.FDiscountQty=isnull(c.fqty,0),FAuxDiscountQty=isnull(c.fqty,0) / FCoefficient
From ICMO a
Inner Join ICMOEntry b On a.FInterID = b.FInterID
Left Join
(Select FMOInterID,FMOEntryID,FItemID,isnull(Sum(fqty),0) fqty
From ICStockBill a
Inner Join ICStockBillEntry b On a.FInterID = b.FInterID
Where FTranType = 24 and fcancellation=0
Group By FMOInterID,FMOEntryID,FItemID
) c On a.FInterID = c.FMOInterID And b.FEntryID = c.FMOEntryID
Inner Join t_ICItem e On b.FItemID = e.FItemID
Inner Join t_MeasureUnit f On b.FUnitID = f.FMeasureUnitID
Where b.FDiscountQty <> isnull(c.fqty,0)
Go

【注意事项】
正式账套执行脚本前请先做好备份,建议待在测试账套中核实无误后再在正式账套中执行。