专业版财务启用会计期间非第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,FYtdD
专业版财务启用会计期间非第1期时,录入科目初始数据后,反算年期初科目数据异常
声明:除非特别标注,否则均为本站原创文章,转载时请以链接形式注明文章出处。如若本站内容侵犯了原著者的合法权益,可联系本站删除。



