北京用友北京用友

您所在的位置:首页 -> 常见问题 -> 用友T3常见问题
T3软件反记账后无法再次记账的增强版脚本
浏览:213次 评论:0条 发表日期:2022-08-14 12:48:13作者:
Tags:
 
 
 
 
 
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
 
 
 
--合并文件:D:\用友通10.2源代码\Tong_10.2_Project_Release_Dev\YYJC_Tong\Comp_Tong\script\UFDATA\DATA_PRP_GL.sql
--合并时间:2007-5-8 16:55:43
/**********修改并发问题,给存贮过程的临时表增加随机数***********************************************/
--未审核也能记账
ALTER    Proc [dbo].[GL_P_JZA](@iPer tinyint = 11, @ccash tinyint =1, @tcond varchar(5000)= '') AS
SET NOCOUNT On
declare @ss varchar(8000)
--ll  Tong2005B 
declare @Checkflag varchar(20)  
declare  @trnd bigint
set @trnd=(select convert(bigint,rand()*100000000000)) 
        declare @temptable varchar(50)
declare @temptable2 varchar(50)
set @temptable='GL_jztmp'+ convert(varchar(30),@trnd)  
    set @temptable2='gl_bookB'+ convert(varchar(30),@trnd) 
set @Checkflag =  (SELECT cvalue FROM AccInformation WHERE cSysID='GL' AND cName='bNotCheckJz')
------------------------------
Delete From GL_mpostcond1
if @ccash=0
begin
  --ll Tong2005B 
  if  @Checkflag = 'False' 
     set @ss='SELECT iperiod,isignseq,ino_id From gl_accvouch where ibook=0 and iperiod= '+convert(char,@iPer,0)
          +(case when @tcond='' then '' else ' and (' + @tcond + ')' end)+' and (not (ccheck is null) and iflag is null or ccheck is null and iflag=1) GROUP BY iperiod,isignseq,ino_id'
  else 
     set @ss='SELECT iperiod,isignseq,ino_id From gl_accvouch where ibook=0 and iperiod= '+convert(char,@iPer,0)
         +(case when @tcond='' then '' else ' and (' + @tcond + ')' end)+' and (iflag is null or ccheck is null and iflag=1) GROUP BY iperiod,isignseq,ino_id' 
  -----------------------------  
  Insert GL_mpostcond1 exec (@ss)
End
Else
begin
if not object_id('tempdb..'+@temptable) is null
exec('drop table tempdb..'+ @temptable)
  --ll Tong2005B 
  if  @Checkflag = 'False'  
       set @ss='SELECT isignseq,ino_id,1 as zt into tempdb..'+@temptable+' FROM gl_accvouch inner join code  ON gl_accvouch.ccode =  code.ccode
           where ibook=0 and iperiod= '+convert(char,@iPer,0)+(case when @tcond='' then '' else ' and (' + @tcond + ')' end)
            +' and ((code.bbank ^ code.bcash) =1) and ((not (ccheck is null)) and (ccashier is null)) GROUP BY isignseq,ino_id
            Union SELECT isignseq,ino_id,0 as zt From gl_accvouch where ibook=0 and iperiod= '+convert(char,@iPer,0)
           +(case when @tcond='' then '' else ' and (' + @tcond + ')' end)+' and (not (ccheck is null) and iflag is null or ccheck is null and iflag=1) GROUP BY isignseq,ino_id'
   else 
        set @ss='SELECT isignseq,ino_id,1 as zt into tempdb..'+@temptable+'  FROM gl_accvouch inner join code  ON gl_accvouch.ccode =  code.ccode
           where ibook=0 and iperiod= '+convert(char,@iPer,0)+(case when @tcond='' then '' else ' and (' + @tcond + ')' end)
            +' and ((code.bbank ^ code.bcash) =1) and (ccashier is null) GROUP BY isignseq,ino_id
            Union SELECT isignseq,ino_id,0 as zt From gl_accvouch where ibook=0 and iperiod= '+convert(char,@iPer,0)
           +(case when @tcond='' then '' else ' and (' + @tcond + ')' end)+' and (iflag is null or ccheck is null and iflag=1) GROUP BY isignseq,ino_id'
   ------------------------------   
   exec (@ss)
 
exec('SELECT isignseq,ino_id,sum(zt) as zt1 into tempdb..' + @temptable2 + ' from tempdb..'+@temptable+'  group by isignseq,ino_id')
set @ss='select '+convert(char,@iPer,0)+' as iperiod,isignseq,ino_id from tempdb..' + @temptable2 + ' Where zt1 = 0 '+(case when @tcond='' then '' else ' and (' + @tcond + ')' end)
insert GL_mpostcond1 exec (@ss)
 
if not object_id('tempdb..'+@temptable2) is null
exec('drop table tempdb..'+ @temptable2)
    End
 
GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
上一篇服务器扫描工具
下一篇T3-如何设置自定义纸型

最新文章

用友T3软件如何出财务报表-生成资产负债表-图文教程
用友T3软件如何进行期间损益结转(损益类科目结转到
用友T3软件如何反月结(取消结账)-图文教程
用友T3软件反记账凭证(凭证取消记账)图文教程
用友T3软件如何反记账(取消记账操作)
用友T3软件如何反结账(取消结账操作)
最新图文教程

北京用友远程维护收

用友T3软件如何出财

用友T3软件如何进行

T+云主机版怎么修改

用友T3软件如何反月

用友T3软件反记账凭

用友T3软件怎么反审

用友T+软件直接收款

热门文章

[09-15]
[10-08]
[10-26]
[10-15]
[05-13]
[09-18]

推荐文章

相关文章

在线咨询
售后支持
  • 业务电话:010-84986180
  • 13720089039
  • 夜间值班:18910108696
  • 北京会计QQ群:6388368