问题现象: | 存货核算模块:收发存汇总表与初始设置-期初余额中,期初数不一致。 期末处理时,期初数与以上两地方存货期初数又不一致。(大部分存货存在此问题) 数据已上传至FTP:U8WUXI华信雷达工程.rar 阮俞勇15895339379 |
问题原因: | |
解决方案: | 您好, 此问题【经查看数据/测试】现做如下分析与答复: 【问题原因】 1、对于收发存汇总表和期初余额,按照每个仓库去核对,发现只有03仓库不一致,其他仓库都一致。期初余额表中03仓库数量为2187.5,收发存汇总表中期初数量为2185,其原因是由于存货期初余额中有存货的编码为03013501,但是在存货档案中并没用该编码的记录,可能是后台删除过存货档案导致,所以收发存汇总表查询时没用包含03013501存货的数量和金额; 2、期末处理已经进行到10月,所以期初数与存货期初余额中的不一致是正常的,一个是年初数,一个是10月期初数。但是与收发存的10月份期初数不一致,则是因为存货总账有重复导致; 【解决方案】 1、由于已经做到10月份,无法恢复期初记账,将期初数据删除,所以请增加存货档案,存货编码为03013501; 2、对于存货总账重复的问题,请在查询分析器中针对帐套ufdata数据库,执行下面语句,进行修改: delete from IA_Summary where AutoID not in ( select MIN(autoid) as autoid from IA_Summary group by cWhCode,cInvCode,iMonth having COUNT(*)>=1) go update a set iinum=(case when a.iMonth=0 then null else b.iq end), iimoney=(case when a.iMonth=0 then null else b.ip end), ionum=(case when a.iMonth=0 then null else b.oq end), iomoney=(case when a.iMonth=0 then null else b.op end), imoney=(case when a.iMonth=0 then ip else ISNULL(ip,0)-ISNULL(op,0) end), inum=(case when a.iMonth=0 then iq else ISNULL(iq,0)-ISNULL(oq,0) end) from IA_Summary a left join ( select cWhCode,cInvCode,imonth,SUM(iainquantity) as iq,SUM(iaoutquantity) as oq,SUM(iAInPrice) as ip,SUM(iaoutprice) as op from IA_Subsidiary where cVouType<>'33' group by cWhCode,cInvCode,iMonth) b on a.cwhcode=b.cWhCode and a.cInvCode=b.cInvCode and a.iMonth=b.imonth go declare @imonth int set @imonth=0 while @imonth<10 begin update a set inum=ISNULL(b.iNum,0)+ISNULL(a.inum,0),iMoney=ISNULL(b.imoney,0)+ISNULL(a.imoney,0) from IA_Summary a inner join IA_Summary b on a.cWhCode=b.cWhCode and a.cInvCode=b.cInvCode where b.iMonth=@imonth and a.iMonth=b.iMonth+1 set @imonth=@imonth+1 end go 【注意事项】修改前请务必做好数据备份;由于网站的关系,上述语句中如有标点符号 ' % + 则必需在输入法为英文的状态下重新录入后再执行; |
相关补丁: | |
版本: | U8 V10.0 |
模块: | 存货管理 |
产品: | 供应链 |
问题名称: | 华信雷达存货收发存汇总表期初不正确 |
最后更新: | 2011-12-06 23:41:00 |