289:
290: CURSOR c_dist_approval_status
291: IS
292: SELECT match_status_flag
293: FROM ap_invoice_distributions_all
294: WHERE invoice_id = p_invoice_id
295: UNION
296: SELECT 'N'
297: FROM ap_invoice_distributions_all
293: FROM ap_invoice_distributions_all
294: WHERE invoice_id = p_invoice_id
295: UNION
296: SELECT 'N'
297: FROM ap_invoice_distributions_all
298: WHERE invoice_id = p_invoice_id
299: AND match_status_flag IS NULL
300: AND EXISTS
301: (SELECT 'There are both untested and tested lines'
298: WHERE invoice_id = p_invoice_id
299: AND match_status_flag IS NULL
300: AND EXISTS
301: (SELECT 'There are both untested and tested lines'
302: FROM ap_invoice_distributions_all
303: WHERE invoice_id = p_invoice_id
304: AND match_status_flag IN ('T','A'));
305:
306: