306: -- Get the number of holds for the invoice
307: --
308: SELECT count(*)
309: INTO invoice_holds
310: FROM ap_holds_all
311: WHERE invoice_id = p_invoice_id
312: AND release_lookup_code is NULL;
313:
314: ---------------------------------------------------------------------
318: -- status should be NEEDS REAPPROVAL.
319: --
320: SELECT count(*)
321: INTO dist_var_hold
322: FROM ap_holds_all
323: WHERE invoice_id = p_invoice_id
324: AND hold_lookup_code = 'DIST VARIANCE'
325: AND release_lookup_code is NULL;
326: