服务热线:

400-665-0027

知识资讯
联系我们

电话:400-665-0027


您当前位置:首页 > 知识资讯  > 知识学习 > 正文知识学习
金蝶专业版财务启用会计期间非第1期时,录入科目初始数据后,反算年期初科目数据异常 。
服务热线:400-665-0027 新购有特价、金蝶老客户升级金蝶云产品可以享受5折优惠,送手机、送话费,好礼不断!
【问题描述】
专业版财务启用会计期间非第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


【注意事项】

正式账套执行脚本前请先做好备份,建议待在测试账套中核实无误后再在正式账套中执行。