zoukankan      html  css  js  c++  java
  • 用友的凭证update

    select pk_glorgbook from bd_glorgbook where glorgbookcode='0100-0001';--0001N510000000006K4X
    select no,period,year,dr,pk_voucher from gl_voucher where no='68' and dr='0' and period='01' and year='2014' and 
    pk_glorgbook='0001N510000000006K4X';
    update gl_voucher set no='69' where pk_voucher='1162N51000000001YHZ3';
    update gl_detail set nov='69'where pk_voucher='1162N51000000001YHZ3';

     凭证整理无效,修改凭证号:

    select no,period,year,dr,gl_voucher.explanation, pk_voucher from gl_voucher where no in('153','156','154','287' )
    and dr='0' and period='04' and year='2014' and pk_glorgbook='0001N510000000006K4X' for update;

     可手工修改凭证:gl_detail有些没有no凭证,只好使用gl_voucher,下面的

    select pk_voucher from gl_voucher v where v.pk_glorgbook in  
    (select pk_glorgbook from bd_glorgbook where glorgbookcode='012101-0001')
    and v.dr=0 and  v.year=2014 and v.period=12 and v.no=55  --1076N510000000004GX8
    
    select d.explanation,d.modifyflag  from gl_detail d where d.pk_voucher='1076N510000000004GX8' for update --YYYYYYYYYYYYYYYY

    上面适合临时写

    整合

    select d.explanation, d.modifyflag,d.detailindex,d.pk_systemv
      from gl_detail d
     where d.pk_voucher in (select pk_voucher
                              from gl_voucher v
                             where v.pk_glorgbook in
                                   (select pk_glorgbook
                                      from bd_glorgbook
                                     where glorgbookcode = '012101-0001')--账簿
                               and v.dr = 0
                               and v.year = 2014  --年月凭证号
                               and v.period = 12
                               and v.no = 55 )  
       for update --YYYYYYYYYYYYYYYY

     2016.1.6更新结算中心

    从凭证整理看到重复凭证号,之后

    select v.explanation ,v.totalcredit,no
    from gl_voucher v  
    where no in('1','4','202','204' )
    and period='01' 
    and year='2015' 
    and pk_glorgbook='0001N510000000006K4X' 
    for update;

     以防万一的截图

  • 相关阅读:
    卸载驱动时,没有/lib/modules目录
    strcmp与strncmp的区别
    12864 显示多种图形
    环形缓冲区的应用ringbuffer
    环形缓冲区
    pthread_cond_wait 详解
    [置顶] 自己写一个简单通用的Makefile
    指针空间的申请与释放
    双向链表操作
    FreeType 管理字形
  • 原文地址:https://www.cnblogs.com/sumsen/p/4203933.html
Copyright © 2011-2022 走看看