Showing posts with label Find Order number based on receipt number. Show all posts
Showing posts with label Find Order number based on receipt number. Show all posts

Wednesday, 11 May 2011

Find Order number based on receipt number


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;