金蝶k3和kis专业版旗舰版期初不平


金蝶k3和kis专业版旗舰版期初不平

----------------------------------------------------------------------------------

金蝶初始化期初余额试算平衡但是不让结束初始化又提示不平衡

原因1:会计科目的余额方向错误,

解决方案:调整科目方向(特别是外部导入的会计科目,科目方向不小心就错了)

--------------------------------------

 原因2:期初余额,调整后,没有及时点击保存按钮(导致数据库后台的数据没有及时更新)

         造成前段查看的数据和后台数据库的数据不一致造成的

解决方案:执行下面的sql检测,

--------------------------------------

--1>.计算汇总数据

--判断出汇总后的数据差多少钱,比如差1元,

 select b.fdc,sum(a.fbeginbalance) 

 from t_balance a join t_account b on a.faccountid=b.faccountid  

 ---where a.fyear=xxxx and a.fperiod=yy and a.fdetailid=0 and a.fcurrencyid=0 and b.fdetail=1 group by b.fdc

 where a.fyear=2017 and a.fperiod=1 and a.fdetailid=0 and a.fcurrencyid=0 and b.fdetail=1 group by b.fdc


--------------------------------------

--2>.查询明细数字

--在记录中找到期初会计科目为1元的,分录

 select a.* ,b.* 

 from t_balance a join t_account b on a.faccountid=b.faccountid  

 ---where a.fyear=xxxx and a.fperiod=yy and a.fdetailid=0 and a.fcurrencyid=0 and b.fdetail=1 group by b.fdc

 where a.fyear=2017 and a.fperiod=1 and a.fdetailid=0 and a.fcurrencyid=0 and b.fdetail=1 group by b.fdc


----------------------------------------

--3.1>.进入金蝶的科目初始数据中,在哪个差的会计科目中填写差额,比如1元

--3.2>.点击,保存按钮后,试算结果肯定不平衡,

--3.3>.在将刚才补充的那个科目金额,比如1元,删除,

--3.4>点击,保存按钮后,再次试算平衡后,

--3.5>结束初始化,发现可以结束了


-----------------------------------------

--以下内容为从网络搜集的sql语句,参考使用,这里感谢作者的思路

DELETE from t_balance where FCurrencyID = 0

INSERT INTO

[t_Balance]([FYear], [FPeriod], [FAccountID],[FDetailID],[FCurrencyID],[FBeginBalanceFor],[FDebitFor],[FCreditFor],

[FYtdDebitFor], [FYtdCreditFor],[FEndBalanceFor],[FBeginBalance], [FDebit], [FCredit], [FYtdDebit], [FYtdCredit], [FEndBalance], [FFrameWorkID])

SELECT [FYear], [FPeriod], [FAccountID],[FDetailID],0, [FBeginBalanceFor], [FDebitFor], [FCreditFor], FYtdDebitFor],

[FYtdCreditFor], [FEndBalanceFor],[FBeginBalance], [FDebit], [FCredit],[FYtdDebit],[FYtdCredit], [FEndBalance], [FFrameWorkID]

FROM [t_Balance]

WHERE FCurrencyID =1


--------------------------------------------