专业版财务启用会计期间非第1期时,录入科目初始数据后,反算年期初科目数据异常
【问题描述】
专业版财务启用会计期间非第1期时,录入科目初始数据后,反算年期初科目数据异常
【原因分析】
原因:t_Balance表第1期数据异常
【解决方案】
可参考以下脚本执行处理:
declare @startyear int,@startperiod int
select @startyear=convert(int,FValue) from t_SystemProfile where FCategory='gl' and FKey='startyear'
select @startperiod=convert(int,FValue) from t_SystemProfile where FCategory='gl' and FKey='startperiod'
select * into #t_balancebak from t_balance
delete from t_balance where fperiod=1 and fyear=@startyear
alter table t_balance NOCHECK CONSTRAINT chk_balance
insert into t_balance
select @startyear as fyear ,1 as fperiod,FAccountID,FDetailID,FCurrencyID,
0 as FBeginBalanceFor, 0 as FDebitFor,0 as FCreditFor,FYtdDebitFor-FDebitFor,FYtdCreditFor-FCreditFor, FBeginBalanceFor as FEndBalanceFor,
0 as FBeginBalance,0 as FDebit, 0 as FCredit,FYtdDebit-FDebit,FYtdCredit-FCredit, FBeginBalance as FEndBalance,FFrameWorkID
from #t_balancebak where fperiod=@startperiod and fyear=@startyear
update t_balance set FDebitFor=FYtdDebitFor,FCreditFor=FYtdCreditFor,FDebit=FYtdDebit,FCredit=FYtdCredit
,FBeginBalanceFor =FEndBalanceFor-(FYtdDebitFor-FYtdCreditFor),FBeginBalance =FEndBalance-(FYtdDebit-FYtdCredit)
where fyear=@startyear and fperiod=1
alter table t_balance CHECK CONSTRAINT chk_balance
drop table #t_balancebak
go
【注意事项】
正式账套执行脚本前请先做好备份,建议待在测试账套中核实无误后再在正式账套中执行。
专业版财务启用会计期间非第1期时,录入科目初始数据后,反算年期初科目数据异常
本文2024-09-22 15:54:45发表“kis知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-kis-84518.html