生产加工单累计出库数不对

2018/4/11 23:31:51济南用友

产品版本: 302-用友T3-用友通标准版 适用产品: T3系列
产品模块: 18-库存管理 提交时间: 2012-06-12
问题现象:

生产加工单0000000002单据,为什么累计出库数量不对呢?
   分多次领料的,领料审核后,累计出库数量不对。
经核对,发现3号生产加工单存货编码为450901,累计出库是36,但是材料出库单是28.

原因分析:

执行以下脚本

解决方案:

执行以下脚本,改下生产加工单号

declare @sumiquantity int
declare @ccinvcode char(60)
declare @key char(60)

DECLARE tables_CURSOR CURSOR FOR
select cinvcode,sum(iquantity) from rdrecords where id in (select id from rdrecord where cbustype='生产加工' and cbuscode='0000000002' )
group by cinvcode

OPEN tables_cursor

FETCH NEXT FROM tables_cursor into @ccinvcode,@sumiquantity

WHILE @@FETCH_STATUS = 0
BEGIN
 
 
 
  update MatchVouchs
  set iSumActiQuantity=@sumiquantity
  where cInvCode=@ccinvcode and  cVouchCode='0000000002'


FETCH NEXT FROM tables_cursor into @ccinvcode,@sumiquantity

END

CLOSE tables_cursor
DEALLOCATE tables_cursor
GO

  • 设为首页
  • 济南用友|
  • 用友畅捷通软件山东济南销售服务中心|
  • 联系我们|
  • 鲁ICP备2021016587号-3
  • Copyright © 2021 山东一友信息科技有限公司