|
问题现象:在用友8.60sperp系统中用友U8版本号:U8.60sp软件的公共平台产品线系统管理模块出现如下问题:用友U860ERP系统SP,应收应付年度结转提示错误,原因是在Ap_Detail表中cVouchID列有的记录在Ap_CloseBill中找不到,程序终止,经跟踪,有一条语句,可以查出所有在Ap_CloseBill中找不到记录的请帮忙解答!
原因分析:同解决方案。
解决方案:在用友erp 系统版本U8.60sp软件中存在ap_detail表中有记录,而在ap_closebill/s表中不存在的情况。具体可通过如下脚本查找。查找后,需要与用户核对,是否这些单据可以删除?如果不能删除,需要手工在库里补录,但不能确保记录没有问题。请用户考虑选择。脚本如下:--1.查询ap_detail表中的记录SELECTcCoVouchTypeAscVouchType,cCoVouchIDAscVouchID,iCoClosesIDAsiClosesID,max(a.dVouchDate)ASdVouchDate,cDwCode,max(a.cDeptCode)AScDeptCode,max(a.cPerson)AScPerson,Max(convert(int,bPrepay))AsbPrepay,Max(a.cCode)AscCode,Max(a.cItem_Class)AscItem_Class,Max(a.cItemCode)AscItemCode,Max(cItemName)ascItemName,max(a.cDigest)AScDigest,max(a.cexch_name)AScexch_name,max(a.iExchRate)AsiExchRate,Sum(iDAmount_f-iCAmount_f)ASiDA_f,0AsiCA_f,Sum(iDAmount-iCAmount)ASiDA,0AsiCA,Sum(iDAmount_s-iCAmount_s)ASiDA_s,0AsiCA_s,max(a.cSSCode)AscSSCode,max(cOrderNo)AscNoteNo,max(a.cFlag)AscFlag,Max(cDefine1)AsDef1,Max(cDefine2)AsDef2,Max(cDefine3)AsDef3,Max(cDefine4)AsDef4,Max(cDefine5)AsDef5,Max(cDefine6)AsDef6,Max(cDefine7)AsDef7,Max(cDefine8)AsDef8,Max(cDefine9)AsDef9,Max(cDefine10)AsDef10,Max(cDefine11)AsDef11,Max(cDefine12)AsDef12,Max(cDefine13)AsDef13,Max(cDefine14)AsDef14,Max(cDefine15)AsDef15,Max(cDefine16)AsDef16,Max(cContractType)ascConType,Max(cContractID)ascConIDintotempapdetailFROMAp_DetailAsaWhereiFlag0ORSum(iDAmount-iCAmount)0OrderBycCoVouchType,cCoVouchID,iCoClosesID--2.查找在ap_closebill表中缺少的记录select*fromtempapdetailwhere(cvouchidnotin(selectcvouchidfromap_closebillwhere(cvouchtype='49'andcflag='ap'))andcvouchtype='49')or(cvouchidnotin(selectcvouchidfromap_closebillwhere(cvouchtype='48'andcflag='ap'))andcvouchtype='48')。
|
|