• 购买咨询:400-688-2139
  • |
  • 技术服务:021-52353507
  • |
  • VIP服务:021-52350222
当前位置:首页 > 知识中心 > 常见问题 > 速达5000系列 > 5000G3.74第一次业务结账时,选择自动检查库存成本发生异常的
快速办理通道
通过您提交的信息,我们将更好的为您提供服务!
业务类型:
公司名称:
联系人:
联系电话:
网商联盟
经销商资质查询
速达5000系列

5000G3.74第一次业务结账时,选择自动检查库存成本发生异常的

发布日期:2013-04-27   来源:上海速达  录入:上海速达软件  浏览次数:

上海速达软件建议您:

只能从后台修复数据:
--修复期初库存
insert into aa_storebalance 
select 2010 posyear,10 posmonth,storeid,goodsid,quantity bqty,
       price bprice,amount bamount,0.0 inqty,0.0 inamount,0.0 outqty,
       0.0 outamtqty,quantity eqty,price eprice ,amount eamount,quantity brqty,
       0.0 inrqty,0.0 outrqty,0.0 erqty,0.0 bextqty,0.0 inextqty,
       0.0 outextqty,0.0 eextqty,0.0 brextqty,0.0  inrextqty,0.0 outrextqty,
       0.0 erextqty 
  from aa_billflow 
  where billtype < 0 and quantity <> 0 and 
        cast(storeid as varchar(2))+cast(goodsid as varchar(20)) not in 
          (select cast(storeid as varchar(2))+ cast(goodsid as varchar(20)) 
             from aa_storebalance 
             where posyear = 2010 and posmonth =10 
          )
go
update aa_storebalance set bqty = bb.bqty 
  from aa_storebalance aa, 
    (select a.quantity bqty,a.goodsid,a.storeid  
        from aa_storebalance b,aa_billflow a 
        where a.goodsid=b.goodsid and a.storeid =b.storeid and b.posyear=2010 and b.posmonth=10 
              and b.bqty<>a.quantity and a.billtype < 0 and a.quantity <> 0
    ) as bb 
  where aa.storeid=bb.storeid and aa.goodsid=bb.goodsid and aa.posyear=2010 and aa.posmonth =10 
        and aa.bqty <> bb.bqty
go
--
这两个数应一致
select * from  
  (select sum(quantity) bqty from aa_billflow where billtype < 0 
   union  all
   select sum(bqty) bqty from aa_storebalance where posmonth =10 and posyear =2010
   ) as mm




分享到: