490: --Function:
491: -- This function returns the closure date for a line_location_id
492: -- depending upon the call mode
493: -- INVOICE CLOSE: maximum invoice date from the ap_invoices_all
494: -- RECEIVE CLOSE: maximum transaction date from the rcv_transactions
495: -- CLOSE: maximum of the invoice_date and receving transaction date
496: --Parameters:
497: --IN:
498: --p_call_mode
523: select max(action_date)
524: into l_closed_date
525: from
526: ( select RT.transaction_date action_date
527: from rcv_transactions RT
528: where RT.TRANSACTION_TYPE IN ('RECEIVE','ACCEPT','CORRECT','MATCH')
529: and RT.po_line_location_id = p_line_location_id
530: union
531: select AP.invoice_date action_date
563: END IF;
564: else -- call_mode = 'RECEIVE CLOSE'
565: select max(RT.transaction_date)
566: into l_closed_date
567: from rcv_transactions RT
568: where RT.TRANSACTION_TYPE IN ('RECEIVE','ACCEPT','CORRECT','MATCH')
569: and RT.po_line_location_id = p_line_location_id;
570: l_progress := '030';
571: IF g_debug_stmt THEN