SELECT DISTINCT rsh.RECEIPT_NUM,
rt.TRANSACTION_TYPE,
rt.CURRENCY_CODE,
rsh.VENDOR_SITE_ID,
rsh.VENDOR_ID,
rsh.SHIPPED_DATE,
-- aia.INVOICE_ID,
aia.INVOICE_NUM,
aia.AMOUNT_PAID,
aia.DOC_SEQUENCE_VALUE,
aia.DOC_CATEGORY_CODE,
aia.INVOICE_AMOUNT,
aia.INVOICE_DATE,
aia.INVOICE_TYPE_LOOKUP_CODE,
aia.DESCRIPTION,
aia.AMOUNT_APPLICABLE_TO_DISCOUNT,
aia.ACCTS_PAY_CODE_COMBINATION_ID,
aia.PAYMENT_METHOD_LOOKUP_CODE
FROM rcv_transactions rt,
rcv_shipment_headers rsh,
ap_invoice_distributions_all aida,
ap_invoices_all aia,
ap_invoice_payments_all aipa,
ap_payment_schedules_all apsa,
ap_checks_all aca
WHERE rsh.SHIPMENT_HEADER_ID = rt.SHIPMENT_HEADER_ID
AND rt.TRANSACTION_ID = aida.RCV_TRANSACTION_ID
AND aia.INVOICE_ID = aida.INVOICE_ID
--and aia.INVOICE_ID=aila.INVOICE_ID
AND aia.INVOICE_ID = aipa.INVOICE_ID(+)
AND aia.INVOICE_ID = apsa.INVOICE_ID
AND aca.CHECK_ID(+) = aipa.CHECK_ID
AND rsh.RECEIPT_NUM IN
('436001948',
'436001949',
'436001951',
'436001950',
'436001950')
rt.TRANSACTION_TYPE,
rt.CURRENCY_CODE,
rsh.VENDOR_SITE_ID,
rsh.VENDOR_ID,
rsh.SHIPPED_DATE,
-- aia.INVOICE_ID,
aia.INVOICE_NUM,
aia.AMOUNT_PAID,
aia.DOC_SEQUENCE_VALUE,
aia.DOC_CATEGORY_CODE,
aia.INVOICE_AMOUNT,
aia.INVOICE_DATE,
aia.INVOICE_TYPE_LOOKUP_CODE,
aia.DESCRIPTION,
aia.AMOUNT_APPLICABLE_TO_DISCOUNT,
aia.ACCTS_PAY_CODE_COMBINATION_ID,
aia.PAYMENT_METHOD_LOOKUP_CODE
FROM rcv_transactions rt,
rcv_shipment_headers rsh,
ap_invoice_distributions_all aida,
ap_invoices_all aia,
ap_invoice_payments_all aipa,
ap_payment_schedules_all apsa,
ap_checks_all aca
WHERE rsh.SHIPMENT_HEADER_ID = rt.SHIPMENT_HEADER_ID
AND rt.TRANSACTION_ID = aida.RCV_TRANSACTION_ID
AND aia.INVOICE_ID = aida.INVOICE_ID
--and aia.INVOICE_ID=aila.INVOICE_ID
AND aia.INVOICE_ID = aipa.INVOICE_ID(+)
AND aia.INVOICE_ID = apsa.INVOICE_ID
AND aca.CHECK_ID(+) = aipa.CHECK_ID
AND rsh.RECEIPT_NUM IN
('436001948',
'436001949',
'436001951',
'436001950',
'436001950')
No comments:
Post a Comment