ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 库存现存量和库存台帐与存货收发存存汇总表不符合

库存现存量和库存台帐与存货收发存存汇总表不符合

原创 Linux操作系统 作者:vcdone 时间:2008-08-23 19:37:38 0 删除 编辑

前段时间在处理一个U8普及版用户的时候,碰到库存少了期初数,只好去修改数据库把核算期初读取过来,下面就是处理的脚本和过程,拿出来和用户共享。

 

库存里面--期初结存--录入期初的界面点击修改---引入--保存过账需要注意的是生成期初单据前执行1的脚本,然后生成期初单据后删除数量和金额为零的记录保存审核即可(正常不会存在为零的,因为是年结过来的所以有为零的要删除),每个仓库都要生成期初(做这些期间不要录入单据)

1、生成库存期初单据前执行 delete IA_Summary where imonth=0 and (inum=0 or imoney=0 or inum is null or imoney is null) select bfree1,bfree2,cinvcode into wjg from inventory where bfree1=1 or bfree2=1 update inventory set bfree1=0,bfree2=0

2、审核后执行脚本 update inventory set inventory.bfree1=wjg.bfree1,inventory.bfree2=wjg.bfree2 from inventory join wjg on inventory.cinvcode=wjg.cinvcode

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/15453181/viewspace-441443/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-08-25

  • 博文量
    83
  • 访问量
    146063