select a.makevdate,a.summary,a.totalcredit,a.cent_typeid,c.accidname from fts_voucher a,fts_voucher_b b, bd_accid c where a.pk_voucher=b.pk_voucher and b.pk_account=c.pk_accid and a.cyear=2014 and a.datasource=2 --(6上收,2委托,5下拨,3到账通知,0手工填制) and c.accidcode='011201'
不包括内部转账
从委托付款书 --少于上面的部分是委托付款是内部转账的,即bustype = 0 --1第一步内部付款,2第二步客商直接付款,0内部转账
select a.accidname, n.auditdate, ne.purpose, n.company_r, n.totalamount, n.netpaystatus from fts_newpayment n, bd_accid a, fts_newpayment_b ne where n.pk_newpayment = ne.pk_newpayment and n.pk_account_p = a.pk_accid and n.bustype = 1 --bustype=1 第一步 and n.netpaystatus = 0 --0 成功,3人为作废空未提交,1支付失败作废 and substr(n.auditdate, 1, 4) = '2015' --年份 and a.accidcode = '010201' --分公司 order by n.auditdate