• 1
  • 2
  • 3
  • 4
  • 5

热门关键词用友BIP 用友U9 用友NC 用友U8 OA T+ 好业财

详细信息

您现在的位置:网站首页 >> 百科问答 >> 详细信息

用友T+保留基础档案复制账套

发布时间:2024-11-18  

人工客服

特价活动:>>>> 用友U8、T6、T+、T3软件产品4折优惠,畅捷通T+cloud、好会计、易代账、好业财、好生意云产品8折优惠 

应用场景:客户想将原来的账套数据清空,重新更改账套的启用年度和月份
注  意:会计期间的删除只保留当前启用年度的期间;
另外执行完语句,模块的启用到软件中重新启用。

declare @UFTSystemName nvarchar(100)='UFTSystemDec'    --注意系统数据库名称,如果是旧版本T+,没有Dec
declare @UFTdataName nvarchar(100)='UFTData787759_000999'   --输入要更改的账套数据库名称
declare @cAcc_Num int=999    --输入要更改的账套号,注意前面没有0,如:000001账套,就输入1
declare @iYear int=2021    --输入要重新启用的会计年度

declare @iMonth int=2    --输入要重新启用的会计期间

--更改系统数据库账套表中的启用年度和启用期间
EXEC('update '+ @UFTSystemName+'..EAP_Account set iYear='+@iYear+',iDuration='+@iMonth+' where cAcc_Num='+@cAcc_Num)
--更改账套数据库里的启用年度
EXEC('update '+ @UFTdataName+'..EAP_AccInformation set Value='+@iYear+'  where (InfoID=''500'' and name=''EnableYear'' and Caption=''启用年度'')')
--更改账套数据库里的启用期间
EXEC('update '+@UFTdataName+'..EAP_AccInformation set Value='+@iMonth+'  where (InfoID=''501'' and name=''EnablePeriod'' and Caption=''启用期间'')')
--删除账套库里启用年度之前年度无用的会计期间记录
EXEC('delete from '+@UFTdataName+'..SM_Period where currentyear<'+@iYear)
--更改会计期间表字段
EXEC('update '+ @UFTdataName+'..SM_Period set  BizTerminalState=1,FiTerminalState=1  where currentyear='+@iYear+' and currentperiod<'+@iMonth)
EXEC('update '+ @UFTdataName+'..SM_Period set  BizTerminalState=0,FiTerminalState=0 where currentyear='+@iYear +' and currentperiod>='+@iMonth)
--修正账套库里模块启用对应的会计期间ID
EXEC('update '+ @UFTdataName+'..EAP_AccInformation set idEnablePeriod=(select id from '+@UFTdataName+'..SM_Period where currentyear='+@iYear+' and currentperiod='+@iMonth+') where OptionType=1 and idEnablePeriod>0')

 

 

上一篇:t+抵销设置生成抵销分录提示请至少填写两条明细

客服电话:400-665-0028

关键字:用友财务软件,畅捷通软件,财务软件,进销存软件,U9官网,用友U8,用友T1,用友T+,用友T3,用友T6,畅捷通好会计,好生意,智+好业财,用友培训服务售后公司,畅捷通运营培训服务公司

版权所有:用友畅捷通软件 Copyright © 2025 All rights reserved.

鲁ICP备2020041017号-6

人工在线客服,如需要,请转人工。

T+云财税(总账、报表)特价2998。

好会计7.5折惠活动,更有话费送,需要了解吗?

好生意特价7折优惠。

好业财特价活动,限时7折优惠。

用友T3升级好会计,限时5折活动。