http://aporaclepayables.blogspot.com/2016/10/how-to-check-uncleared-payments-plsql.html
select aa.ORG_ID, aa.DOC_SEQUENCE_VALUE,sum(aa.AMOUNT), aa.STATUS_LOOKUP_CODE, jj.REVERSAL_FLAG
from ap_checks_all aa, ap_invoice_payments_all jj
where aa.CHECK_ID=jj.CHECK_ID
and jj.REVERSAL_FLAG !='Y'
and aa.CLEARED_DATE is null
and aa.ORG_ID=jj.ORG_ID
and aa.ORG_ID=376
group by aa.ORG_ID, aa.DOC_SEQUENCE_VALUE, aa.STATUS_LOOKUP_CODE, jj.REVERSAL_FLAG
No comments:
Post a Comment