关于计提折旧报MERGE错误类排查
不少客户会在计提折旧时候报这类MERGE的错,从数据角度来看就是存在1对多的情况所致
排查思路:
1、先检查T_FA_CARD 、T_FA_BALANCE
可能是T_FA_CARD 或T_FA_BALANCE存在多条FISNEWREC=2结果的数据导致冲突
语句1:
SELECT FNUMBER, COUNT(FNUMBER) FROM T_FA_CARD WHERE FISNEWREC=2
GROUP BY FNUMBER HAVING COUNT(FNUMBER)>1
语句2:
SELECT FASSETID, COUNT(FASSETID) FROM T_FA_BALANCE WHERE FISNEWREC=2
GROUP BY FASSETID,FACCTPOLICYID
HAVING COUNT(FASSETID)>1
2、
a.先看下折旧调整单上多次出现的卡片
select FALTERID,count(FALTERID) from T_FA_DEPRADJUST a
join T_FA_DEPRADJUSTENTRY b on a.fid=b.fid
where fyear=2022 and fperiod=12 and a.fnumber='折旧调整单单号'--调整单单号、年份、月份根据实际情况做调整
group by FALTERID having count(FALTERID)>1
b.查看计提折旧取数逻辑脚步去排查:
ps:最下面参数为卡片编码,通过a取出的数据丢进来看,任意取一张卡片的编码即可
*看结果,肯定是取出多行的数据,然后去排查具体哪一段多关联出来的(下面的区域先注释掉,一段段去排查)
大致可能异常原因,比如:会计日历存在交叉时间
Select *
FROM T_FA_CARD C
INNER JOIN T_FA_STATUS S ON (
C.FAssetStatusID = S.FID
AND S.FWHETHERDEPR = '1')
INNER JOIN T_FA_FINANCE F ON C.FAlterID = F.FAlterID
INNER JOIN T_FA_BALANCE B ON (
(
C.FAssetID = B.FASSETID
AND B.FIsNewRec = '2'
)
AND B.FACCTPOLICYID = F.FACCTPOLICYID
)
INNER JOIN T_FA_ACCTPOLICY P ON P.FACCTPOLICYID = F.FACCTPOLICYID
INNER JOIN T_FA_ACCTPOLICYASSET E ON (
P.FACCTPOLICYID = E.FACCTPOLICYID
AND E.FASSETTYPEID = C.FAssetTypeID
)
INNER JOIN t_BD_ACCOUNTCALENDAR AC ON P.FACCTCALENDARID = AC.FID
LEFT OUTER JOIN T_BD_ACCOUNTPERIOD AP1 ON (
AP1.FID = AC.FID
AND (
C.FBEGINUSEDATE BETWEEN AP1.FPERIODSTARTDATE
AND AP1.FPERIODENDDATE
)
)
LEFT OUTER JOIN T_BD_ACCOUNTPERIOD AP2 ON (
AP2.FID = AC.FID
AND (
F.FACCTDATE BETWEEN AP2.FPERIODSTARTDATE
AND AP2.FPERIODENDDATE
)
)
INNER JOIN T_FA_DEPRPOLICY D ON D.FPOLICYID = E.FDEPRPOLICYID
INNER JOIN T_bd_Currency BC ON P.Fcurrencyid = BC.FCURRENCYID
LEFT OUTER JOIN T_FA_DEPRMETHOD M ON M.FID = F.FDeprMethod
INNER JOIN V_FA_SYSTEMPROFILE T ON (
(
F.FACCTPOLICYID = T.FACCTPOLICYID
AND C.FOwnerOrgID = T.FOrgID
)
AND B.FOwnerOrgID = T.FOrgID
)
INNER JOIN T_BAS_SYSTEMPROFILE S1 ON (
(
(
S1.FCATEGORY = 'FA'
AND C.FOWNERORGID = S1.FORGID
)
AND F.FACCTPOLICYID = S1.FACCTPOLICYID
)
AND S1.FKEY = 'StartYear'
)
INNER JOIN T_BAS_SYSTEMPROFILE S2 ON (
(
(
S2.FCATEGORY = 'FA'
AND C.FOWNERORGID = S2.FORGID
)
AND F.FACCTPOLICYID = S2.FACCTPOLICYID
)
AND S2.FKEY = 'StartPeriod'
)
where C.fnumber='XD00343' --上面脚步取到的卡片丢一个进来
关于计提折旧报MERGE错误类排查
本文2024-09-16 18:56:15发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-25351.html