问题现象: | 客户最早为10.0的验证版客户,近期设置“审核时检查货位”,发现货位现存量不正确。 10月份的时候,根据货位表InvPosition更新货位现存量表 InvPositionSum ,之后很快就发现又有核对不上的数据; 11月份,再次去更新InvPositionSum 表,发现验证版中存在问题: 以前月份未指定货位的,点击修改能重新补选择货位,但是保存的时 候一闪而过,保存不成功,在此时InvPositionSum 已经更新了,这 造成货位InvPosition和InvPositionSum 表不一致的原因。 11月底卸载验证版软件,重新安装正式发布软件,并打上最新的库存 和存货补丁,上述问题不存在了,但是一周之后发现又几百个存货核 对不上。 在现场模拟客户的业务,入库与出库均未发现有异常。希望集团能帮 忙分析原因。 数据已经上传FTP,文件名为:横滨 |
问题原因: | |
解决方案: | 您好, 此问题【经查看数据/测试】现做如下分析与答复: 执行脚本整理货位存量.处理方案:执行货位存量整理。加个触发器跟踪错误。如以后不再出现这个问题。将触发器可停掉,以免影响效率。 ----创建整理货位存量存储过程脚本 if exists(select * from sysobjects where type='P' and id=object_id('sp_clearpositionstock_st')) begin drop proc sp_clearpositionstock_st end GO create proc sp_clearpositionstock_st as if exists(select * from sysobjects where type='U' and id=object_id('InvPositionSumbak')) drop table InvPositionSumbak select * into InvPositionSumbak from InvPositionSum truncate table InvPositionSum insert into InvPositionSum(iQuantity,inum,cWhCode,cPosCode,cInvCOde,cBatch, cFree1,cFree2,cFree3,cFree4,cFree5,cFree6,cFree7,cFree8,cFree9,cFree10,cvmivencode,iTrackid,cInvouchtype) select sum((case when Inv.brdflag=1 then 1 when Inv.brdflag=0 then -1 else 0 end)*isnull(Inv.iquantity,0)), sum((case when Inv.brdflag=1 then 1 when Inv.brdflag=0 then -1 else 0 end)*isnull(Inv.inum,0)), Inv.cWhCode,Inv.cPosCode,Inv.cInvCode,isnull(Inv.cBatch,N''),isnull(Inv.cFree1,N''),isnull(Inv.cFree2,N''),isnull(Inv.cFree3,N''),isnull(Inv.cFree4,N''), isnull(Inv.cFree5,N''),isnull(Inv.cFree6,N''),isnull(Inv.cFree7,N''),isnull(Inv.cFree8,N''),isnull(Inv.cFree9,N''),isnull(Inv.cFree10,N''),isnull(Inv.cvmivencode,N''), isnull(Inv.iTrackid,0), isnull(Inv.cinvouchtype,N'') from InvPosition Inv group by Inv.cWhCode,Inv.cPosCode,Inv.cInvCOde,isnull(Inv.cBatch,N''),isnull(Inv.cFree1,N''),isnull(Inv.cFree2,N''), isnull(Inv.cFree3,N''),isnull(Inv.cFree4,N''),isnull(Inv.cFree5,N''),isnull(Inv.cFree6,N''),isnull(Inv.cFree7,N''), isnull(Inv.cFree8,N''),isnull(Inv.cFree9,N''),isnull(Inv.cFree10,N''),isnull(Inv.cvmivencode,N''), isnull(Inv.iTrackid,0), isnull(Inv.cinvouchtype,N'') GO ---执行整理货位存量 exec sp_clearpositionstock_st GO ---创建触发器跟踪错误 if exists(select * from sysobjects where type='tr' and id=object_id('tr_InvPositionQtyNum')) drop trigger tr_InvPositionQtyNum Go create trigger tr_InvPositionQtyNum on invposition for insert,update as if exists(select * from inserted where iquantity is null and inum is null) begin raiserror('数量和件数不能同时为空!',16,1) end GO 【注意事项】修改前请务必做好数据备份; 【提示】如有问题,敬请及时邮件联系 |
相关补丁: | |
版本: | U8 V10.0 |
模块: | 库存管理 |
产品: | 供应链 |
问题名称: | 10.0货位现存量不正确 |
最后更新: | 2011-12-15 23:32:44 |