15: -- Declare cursor to retrieve the PO number
16: --
17: CURSOR po_number_cursor IS
18: SELECT DISTINCT(ph.segment1)
19: FROM ap_invoice_distributions aid,
20: po_distributions_ap_v pd,
21: po_headers ph
22: WHERE aid.invoice_id = l_invoice_id
23: AND aid.po_distribution_id = pd.po_distribution_id
55: amount_withheld NUMBER := 0;
56: BEGIN
57: select (0 - sum(nvl(amount,0)))
58: into amount_withheld
59: from ap_invoice_distributions
60: where invoice_id = l_invoice_id
61: and line_type_lookup_code = 'AWT';
62:
63: return(amount_withheld);