Monday, October 4, 2010

Find Order number based on receipt number

SELECT ooha.order_number, cr.receipt_number, rap.payment_set_id,
oep.payment_set_id
FROM oe_payments oep,
oe_order_headers_all ooha,
ar_receivable_applications_all rap,
ar_cash_receipts_all cr
WHERE ooha.header_id = oep.header_id
AND rap.payment_set_id = oep.payment_set_id
AND rap.display = 'Y'
AND cr.cash_receipt_id = rap.cash_receipt_id
AND cr.receipt_number = :p1;

/

No comments:

Post a Comment