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')