解决方案: |
请检查用户实际业务,判断是采购入库单表体记录错了,还是ap_detail表中对应的记录错了,然后删除或增加错误一方的记录。如果是06年度的采购发票出现该现象,则可取消发票审核、删除ap_detail表中对应该票的记录,然后重新审核该发票即可。 参照执行如下脚本,可以查询出在ap_detail表中与采购发票表体金额不对应的记录: select c.* from ap_detail c inner join (select a.cvencode,a.cPBVBillType,a.cPBVCode,b.* from purbillvouch a inner join purbillvouchs b on a.pbvid=b.pbvid where a.cPBVBillType in ('01','02') ) d on c.cdwcode=d.cvencode and c.ccovouchtype=d.cPBVBillType and c.ccovouchid=d.cPBVCode and c.ibvid=d.id and c.iCAmount<>d.isum where c.cflag='ap' and c.ccovouchtype in ('01','02') and c.cprocstyle=c.ccovouchtype 注意做好数据备份!! |