存货核算现存量出错问题

分享到:

2015-04-19 22:25:16

标题: 存货核算现存量出错问题
问题现象: 当明细帐中的可用量是正数时,在填采购入库单时,上面显示的可用量是负数,这是怎么回事了?
原因分析: 现存量出错
问题答案: 请首先进行整理现存量的操作,如果不行,请使用以下语句,但前提是要保证明细帐是对的。 /********************************************************* 功 能:整理现存量,条件是当现存量不正确而明细账正确时执行 整 理:赵政 时 间:2005-5-25 **********************************************************/ if exists (select * from tempdb..sysobjects where type='u' and name='forcurrentsyz') drop table tempdb..forcurrentsyz go select a.cwhcode,a.cinvcode,sum(iquantity) as iquantity, sum(a.iquantity/Inventory.iInvExchRate) as inum into tempdb..forcurrentsyz from ( select cwhcode,cinvcode,iaInquantity as iquantity from ia_subsidiary where cvoutype='34' union all select cwhcode,cinvcode,( case when brdflag=1 then iquantity else -1*(iquantity) end) as iquantity from rdrecord left join rdrecords on rdrecord.id=rdrecords.id ) a left join Inventory on a.cinvcode=Inventory.cinvcode group by a.cwhcode,a.cinvcode go delete from currentstock Go insert into currentstock (cwhcode,cinvcode,iquantity,inum) select cwhcode,cinvcode,iquantity,inum from tempdb..forcurrentsyz go
声明:此篇为用友服务中心文章,转载请标明出处链接:
  • 相关文章
  • 热门下载
  • 数据修复
  • 热门标签
合作伙伴