NEED TO GET AP INVOICE AND CORRESPONDING PO NUMBER FOR EXPENDITURE
I have need to get all the expenditure items in PA. If they were created as a result of AP Invoice then we need the Invoice Number and if the AP invoice matched to a PO then we also need the PO number.
Given below is the query with which we started need to know how to JOIN to AP distributions to get to the PO.
Select ain.invoice_num
-- NEED PO NUMBER ALSO
From po_vendor_sites pvs
,ap_invoices ain
,pa_expenditure_items pei
,pa_expenditures pe
where pei.expenditure_id = pe.expenditure_id
and pei.transaction_source = 'AP INVOICE'