文档详情

《年高级财务—应收应付(sz)》-精选·课件.ppt

发布:2018-11-08约2.26万字共120页下载文档
文本预览下载声明
经典案例—问题现象 咱们先看看问题现象,该数据是从870升级到890的,在应收系统查业务帐如客户410003,期间为3月份,注意查的目的业务帐 查询结果,410003客户目余额为4119672.19 经典案例—问题现象 按客户明细帐查应收科目帐,410003客户,科目范围这样看比较清楚,结果3286866.19,是正确的! 经典案例—问题现象 跟踪发现带科目的业务明细帐数据是通过 ‘Ap_DetailCust_V’视图得到的(数据源取自ap_detail表),化简跟踪语句后,我对比了一个正常的核销记录(注意是收款单对应所核销发票的记录)的ccode字段均有科目,而有问题的核销记录HXAR0000000001453存在两行ccode为空值的记录,通过 Group by 分组语句将该两记录汇总后单列出一行,与前图摘要为核销的记录-388791一致。 经典案例—分析过程 由于核销的是销售发票,咱们可以通过收款核销对应发票的ibvid联查原发票上的应收科目,看: 这样呢就可以通过语句根据发票子表上的科目来更新ap_detail表中核销发票后科目为空的记录了,由于有问题的记录较多,以下为通用更新语句: 经典案例—分析过程 经典案例—处理过程 根据发票子表上的科目更新核销发票后科目为空的记录 update ap_detail set ap_detail.ccode=salebillvouchs.cincomesub from ap_detail join salebillvouchs on salebillvouchs.autoid=ap_detail.ibvid where cvouchtype=48 and cflag=ar and (icamount0 or icamount_f0) and iflag=0 and cprocstyle=9p and ap_detail.ccode is null and ccovouchtype in(26,27) 经过检查又发现了部分收款单核销生成凭证后其相应核销记录的科目为空的情况,这应该是不正常的,如下图: 经典案例—分析过程 可以根据刚才回写ap_detail表中中发票核销记录上的科目来改写相应核销收款单上无科目的记录: update ap_detail set ccode=bb.ccode from ap_detail join (select distinct ap_detail.ccancelno,ap_detail.ccode from ap_detail join(select ccancelno from ap_detail where cvouchtype=48 and cflag=ar and (icamount0 or icamount_f0) and iflag=0 and cprocstyle=9p group by ccancelno,ccode having ccode is null)as aa on ap_detail.ccancelno=aa.ccancelno where ap_detail.ccode is not null)as bb on ap_detail.ccancelno=bb.ccancelno and ap_detail.ccode is null 经典案例—解决方法 经典案例—分析过程 经过跟踪还发现存在有不少收款单审核生成凭证后其相应的科目却为空的情况,这应该也是不正常的,如右图: 经典案例—解决方法 以下语句是处理在ap_detail表中收款单审核生成凭证后相应记录丢失的科目,是根据其对应相关收款记录上的科目予以更改的: update ap_detail set ap_detail.ccode=bb.ccode from ap_detail join (select aa.cpzid,ap_detail.ccode from ap_detail join (select cpzid from ap_detail where cvouchtype=48 and cflag=ar and (icamount0 or icamount_f0) and iflag=0 and cprocstyle=48 and bprepay=0 and cpzid is not null and ccode is null group by cpzid) as aa on ap_detail.cpzid=aa.cpzid group by aa.cpzid,ap_detail.ccode having
显示全部
相似文档