问题现象: |
固定资产原值一览表与统计表不一致问题:固定资产中“固定资产原值一览表”中的累计折旧与统计表不一致,统计表错。执行重算固定资产总帐的脚本后,问题依然。 |
问题原因: |
某些卡片当月作减少注销后,fa_DeprTransactions、fa_DeprTransactions_Detail表中的本月的累计折旧字段值并没有被清0。 |
解决方案: |
在2004年度数据库中针对1至12月份每个会计期间参照执行如下脚本,以修正fa_DeprTransactions、fa_DeprTransactions_Detail表中数据,如下例子是修正12月份数据的脚本:
declare @LoginDate DateTime
SET @LoginDate='2004-01-31'
update d
set D.dblDeprT1=0
FROM ((SELECT Max([sCardID]) AS sCardID FROM fa_Cards WHERE ( (dInputDate<=@LoginDate) AND (dTransDate<=@LoginDate Or dTransDate Is Null) AND (dDisposeDate<=@LoginDate Or dDisposeDate Is Null)) GROUP BY sCardNum ) AS fq INNER JOIN fa_Cards c ON c.sCardID = fq.sCardID) INNER JOIN fa_Cards_Detail cd ON c.sCardID = cd.sCardID INNER JOIN fa_DeprTransactions_Detail D ON cd.sCardNum = d.sCardNum and cd.sDeptNum = d.sDeptNum WHERE (c.dDisposeDate) Is NOT Null AND D.dblDeprT1<>0 update d set D.dblDeprT1=0 FROM ((SELECT Max([sCardID]) AS sCardID FROM fa_Cards WHERE ( (dInputDate<=@LoginDate) AND (dTransDate<=@LoginDate Or dTransDate Is Null) AND (dDisposeDate<=@LoginDate Or dDisposeDate Is Null)) GROUP BY sCardNum ) AS fq INNER JOIN fa_Cards c ON c.sCardID = fq.sCardID) INNER JOIN fa_Cards_Detail cd ON c.sCardID = cd.sCardID INNER JOIN fa_DeprTransactions D ON cd.sCardNum = d.sCardNum WHERE (c.dDisposeDate) Is NOT Null AND D.dblDeprT1<>0 注意: 其他月份修正的脚本,只需将上述中的参数“@LoginDate”改成对应月份最后一天(如2月份:SET @LoginDate='2004-02-29'),D.dblDeprT1替换成对应的会计期间字段,如2月份:将D.dblDeprT1改成D.dblDeprT2即可。注意做好数据备份! |
相关补丁: |
|
版本: |
8.50sp |
模块: |
固定资产 |
产品: |
U85X——固定资产 |
问题名称: |
固定资产原值一览表与统计表不一致问题 |
最后更新: |
2005-06-28 00:00:00 |