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
532: from ap_invoice_distributions_all AD,
533: ap_invoices_all AP,
534: po_distributions_all POD
535: where AD.invoice_id = AP.invoice_id
536: and AD.po_distribution_id = POD.po_distribution_id
546: END IF;
547: elsif p_call_mode = 'INVOICE CLOSE' then
548: select max(AP.invoice_date)
549: into l_closed_date
550: from ap_invoice_distributions_all AD,
551: ap_invoices_all AP,
552: po_distributions_all POD
553: where AD.invoice_id = AP.invoice_id
554: and AD.po_distribution_id = POD.po_distribution_id