问题现象: | 8.51A升级V10,应收应付核销数据出现错误, 表现为在8.51A已核销的数据也转到新版本中。 引起未核消发票余额不等于应收款余额+未核消的收款单余额。 查询未核消发票的明细可以找到一个时点前的数据是错误升级结转入的、是冗余的或者说是已核消的,之后的数据才是未核销的。 [2011-11-29 11:11:28 补充] 希望尽快给出解决方案 |
问题原因: | |
解决方案: | 您好, 经与您沟通,及核对数据,现答复如下: 因跨版本比较多,可能是版本过滤条件不一致所致; 现建议通过把这些记录更改为已核销状态; 注:更改前请对账套备份;语句执行后,请及时核对数据;如有问题请与我联系; 语句如下: update Ar_Detail set cprocstyle = '9p' where cVouchID in ( SELECT cVouchID FROM ( SELECT a.cDwCode,max(a.cDeptCode) AS cDeptCode,max(a.cPerson) AS cPerson,max(a.cContractID) as cContractID,a.cCoVouchType AS cVouchType,a.cCoVouchID AS cVouchID,max(a.cexch_name) AS cexch_name,max(a.iexchrate) AS iexchrate,max(a.cItem_Class) as cItem_Class,max(a.cContractType) as cContractType,max(d.cCusAbbName) AS cDwName,max(e.cDepName) AS cDepName,max(f.cPersonName) AS cPersonName,max(cm.strContractName) as cContractName,max(b.cTypeName) AS cTypeName,Max(h.cSSName) as cSSName,max(i.cItem_Name) as cItem_Name,max(cm_type.cTypeName) as cContractTypeName,max(isnull(a.dgatheringdate,isnull(dtzbjenddate,a.dVouchDate+isnull(g.iPayCreDays,0)))) AS dExpireDate,max(d.iid) as cAuthID,max(a.dRegDate) AS dRegDate,min(a.dVouchDate) AS dVouchDate,max(a.cSign) AS cSign,max(a.cPayCode) AS cPayCode,max(a.cFlag) AS cFlag,max(convert(tinyint,a.bPrePay)) as bPrePay,max(a.cCode) as cCode,max(a.cItemCode) as cItemCode,max(a.cItemName) as cItemName,max(a.cOrderNo) as cOrderNo,max(AA_Enum.EnumName) as cOrderType,max(a.iOrderType) as iOrderType,sum(case when a.cCoVouchType Like '4%' then case when (cProcStyle='48' and iCAmount_f>0) OR (cProcStyle='49' and iCAmount_f<0) OR cProcStyle in ('BZ','9E','9I','9J') then case when a.cCoVouchType='48' then iCAmount_f else -iCAmount_f end else 0 end else case when cProcStyle=cCoVouchType or cProcStyle IN ('BZ','XJ','9I','9J','9C','TP') then (case when a.cSign='F' then -iDAmount_f else iDAmount_f end) else 0 end end) As iAmount_d,case when max(ivouchamount_f) is not null then abs(max(ivouchamount_f)) else sum(case when a.cCoVouchType Like '4%' then case when (cProcStyle='48' and iCAmount_f>0) OR (cProcStyle='49' and iCAmount_f<0) OR cProcStyle in ('BZ','9E','9I','9J') then case when a.cCoVouchType='48' then iCAmount_f else -iCAmount_f end else 0 end else case when cProcStyle=cCoVouchType or cProcStyle IN ('BZ','XJ','9I','9J','9C','TP') then (case when a.cSign='F' then -iDAmount_f else iDAmount_f end) else 0 end end) end As iAmount_f,sum(case when a.cCoVouchType like '4%' then case when a.cCoVouchType='48' then iCAmount_f-iDAmount_f else iDAmount_f-iCAmount_f end else case when a.cSign='F' then iCAmount_f-iDAmount_f else iDAmount_f-iCAmount_f end end) AS iRAmount_f,case when max(ivouchamount) is not null then abs(max(ivouchamount)) else sum(case when a.cCoVouchType Like '4%' then case when (cProcStyle='48' and iCAmount>0) OR (a.cProcStyle='49' and iCAmount<0) OR cProcStyle in ('BZ','9E','9I','9J') then case when a.cCoVouchType='48' then iCAmount else -iCAmount end else 0 end else case when cProcStyle=a.cCoVouchType or cProcStyle IN ('BZ','XJ','9I','9J','9C','TP') then (case when a.cSign='F' then -iDAmount else iDAmount end) else 0 end end) end As iAmount,sum(case when a.cCoVouchType like '4%' then case when a.cCoVouchType='48' then iCAmount-iDAmount else iDAmount-iCAmount end else case when a.cSign='F' then iCAmount-iDAmount else iDAmount-iCAmount end end) AS iRAmount,sum(case when a.cCoVouchType like '4%' then case when a.cCoVouchType='48' then iCAmount_s-iDAmount_s else iDAmount_s-iCAmount_s end else case when a.cSign='F' then iCAmount_s-iDAmount_s else iDAmount_s-iCAmount_s end end) AS iAmount_s,max(CASE WHEN cProcstyle=a.cVouchType OR cProcstyle='BZ' OR (cProcStyle='9P' And a.cCoVouchType like '4%') THEN a.cDigest ELSE null END) AS cDigest,max(CASE WHEN cProcstyle=a.cVouchType OR cProcstyle='BZ' OR (cProcStyle='9P' And a.cCoVouchType like '4%') OR cProcstyle='XJ' THEN cGLsign+'-'+isnull(REPLICATE('0',4-len(iGLno_id)),'')+convert(varchar,iGLno_id) else Null end) as cPzNum,max(a.cDefine1) as cDefine1,max(a.cDefine2) as cDefine2,max(a.cDefine3) as cDefine3,max(a.cDefine4) as cDefine4,max(a.cDefine5) as cDefine5,max(a.cDefine6) as cDefine6,max(a.cDefine7) as cDefine7,max(a.cDefine8) as cDefine8,max(a.cDefine9) as cDefine9,max(a.cDefine10) as cDefine10,max(a.cDefine11) as cDefine11,max(a.cDefine12) as cDefine12,max(a.cDefine13) as cDefine13,max(a.cDefine14) as cDefine14,max(a.cDefine15) as cDefine15,max(a.cDefine16) as cDefine16,max(a.cDefine22) as cDefine22,max(a.cDefine23) as cDefine23,max(a.cDefine24) as cDefine24,max(a.cDefine25) as cDefine25,max(a.cDefine26) as cDefine26,max(a.cDefine27) as cDefine27,max(a.cDefine28) as cDefine28,max(a.cDefine29) as cDefine29,max(a.cDefine30) as cDefine30,max(a.cDefine31) as cDefine31,max(a.cDefine32) as cDefine32,max(a.cDefine33) as cDefine33,max(a.cDefine34) as cDefine34,max(a.cDefine35) as cDefine35,max(a.cDefine36) as cDefine36,max(a.cDefine37) as cDefine37,max(a.cOperator) as cOperator,max(a.cCheckMan) as cCheckMan,0 as iCanZk,Null as iZk,0 as iZkRate,Null as iSettle,Null as iSettleMid,Null AS cInvCode,Null AS cInvAddCode,Null AS cInvName,Null AS cInvStd,a.iCoClosesID as ID,Null as BalancesGUID,Max(a.cDLCode) as cDLCode,max(cSTCode) as cSTCode,max(case when a.iFlag=2 then N'现款结算' when a.bPrePay=0 then N'应收款' else N'预收款' end) as iType FROM (((((Ar_Detail AS a WITH (NOLOCK) LEFT JOIN Ap_VouchType AS b ON a.cCoVouchType=b.cTypeCode) LEFT JOIN Customer AS d ON a.cDwCode=d.cCusCode) LEFT JOIN Department AS e ON a.cDeptCode = e.cDepCode) LEFT JOIN Person AS f ON a.cPerson = f.cPersonCode) left join paycondition g on a.cPayCode=g.cPayCode) LEFT JOIN settlestyle h on a.cSSCode=h.cSSCode LEFT JOIN fitem i on a.cItem_Class=i.cItem_Class Left Join cm_type on a.cContractType=cm_type.cTypeCode Left Join v_CM_ContractForAPAR cm on a.cContractID=cm.strContractID Left Join SaleBillVouch on SaleBillVouch.cVouchType=a.cVouchType and SaleBillVouch.cSBVCode=a.cVouchID Left Join V_AA_enum AA_enum on AA_enum.EnumType='AR.Source' And a.iOrderType=AA_enum.EnumIndex WHERE iFlag<2 And a.cFlag='AR' GROUP BY a.cDwCode,a.cCoVouchType,a.cCoVouchID,iCoClosesID ) AS CancelTable WHERE cDwCode=N'SHRC' And dVouchDate<='2011-11-25' And cexch_name=N'人民币' And (cSign is null or cSign=N'Z') And ((iRAmount_f>0 And iAmount_d>0) Or (iRAmount_f<0 And iAmount_d<0)) AND cVouchType<>N'48' and datediff(day,dExpireDate,'2011-1-11') >= 0 ) and iFlag<2 And cFlag='AR' and cDwCode=N'SHRC' And dVouchDate<='2011-11-25' And cexch_name=N'人民币' And (cSign is null or cSign=N'Z') AND cVouchType<>N'48' 【注意事项】修改前请务必做好数据备份; |
相关补丁: | |
版本: | U8 V10.0 |
模块: | 应收应付 |
产品: | 财务会计 |
问题名称: | 升级V10核消错误 |
最后更新: | 2011-12-09 23:33:05 |