select --cr.RECEIPT_NUMBER,
cr.RECEIPT_DATE R_DATE,
cr.AMOUNT R_AMOUNT,
cr.CUSTOMER_RECEIPT_REFERENCE R_Check_No,
ct.BILL_TO_CUSTOMER_ID R_CUSTOMER,
CR.ORG_ID,
ct.TRX_NUMBER
from AR_CASH_RECEIPTS_ALL cr,
ra_customer_trx_all ct,
ar_receivable_applications_all app,
ra_terms rt
where /*cr.CUSTOMER_RECEIPT_REFERENCE is not null
and */cr.STATUS = 'APP'
and app.APPLIED_CUSTOMER_TRX_ID = ct.CUSTOMER_TRX_ID
and app.CASH_RECEIPT_ID = cr.CASH_RECEIPT_ID
and rt.term_id = ct.TERM_ID
-- and (upper(rt.name) = upper('CASH') OR (upper(rt.name) like 'PDC%'))
and cr.ORG_ID = ct.ORG_ID
--and cr.ORG_ID = 221
;
No comments:
Post a Comment