专业版生产任务单上的实际领料数量异常?
【问题描述】
专业版生产任务单上的实际领料数量异常?
【原因分析】
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
【注意事项】
正式账套执行脚本前请先做好备份,建议待在测试账套中核实无误后再在正式账套中执行。
专业版生产任务单上的实际领料数量异常?
本文2024-09-22 15:54:56发表“kis知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-kis-84535.html