【问题场景】:
现金流量表的金额和联查的现金流量的金额不一致问题排查思路-查询分析器里排查
【分析说明】:
1、现金流量记录币别ID为空
排查sql:
select * from t_gl_cashflowrecord where fcurrencyid is null and FPrimaryItemID = '主表项目id'and FSupplementaryItemID = '附表项目id'
根据实际场景选择有问题的主表项目或者附表项目id去排查
2、现金流量记录的分录ID或对方分录ID不存在
排查sql:
--查询对方分录ID不存在数据
select cf.* from T_GL_CashflowRecord cf
left join t_gl_voucherentry ve on cf.FOpposingAccountEntryID=ve.fid
where cf.FOpposingAccountEntryID is not null and ve.fid is null and FPrimaryItemID = '主表项目id'and FSupplementaryItemID = '附表项目id'
--查询分录ID不存在数据 select * from T_GL_CashflowRecord cf left join t_gl_voucherentry ve on cf.FEntryID=ve.fid where cf.FEntryID is not null and ve.fid is null and FPrimaryItemID = '主表项目id'and FSupplementaryItemID = '附表项目id'
3、现金流量记录的科目ID是对照前旧科目表里的科目ID
排查sql:
select * from T_GL_CashflowRecord TGC inner join t_bd_accountview TBA on TGC.FACCOUNTID = TBA.FID where TBA.faccounttableid<>'当前启用的科目表id'
【处理方案】:
后台根据流量记录的分录ID,修复此类数据(注意:后台修复数据前请备份,不熟悉系统逻辑的,请提单处理)
推荐阅读