28: po_distributions_all pd,
29: po_headers_all ph,
30: po_releases_all pr
31: WHERE aid.invoice_id in (select invoice_id
32: from ap_invoice_payments_all
33: where check_id = l_check_id)
34: AND aid.po_distribution_id = pd.po_distribution_id
35: AND pr.po_release_id = pd.po_release_id
36: AND ph.po_header_id = pr.po_header_id
40: FROM ap_invoice_distributions_all aid,
41: po_distributions_all pd,
42: po_headers_all ph
43: WHERE aid.invoice_id in (select invoice_id
44: from ap_invoice_payments_all
45: where check_id = l_check_id)
46: AND aid.po_distribution_id = pd.po_distribution_id
47: AND pd.po_header_id = ph.po_header_id
48: AND ph.type_lookup_code = 'STANDARD';
98: -- Declare cursor to return the Invoice number, Invoice Id
99: CURSOR inv_cursor IS
100: SELECT distinct ai.invoice_num, ai.invoice_id
101: FROM ap_invoices_all ai,
102: ap_invoice_payments_all aip
103: WHERE aip.check_id = l_check_id
104: AND aip.invoice_id = ai.invoice_id;
105:
106: BEGIN