559: PO_CLOSEOUT_PVT.Log( d_module, d_position, 'p_doc_id ' || p_doc_id);
560:
561: SELECT Count(1)
562: INTO l_count
563: FROM po_line_locations_all poll
564: WHERE poll.po_header_id = p_doc_id
565: AND Nvl(poll.closed_code,'OPEN') IN ('OPEN')
566: AND Nvl(poll.cancel_flag, 'N') = 'N';
567:
621: PO_CLOSEOUT_PVT.Log( d_module, d_position, 'p_doc_id ' || p_doc_id);
622:
623: SELECT Count(1)
624: INTO l_count
625: FROM po_line_locations_all poll
626: WHERE poll.po_header_id = p_doc_id
627: AND nvl(poll.closed_code,'OPEN') IN ('OPEN','CLOSED FOR RECEIVING',' CLOSED FOR INVOICE');
628:
629: l_progress := 20;
684: INTO l_count
685: FROM ap_invoice_distributions_all aid,
686: ap_invoices_all aia,
687: po_distributions_all pod,
688: po_line_locations_all poll
689: WHERE aid.po_distribution_id = pod.po_distribution_id
690: AND aia.invoice_id = aid.invoice_id
691: AND pod.po_header_id = poll.po_header_id
692: AND poll.po_header_id = p_doc_id;
699: INTO l_count
700: FROM ap_invoice_distributions_all aid,
701: ap_invoices_all aia,
702: po_distributions_all pod,
703: po_line_locations_all poll
704: WHERE aid.po_distribution_id = pod.po_distribution_id
705: AND aia.invoice_id = aid.invoice_id
706: AND pod.po_header_id = poll.po_header_id
707: AND poll.po_header_id = p_doc_id
1970: WHERE pmmd.multi_mod_request_id = p_req_id
1971: AND pmmd.document_id = pha.po_header_id
1972: AND pha.type_lookup_code = 'STANDARD'
1973: AND EXISTS ( SELECT 1
1974: FROM po_line_locations_all poll
1975: WHERE pha.po_header_id = poll.po_header_id
1976: AND Nvl(poll.closed_code,'OPEN') = 'OPEN'
1977: AND Nvl(poll.cancel_flag, 'N') = 'N');
1978:
2010: WHERE pmmd.multi_mod_request_id = p_req_id
2011: AND pmmd.document_id = pha.po_header_id
2012: AND pha.type_lookup_code = 'STANDARD'
2013: AND EXISTS (SELECT 1
2014: FROM po_line_locations_all poll
2015: WHERE pha.po_header_id = poll.po_header_id
2016: AND nvl(poll.closed_code,'OPEN') IN ('OPEN','CLOSED FOR RECEIVING',' CLOSED FOR INVOICE')
2017: );
2018:
2053: AND NOT EXISTS (SELECT 1
2054: FROM ap_invoice_distributions_all aid,
2055: ap_invoices_all aia,
2056: po_distributions_all pod,
2057: po_line_locations_all poll
2058: WHERE aid.po_distribution_id = pod.po_distribution_id
2059: AND aia.invoice_id = aid.invoice_id
2060: AND pod.po_header_id = poll.po_header_id
2061: AND pha.po_header_id = poll.po_header_id);
2091: AND EXISTS (SELECT 1
2092: FROM ap_invoice_distributions_all aid,
2093: ap_invoices_all aia,
2094: po_distributions_all pod,
2095: po_line_locations_all poll
2096: WHERE aid.po_distribution_id = pod.po_distribution_id
2097: AND aia.invoice_id = aid.invoice_id
2098: AND pod.po_header_id = poll.po_header_id
2099: AND pha.po_header_id = poll.po_header_id
2255: AND PLC2.lookup_code = ph.authorization_status
2256: AND pv.vendor_id = ph.vendor_id
2257: --Award should not contain any open shipments or line associated to the shipment is cancelled
2258: AND NOT EXISTS(SELECT 1
2259: FROM po_line_locations_all pll,
2260: po_lines_all pl
2261: WHERE pll.po_header_id = ph.po_header_id
2262: AND pll.po_line_id = pl.po_line_id
2263: AND (Nvl(pll.closed_code,'OPEN') IN ('OPEN')