DBA Data[Home] [Help]

APPS.PO_POAPPROVAL_INIT1 SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 25

  select PO_HEADER_ID,COMMENTS,AUTHORIZATION_STATUS,
         TYPE_LOOKUP_CODE,AGENT_ID,SEGMENT1,CLOSED_CODE,CURRENCY_CODE
  from po_headers_all
  where PO_HEADER_ID = p_po_header_id;
Line: 32

  select PO_HEADER_ID,COMMENTS,AUTHORIZATION_STATUS,
         TYPE_LOOKUP_CODE,AGENT_ID,SEGMENT1,CLOSED_CODE,CURRENCY_CODE
  from po_headers_draft_all
  where PO_HEADER_ID = p_po_header_id
  and draft_id = p_draft_id;
Line: 39

  select PORL.PO_RELEASE_ID,PORL.PO_HEADER_ID,PORL.AUTHORIZATION_STATUS,
         PORL.RELEASE_TYPE,PORL.AGENT_ID,PORL.RELEASE_NUM,PORL.CLOSED_CODE,
         POH.SEGMENT1, POH.CURRENCY_CODE, POH.COMMENTS
         -- Bug 10140786 Selected comments to set PO_DESCRIPTION in release workflow.
  from po_releases_all PORL, po_headers_all POH
  where  PORL.PO_RELEASE_ID = p_rel_header_id
  and    PORL.po_header_id  = POH.po_header_id;
Line: 89

     /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,x_progress);
Line: 140

 SELECT (Nvl (comm_rev_num, -1))
 INTO l_po_revision_num_orig
 FROM po_headers_all
 WHERE po_header_id = l_po_header_id;
Line: 148

 SELECT (Nvl (comm_rev_num, -1))
 INTO l_po_revision_num_orig
 FROM po_releases_all
 WHERE po_release_id = l_po_header_id;
Line: 199

     /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
Line: 242

     /* DEBUG */ PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
Line: 304

     /* DEBUG */ PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
Line: 350

     /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,x_progress);
Line: 384

     select acceptance_required_flag,acceptance_due_date
         into l_acceptance_required, l_acceptance_due_date
     from po_headers
     where po_header_id= l_po_header_id;
Line: 391

     select acceptance_required_flag,acceptance_due_date
         into l_acceptance_required, l_acceptance_due_date
     from po_releases
     where po_release_id= l_po_header_id;
Line: 410

     /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,x_progress);
Line: 440

     /* DEBUG */ PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
Line: 468

     /* DEBUG */ PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
Line: 475

     /* DEBUG */ PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
Line: 527

  select DISPLAYED_FIELD
  from po_lookup_codes
  where lookup_type='AUTHORIZATION STATUS'
  and lookup_code = p_auth_stat;
Line: 533

  select DISPLAYED_FIELD
  from po_lookup_codes
  where lookup_type='DOCUMENT STATE'
  and lookup_code = p_closed_code;
Line: 544

select type_name
from po_document_types
where document_type_code = p_doc_type
and document_subtype = p_doc_subtype;
Line: 554

     /* DEBUG */ PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
Line: 689

     /* DEBUG */ PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
Line: 712

     /* DEBUG */ PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
Line: 731

   Old tax select:
   select nvl(sum(NONRECOVERABLE_TAX),0)
     into l_tax_amount
     from po_distributions
     where po_header_id = POHdr_rec.po_header_id;
Line: 765

    SELECT nvl(sum( round (nvl(POD.nonrecoverable_tax,0) *
                       decode(POLL.matching_basis,
                              'AMOUNT',
                                                          --Bug16222308 Handling the quantity zero on distribution
                              (nvl(POD.amount_ordered,0) - nvl(POD.amount_cancelled,0)) / Decode ( nvl(POD.amount_ordered, 1),0,1,nvl(POD.amount_ordered, 1) ),
                              (nvl(POD.quantity_ordered,0) - nvl(POD.quantity_cancelled,0)) / Decode ( nvl(POD.quantity_ordered, 1),0,1,nvl(POD.quantity_ordered, 1) )
                             ) / X_min_acct_unit
                       ) * X_min_acct_unit
              ),0)
    INTO l_tax_amount
    FROM po_distributions_all POD,
	     po_line_locations_all POLL
    WHERE POD.po_header_id = POHdr_rec.po_header_id
    AND POD.line_location_id=POLL.line_location_id
    AND POD.po_header_id=POLL.po_header_id
    AND Nvl(POD.distribution_type,'STANDARD') NOT IN ('PREPAYMENT')  --11876122
    AND POD.line_location_id IS NOT NULL; -- 13887381
Line: 789

    SELECT nvl(sum( round (nvl(POD.nonrecoverable_tax,0) *
                       decode(POLL.matching_basis,
                              'AMOUNT',
                                                          --Bug16222308 Handling the quantity zero on distribution
                              (nvl(POD.amount_ordered,0) - nvl(POD.amount_cancelled,0)) / Decode ( nvl(POD.amount_ordered, 1),0,1,nvl(POD.amount_ordered, 1) ),
                              (nvl(POD.quantity_ordered,0) - nvl(POD.quantity_cancelled,0)) / Decode ( nvl(POD.quantity_ordered, 1),0,1,nvl(POD.quantity_ordered, 1) )
                             ),
                       X_precision
                      )
              ),0)
    INTO l_tax_amount
    FROM po_distributions_all POD,
	     po_line_locations_all POLL
    WHERE POD.po_header_id = POHdr_rec.po_header_id
	AND POD.line_location_id=POLL.line_location_id
    AND POD.po_header_id=POLL.po_header_id
    AND Nvl(distribution_type,'STANDARD') NOT IN ('PREPAYMENT') -- 11876122
    AND POD.line_location_id IS NOT NULL; -- 13887381
Line: 847

	select sum(funded_value)
	   into l_total_funded_amount
		from po_distributions_merge_v
		where po_header_id = l_doc_id
		and draft_id = l_draft_id;
Line: 892

     /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
Line: 902

     /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
Line: 909

     /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
Line: 953

  select DISPLAYED_FIELD
  from po_lookup_codes
  where lookup_type='AUTHORIZATION STATUS'
  and lookup_code = p_auth_stat;
Line: 960

  select DISPLAYED_FIELD
  from po_lookup_codes
  where lookup_type='DOCUMENT STATE'
  and lookup_code = p_closed_code;
Line: 972

select type_name
from po_document_types
where document_type_code = p_doc_type
and document_subtype = p_doc_subtype;
Line: 979

  select DISPLAYED_FIELD
  from po_lookup_codes
  where lookup_type='DOCUMENT TYPE'
  and lookup_code = p_doc_type;
Line: 985

  select DISPLAYED_FIELD
  from po_lookup_codes
  where lookup_type='DOCUMENT SUBTYPE'
  and lookup_code = p_doc_subtype;
Line: 995

     /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
Line: 1120

   Old tax select:
   select nvl(sum(NONRECOVERABLE_TAX),0)
     into l_tax_amount
     from po_distributions
    where po_release_id = RelHdr_rec.Po_Release_id;
Line: 1151

     SELECT nvl(sum( round (POD.nonrecoverable_tax *
                        decode(quantity_ordered,
                               NULL,
                                                           --Bug16222308 Handling the quantity zero on distribution
                               (nvl(POD.amount_ordered,0) - nvl(POD.amount_cancelled,0)) / Decode ( nvl(POD.amount_ordered, 1),0,1,nvl(POD.amount_ordered, 1) ),
                               (nvl(POD.quantity_ordered,0) - nvl(POD.quantity_cancelled,0)) / Decode ( nvl(POD.quantity_ordered, 1),0,1,nvl(POD.quantity_ordered, 1) )
                              ) / X_min_acct_unit
                        ) * X_min_acct_unit
               ),0)
     INTO l_tax_amount
     FROM po_distributions_all POD
     WHERE po_release_id = RelHdr_rec.po_release_id;
Line: 1164

     SELECT nvl(sum( round (POD.nonrecoverable_tax *
                        decode(quantity_ordered,
                               NULL,
                                                           --Bug16222308 Handling the quantity zero on distribution
                               (nvl(POD.amount_ordered,0) - nvl(POD.amount_cancelled,0)) / Decode ( nvl(POD.amount_ordered, 1),0,1,nvl(POD.amount_ordered, 1) ),
                               (nvl(POD.quantity_ordered,0) - nvl(POD.quantity_cancelled,0)) / Decode ( nvl(POD.quantity_ordered, 1),0,1,nvl(POD.quantity_ordered, 1) )
                              ),
                        X_precision
                       )
               ),0)
     INTO l_tax_amount
     FROM po_distributions_all POD
     WHERE po_release_id = RelHdr_rec.po_release_id;
Line: 1258

       SELECT type_lookup_code
       INTO   l_doc_subtype
       FROM   po_headers
       WHERE  po_header_id = doc_header_id;
Line: 1264

       SELECT shipment_type
       INTO   l_doc_subtype
       FROM   po_line_locations
       WHERE  po_release_id = doc_header_id
       AND    ROWNUM = 1;
Line: 1271

       SELECT type_lookup_code
       INTO   l_doc_subtype
       FROM   po_requisition_headers
       WHERE  requisition_header_id = doc_header_id;
Line: 1386

  SELECT substrb ( part1 || decode(part2, NULL, '', part2 || ' ') || part3,
                   1, 2000)
  INTO l_address
  FROM
    (SELECT hrl.address_line_1 || ', '
              || decode(hrl.address_line_2, null, '', hrl.address_line_2||', ')
              || decode(hrl.address_line_3, null, '', hrl.address_line_3||', ')
              || decode(hr_general.decode_lookup(hrl.country||'_PROVINCE',hrl.town_or_city ),
                        NULL, decode(hrl.town_or_city, null, '', hrl.town_or_city ||', '),
                        hr_general.decode_lookup(hrl.country||'_PROVINCE',hrl.town_or_city ) || ', ')
              AS part1,
            nvl(decode(hrl.region_1,
                       null, hrl.region_2,
                       decode(flv1.meaning,
                              null, decode(flv2.meaning,
                                           null, flv3.meaning,
                                           flv2.lookup_code),
                              flv1.lookup_code) ),
                hrl.region_2)
              AS part2,
            decode(hrl.postal_code, null, '', hrl.postal_code || ', ')
              || ftv.territory_short_name
              AS part3
      FROM hr_locations hrl,
           fnd_territories_vl ftv,
           fnd_lookup_values_vl flv1,
           fnd_lookup_values_vl flv2,
           fnd_lookup_values_vl flv3
      WHERE hrl.region_1 = flv1.lookup_code (+) and
            hrl.country || '_PROVINCE' = flv1.lookup_type (+) and
            hrl.region_2 = flv2.lookup_code (+) and
            hrl.country || '_STATE' = flv2.lookup_type (+) and
            hrl.region_1 = flv3.lookup_code (+) and
            hrl.country || '_COUNTY' = flv3.lookup_type (+) and
            hrl.country = ftv.territory_code (+) and
            hrl.location_id = p_location_id);
Line: 1507

    SELECT PRL.to_person_id, POH.agent_id
    FROM po_lines POL,
         po_line_locations PLL,
         -- For Shared Procurement, the destination OU may be different from
         -- the Purchasing OU:
         po_requisition_lines_all PRL,
         po_headers POH
    WHERE POL.po_line_id = p_po_line_id
    AND   POL.po_line_id = PLL.po_line_id                  -- JOIN
    AND   PLL.line_location_id = PRL.line_location_id (+)  -- JOIN
    AND   POH.po_header_id = POL.po_header_id              -- JOIN
    ORDER BY PLL.shipment_num;
Line: 1534

    SELECT POD.deliver_to_person_id
    FROM po_distributions_all POD
       , po_line_locations PLL   -- 
    WHERE POD.line_location_id = PLL.line_location_id
    AND   PLL.po_line_id = p_po_line_id
    AND   POD.deliver_to_person_id IS NOT NULL
    AND   PLL.shipment_type <> 'PREPAYMENT'
    ORDER BY PLL.shipment_num, POD.distribution_num ASC;
Line: 1666

    SELECT POL.po_line_id,
           POL.contractor_first_name,
           POL.contractor_last_name,
           PJ.name job_name
    FROM po_headers POH,
         po_lines POL,
         per_jobs_vl PJ
    WHERE POH.po_header_id = p_po_header_id
    AND   POH.po_header_id = POL.po_header_id -- JOIN
    AND   POL.purchase_basis = 'TEMP LABOR'
    AND   PJ.job_id = POL.job_id -- JOIN
    AND   -- For a new document, we want all of the lines.
          ((p_is_new_document = 'Y') OR

           -- For an existing document, we only want the new lines - i.e.
           -- the lines that do not have any older archived revisions.
           NOT EXISTS
           (SELECT 1
            FROM po_lines_archive PLA
            WHERE PLA.po_line_id = POL.po_line_id -- JOIN
            AND   PLA.revision_num <> POH.revision_num));
Line: 1720

    PO_WF_DEBUG_PKG.insert_debug ( itemtype, itemkey,
      g_pkg_name||'.'||l_proc_name||': document type: ' || l_document_type
      || ', document subtype: ' || l_document_subtype );
Line: 1775

      SELECT PO_WF_ITEMKEY_S.nextval
      INTO l_item_key_seq
      FROM dual;
Line: 1859

    PO_WF_DEBUG_PKG.insert_debug ( p_item_type, p_item_key,
      substrb (
        g_pkg_name||'.'||l_proc_name||': p_item_type: '||p_item_type
        ||', p_item_key: '||p_item_key||', p_process: '||p_process
        ||', p_po_line_id: '||p_po_line_id,
        1, 1000 ) );
Line: 1920

  SELECT POH.po_header_id,
         POH.segment1,
         PRL.requisition_header_id
  INTO l_po_header_id,
       l_document_number,
       l_req_header_id
  FROM po_lines POL,
       po_headers POH,
       po_line_locations PLL,
       po_requisition_lines_all PRL
  WHERE POL.po_line_id = p_po_line_id
  AND   POL.po_header_id = POH.po_header_id -- JOIN
  AND   POL.po_line_id = PLL.po_line_id -- JOIN
  AND   PLL.line_location_id = PRL.line_location_id (+); -- JOIN
Line: 2039

        SELECT approved_date
          INTO x_approved_date
          FROM po_releases_all
         WHERE po_release_id = p_doc_id;
Line: 2044

        SELECT approved_date
          INTO x_approved_date
          FROM po_headers_all
         WHERE po_header_id= p_doc_id;