科目余额表中部分客户显示两行数据记录
2012-11-01 08:55
169 查看
问题描述
科目余额表过滤本期,科目选择'应收账款',显示核算项目,报表显示
有部分客户显示两行数据,正确数据为这两行数据之和
备份账套后请参考如下方法处理:
本文出自 “金蝶软件技术服务” 博客,请务必保留此出处http://stkingdee.blog.51cto.com/4991988/1046319
科目余额表过滤本期,科目选择'应收账款',显示核算项目,报表显示
有部分客户显示两行数据,正确数据为这两行数据之和
问题原因
这种情况一般是由于核算项目横表中被凭证表、余额表引用的核算项目组
合有重复记录导致
解决方法
备份账套后请参考如下方法处理:
Use AIS2009###### --(指问题账套的账套号)
(1)创建临时表t_itemdetail_error,把重复核算项目记录插入该表
select a.*, a.fdetailid Fdetailid_temp
into t_itemdetail_error
from t_itemdetail a join t_itemdetail b on a.f1=b.f1 and
a.fdetailcount=b.fdetailcount
where a.fdetailcount=1 and a.fdetailid<>b.fdetailid
and a.f1>0
order by a.f1
(2)在临时表t_itemdetail_error中修改错误的fdetailid值(以最小的fdetailid值为基准):
update b set b.fdetailid_temp=a.fdetailid
from t_itemdetail_error a join t_itemdetail_error b on a.f1=b.f1 and
a.fdetailcount=b.fdetailcount
where a.fdetailcount=1 and a.fdetailidand a.f1>0
(3)创建余额表临时表t_balance_temp :
select * into t_balance_temp from t_balance
order by fyear,fperiod,faccountid,fdetailid,fcurrencyid
(4)更新余额表临时表的错误detailid值:
update a set a.fdetailid=b.fdetailid_temp
from t_balance_temp a join t_itemdetail_error b on a.fdetailid=b.fdetailid
(5)创建临时表temp002:
select top 0 * into temp002 from t_balance
(6)合并t_balance_temp 相同核算项目项的金额,把结果插入temp002:
insert into temp002
(fyear,fperiod,faccountid,fdetailid,fcurrencyid,FFrameWorkID,
FBeginBalanceFor,FDebitFor,FCreditFor,FYtdDebitFor,FYtdCreditFor,FEndBalanceFor,
FBeginBalance,FDebit,FCredit,FYtdDebit,FYtdCredit,FEndBalance,FIsAdjustPeriod)
select fyear,fperiod,faccountid,fdetailid,fcurrencyid,FFrameWorkID,
sum(FBeginBalanceFor)FBeginBalanceFor,sum(FDebitFor)FDebitFor,sum(FCreditFor)FCreditFor,
sum(FYtdDebitFor)FYtdDebitFor,sum(FYtdCreditFor)FYtdCreditFor,sum(FEndBalanceFor)FEndBalanceFor,
sum(FBeginBalance)FBeginBalance,sum(FDebit)FDebit,sum(FCredit)FCredit,sum(FYtdDebit)FYtdDebit,
sum(FYtdCredit)FYtdCredit,sum(FEndBalance)FEndBalance,sum(FIsAdjustPeriod)FIsAdjustPeriod
from t_balance_temp
group by fyear,fperiod,faccountid,fdetailid,fcurrencyid,FFrameWorkID
(7)清空t_balance数据 :
delete from t_balance
(8)把temp002的值写回t_balance:
insert into t_balance
(fyear,fperiod,faccountid,fdetailid,fcurrencyid,FBeginBalanceFor,FDebitFor,FCreditFor,FYtdDebitFor,
FYtdCreditFor,FEndBalanceFor,FBeginBalance,FDebit,FCredit,FYtdDebit,FYtdCredit,FEndBalance,FFrameWorkID,FIsAdjustPeriod)
select
fyear,fperiod,faccountid,fdetailid,fcurrencyid,FBeginBalanceFor,FDebitFor,FCreditFor,FYtdDebitFor,
FYtdCreditFor,FEndBalanceFor,FBeginBalance,FDebit,FCredit,FYtdDebit,FYtdCredit,FEndBalance,FFrameWorkID,FIsAdjustPeriod
from temp002
(9)删除t_itemdetail中的重复值:
delete from t_itemdetail
where fdetailid in (select fdetailid from t_itemdetail_error)
and fdetailid not in (select fdetailid_temp from t_itemdetail_error)
(10)更新纵表:
exec sp_cleanitemdetailv
(11)更正凭证分录数据:
update a set a.fdetailid=b.fdetailid_temp
from t_voucherentry a join t_itemdetail_error b on a.fdetailid=b.fdetailid
where a.fdetailid<>b.fdetailid_temp
本文出自 “金蝶软件技术服务” 博客,请务必保留此出处http://stkingdee.blog.51cto.com/4991988/1046319
相关文章推荐
- 在Visual C#中用ListView显示数据记录
- Silverlight 教程第五部分:用 ListBox 和 DataBinding 显示列表数据 (木野狐译)
- ASP.NET 2.0数据教程之三十一 使用DataList来一行显示多条记录
- ASP编程入门进阶(二十):ADO组件之显示数据记录
- gridview如何将一行记录显示为两行
- asp.net Repeater控件用法----一列数据在Repeater中每行显示固定记录方法
- 在Visual C#里面用ListView显示数据记录
- 利用ASP实现Oracle数据记录的分页显示
- 将项目发布到云主机,插入记录时显示错误:将截断字符串或二进制数据。
- Repeater在无数据记录时显示类似GridView空模板(EmptyDataTemplate)
- Silverlight教程第五部分:用 ListBox 和 DataBinding 显示列表数据 (木野狐译)
- 获取ListView显示数据的行数 记录数
- PowerBuilder数据窗口中记录颜色的隔层显示
- 收藏 不显示删除回复显示所有回复显示星级回复显示得分回复 为什么有时候ASP在插入一条记录时,它会在数据里面插入两条一样的记录?
- SAP财务模块中,科目余额表中的数据存在数据库的哪张表中?
- Silverlight 中文教程第五部分:用 ListBox 和 DataBinding 显示列表数据 (木野狐译)
- table中数据太长部分显示
- highcharts y轴数据接近最大值时(部分)数据不显示问题
- android gridview默认显示部分数据,点击按钮显示全部,再点击回到默认状态,选中变颜色
- (译)Silverlight教程第五部分:用 ListBox 和 DataBinding 显示列表数据