DBA Data[Home] [Help]

APPS.POS_ACK_PO SQL Statements

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

Line: 13

  Modified the signature which takes l_last_update_date as IN parameter
  and returns x_error as OUT parameter. l_last_update_date is used to
  check the concurrency i.e., to check whether multiple supplier users
  are acting on the same PO simutaneously. If the supplier try to modify
  the PO which has already been modified by other user x_error returns false.
*/
PROCEDURE ACKNOWLEDGE_PO (
   l_po_header_id     IN VARCHAR2,
   l_po_release_id    IN VARCHAR2 default null,
   l_po_buyer_id      IN VARCHAR2,
   l_po_accept_reject IN VARCHAR2,
   l_po_acc_type_code IN VARCHAR2,
   l_po_ack_comments  IN VARCHAR2 ,
   l_user_id          IN VARCHAR2,
   l_last_update_date IN DATE DEFAULT fnd_api.G_NULL_DATE,
   x_error            OUT  NOCOPY VARCHAR2)
IS
   l_acceptance_id     NUMBER;
Line: 50

   x_Last_Update_Date   date ;
Line: 51

   x_Last_Updated_By    number;
Line: 52

   l_Last_Update_Login  PO_ACCEPTANCES.last_update_login%TYPE;
Line: 79

     Added the cursors to get the latest last_update_date which is there in the database.
   */
   l_last_upd_date        po_headers_all.last_update_date%type;
Line: 84

        SELECT last_update_date
        FROM   PO_HEADERS_ALL
        WHERE  PO_HEADER_ID = p_po_header_id
        FOR UPDATE of last_update_date NOWAIT;
Line: 92

        SELECT last_update_date
        FROM   PO_RELEASES_ALL
        WHERE  PO_RELEASE_ID = p_po_release_id
        FOR UPDATE of last_update_date NOWAIT;
Line: 100

     select notification_id
     from   wf_notifications
     where  notification_id = p_nid
     FOR UPDATE of notification_id NOWAIT;
Line: 119

   select a.notification_id,poh.wf_item_type,poh.wf_item_key, a.message_name
   INTO   l_nid,l_po_item_type,l_po_item_key, l_message_name
   from   wf_notifications a,po_headers_all poh,
          wf_item_activity_statuses wa
   where  poh.po_header_id=l_po_header_id
   and    poh.wf_item_key=wa.item_key
   and    poh.wf_item_type=wa.item_type
   and    a.message_name in ('PO_EMAIL_PO_WITH_RESPONSE', 'PO_EMAIL_PO_PDF_WITH_RESPONSE')
   and    a.notification_id=wa.notification_id and a.status = 'OPEN'
   and    wa.activity_status = 'NOTIFIED';
Line: 136

   select a.notification_id,por.wf_item_type,por.wf_item_key
   INTO  l_nid,l_po_item_type,l_po_item_key
   from  wf_notifications a,po_releases_all por,
         wf_item_activity_statuses wa
   where por.po_release_id=l_po_release_id
   and   por.wf_item_key=wa.item_key
   and   por.wf_item_type=wa.item_type
   and   a.message_name in ('PO_EMAIL_PO_WITH_RESPONSE', 'PO_EMAIL_PO_PDF_WITH_RESPONSE')
   and   a.notification_id=wa.notification_id and a.status = 'OPEN'
   and   wa.activity_status = 'NOTIFIED';
Line: 154

   select description into l_accp_type from POS_ACK_ACC_TYPE_LOV_V
   where LOOKUP_CODE =  l_po_acc_type_code; */
Line: 164

        select pov.vendor_name
        into x_vendor
        from po_vendors pov,po_headers_all poh
        where pov.vendor_id = poh.vendor_id
        and poh.po_header_id=l_po_header_id;
Line: 170

        select pov.vendor_name
        into x_vendor
        from po_releases_all por,po_headers_all poh,po_vendors pov
        where por.po_release_id = l_po_release_id
        and por.po_header_id    = poh.po_header_id
        and poh.vendor_id       = pov.vendor_id;
Line: 179

     select fnd_message.get_string('POS','POS_PO_ACCEPTED')
     into l_accp_res from dual;
Line: 182

    select fnd_message.get_string('POS','POS_PO_REJECTED')
    into l_accp_res from dual;
Line: 190

  Locking the Notification id to allow only one user to update when more than
  one supplier user tries to acknowledge the PO.*/
  IF (l_last_update_date <> fnd_api.G_NULL_DATE) THEN
    BEGIN
     OPEN NID_CSR(l_nid);
Line: 292

      l_last_update_date contains the last update date which is currently seen by supplier user.
      l_last_upd_date contains the last update date which is currently there is database.
      If there is any mismatch in the above dates that means the PO data whatever supplier user
      seeing currently is not the latest.
   */
   -- Lock the PO Header Row for update of Last Update Date
   IF (l_last_update_date <> fnd_api.G_NULL_DATE) THEN
     if (l_po_release_id is not null ) then
       BEGIN
        OPEN REL_CSR(l_po_release_id);
Line: 303

        l_last_upd_date := relRec.last_update_date;
Line: 319

        l_last_upd_date := poRec.last_update_date;
Line: 337

     if (l_last_update_date <> l_last_upd_date) THEN
       x_error := 'true';
Line: 346

   select po_acceptances_s.nextval into l_acceptance_id from dual;
Line: 352

	   select revision_num ,nvl(pending_signature_flag,'N'),type_lookup_code
           into l_revision_num,l_pending_signature_flag,l_doc_subtype
	   from po_headers_all
	   where po_header_id = to_number(l_po_header_id);
Line: 368

	   select revision_num into l_revision_num
	   from po_releases_all
	   where po_release_id = to_number(l_po_release_id);
Line: 374

         select pos_party_management_pkg.get_job_title_for_user( l_user_id)
         into l_role
         from dual;
Line: 400

    PO_ACCEPTANCES_INS_PVT.insert_row(
                        x_rowid                 =>  x_row_id,
			x_acceptance_id		=>  l_acceptance_id,
                        x_Last_Update_Date      =>  x_Last_Update_Date,
                        x_Last_Updated_By       =>  x_Last_Updated_By,
                        x_Last_Update_Login     =>  l_Last_Update_Login,
			p_creation_date		=>  x_Creation_Date,
			p_created_by		=>  x_Created_by,
			p_po_header_id		=>  x_po_header_id,
			p_po_release_id		=>  l_po_release_id,
			p_action		=>  fnd_message.get_string('ICX','ICX_POS_ACK_WEB'),
			p_action_date		=>  x_Action_Date,
			p_employee_id		=>  null,
			p_revision_num		=>  l_revision_num,
			p_accepted_flag		=>  l_po_accept_reject,
			p_acceptance_lookup_code=>  l_po_acc_type_code,
			p_note			=>  l_po_ack_comments,
                        p_accepting_party       =>  l_accepting_party,
                        p_signature_flag        =>  l_signature_flag,
                        p_role                  =>  l_role);
Line: 424

/*   insert into po_acceptances (
        acceptance_id,
        last_update_Date,
        last_updated_by,
        last_update_login,
        creation_date,
        created_by,
        po_header_id,
        po_release_id,
        action,
        action_date,
        --employee_id,
        revision_num,
        accepted_flag,
        acceptance_lookup_code,
        note
   )
   values (
        l_acceptance_id,
        sysdate,
        l_user_id,
        l_user_id,
        sysdate,
        l_user_id,
        decode(l_po_release_id, null, l_po_header_id, null),
        l_po_release_id,
        fnd_message.get_string('ICX','ICX_POS_ACK_WEB'),
        sysdate,
        --l_po_buyer_id,
        l_revision_num,
        l_po_accept_reject,
        l_po_acc_type_code,
        l_po_ack_comments
   );
Line: 460

         PO_SIGNATURE_PVT.Update_Po_Details(
                        p_po_header_id        => l_doc,
                        p_status              => 'REJECTED',
                        p_action_code         => 'SUPPLIER REJECTED',
                        p_object_type_code    => l_doc_type,
                        p_object_subtype_code => l_doc_subtype,
                        p_employee_id         => null,
                        p_revision_num        => l_revision_num);
Line: 477

      update po_releases_all
      set acceptance_required_flag = 'N',
          LAST_UPDATE_DATE = SYSDATE,
          acceptance_due_date=''
      where po_release_id = l_po_release_id;
Line: 485

      update po_headers_all
      set acceptance_required_flag = 'N',
          LAST_UPDATE_DATE = SYSDATE,
          acceptance_due_date=''
      where po_header_id = l_po_header_id;
Line: 497

   select po_wf_itemkey_s.nextval into l_seq_val from dual;
Line: 603

   select po_wf_itemkey_s.nextval into l_seq_val
   from dual;
Line: 629

   	update po_headers_all
   	set authorization_status = 'IN PROCESS'
   	where po_header_id = to_number(pos_po_header_id);
Line: 633

   	update po_releases_all
   	set authorization_status = 'IN PROCESS'
   	where po_release_id = to_number(pos_po_release_id);
Line: 713

         UPDATE PO_LINE_LOCATIONS_ALL PLL
         SET   pll.promised_date = pll.need_by_date,
               pll.last_update_date = sysdate,
               pll.last_updated_by = p_user_id
         WHERE pll.po_header_id= p_po_header_id
         AND   pll.po_release_id is null
         AND   pll.line_location_id= p_line_location_id
         AND   pll.promised_date is null;
Line: 722

         UPDATE PO_LINE_LOCATIONS_ARCHIVE_ALL PLLA
         SET    plla.promised_date = plla.need_by_date,
                plla.last_update_date = sysdate,
                plla.last_updated_by = p_user_id
         WHERE  plla.po_header_id = p_po_header_id
         AND    plla.po_release_id is null
         AND    plla.line_location_id = p_line_location_id
         AND    plla.promised_date is null
         AND    plla.revision_num = (SELECT max(plla2.revision_num)
                                     FROM   po_line_locations_archive_all plla2
                                     WHERE  plla2.line_location_id = plla.line_location_id
                                     AND    plla.revision_num <= p_revision_num);
Line: 736

        UPDATE PO_LINE_LOCATIONS_ALL PLL
        SET    pll.promised_date = pll.need_by_date,
               pll.last_update_date = sysdate,
               pll.last_updated_by = p_user_id
        WHERE  pll.po_header_id = p_po_header_id
               AND pll.promised_date is null
           /*    AND  exists (
                                SELECT 1
      	      	                FROM   PO_ACCEPTANCES PA
             	                WHERE  pa.po_header_id = p_po_header_id
          	                       AND    pa.revision_num = p_revision_num
          	                       AND    pa.po_line_location_id = pll.line_location_id ) */
               AND    nvl(pll.cancel_flag, 'N') = 'N'
               AND    ((nvl(pll.closed_code, 'OPEN') = 'OPEN' and
                       nvl(pll.consigned_flag, 'N') = 'N')  OR
                       (pll.closed_code = 'CLOSED FOR INVOICE' and  pll.consigned_flag = 'Y'));
Line: 753

        UPDATE PO_LINE_LOCATIONS_ARCHIVE_ALL PLLA
        SET    plla.promised_date = plla.need_by_date,
               plla.last_update_date = sysdate,
               plla.last_updated_by = p_user_id
        WHERE  plla.po_header_id = p_po_header_id
               AND plla.promised_date is null
               AND plla.revision_num = (SELECT max(plla2.revision_num)
                                        FROM   po_line_locations_archive_all plla2
                                        WHERE  plla2.line_location_id = plla.line_location_id
                                        AND    plla.revision_num <= p_revision_num)
              /* AND  exists (
                                SELECT 1
                                FROM   PO_ACCEPTANCES PA
                                WHERE  pa.po_header_id = p_po_header_id
                                       AND    pa.revision_num = p_revision_num
                                       AND    pa.po_line_location_id = plla.line_location_id ) */
               AND    nvl(plla.cancel_flag, 'N') = 'N'
               AND    ((nvl(plla.closed_code, 'OPEN') = 'OPEN' and
                      nvl(plla.consigned_flag, 'N') = 'N')  OR
                      (plla.closed_code = 'CLOSED FOR INVOICE' and  plla.consigned_flag = 'Y'));
Line: 781

        UPDATE po_line_locations_all pll
        SET pll.promised_date =need_by_date,
            pll.last_update_date = sysdate,
            pll.last_updated_by = p_user_id
        WHERE pll.po_header_id= p_po_header_id
              AND pll.line_location_id= p_line_location_id
              AND pll.po_release_id = p_po_release_id
              AND pll. promised_date is null;
Line: 790

        UPDATE po_line_locations_archive_all plla
        SET plla.promised_date = plla.need_by_date,
            plla.last_update_date = sysdate,
            plla.last_updated_by = p_user_id
        WHERE plla.po_header_id= p_po_header_id
              AND plla.line_location_id= p_line_location_id
              AND plla.po_release_id = p_po_release_id
              AND plla. promised_date is null
              AND plla.revision_num = (SELECT max(plla2.revision_num)
                                       FROM   po_line_locations_archive_all plla2
                                       WHERE  plla2.line_location_id = plla.line_location_id
                                       AND    plla.revision_num <= p_revision_num);
Line: 805

        UPDATE PO_LINE_LOCATIONS_ALL PLL
        SET pll.promised_date =need_by_date,
            pll.last_update_date = sysdate,
            pll.last_updated_by = p_user_id
        WHERE  pll.po_header_id = p_po_header_id
               AND pll.po_release_id = p_po_release_id
               AND pll.promised_date is null
             /*  AND  exists (
                             SELECT 1
      	      	             FROM   PO_ACCEPTANCES PA
             	             WHERE  pa.po_release_id = p_po_release_id
                                    AND pa.po_header_id = p_po_header_id
          	                    AND pa.revision_num = p_revision_num
          	                    AND pa.po_line_location_id = PLL.line_location_id ) */
             AND nvl(pll.cancel_flag, 'N') = 'N'
             AND ((nvl(pll.closed_code, 'OPEN') = 'OPEN' AND (nvl(pll.consigned_flag, 'N') = 'N')) OR (pll.closed_code = 'CLOSED FOR INVOICE' AND pll.consigned_flag = 'Y'));
Line: 822

      UPDATE PO_LINE_LOCATIONS_ARCHIVE_ALL PLLA
        SET plla.promised_date =need_by_date,
            plla.last_update_date = sysdate,
            plla.last_updated_by = p_user_id
        WHERE  plla.po_header_id = p_po_header_id
               AND plla.po_release_id = p_po_release_id
               AND plla.promised_date is null
               AND plla.revision_num = (SELECT max(plla2.revision_num)
                                       FROM   po_line_locations_archive_all plla2
                                       WHERE  plla2.line_location_id = plla.line_location_id
                                       AND    plla.revision_num <= p_revision_num)
             /*  AND  exists (
                            SELECT 1
                             FROM   PO_ACCEPTANCES PA
                             WHERE  pa.po_release_id = p_po_release_id
                                    AND pa.po_header_id = p_po_header_id
                                    AND pa.revision_num = p_revision_num
                                    AND pa.po_line_location_id = PLLA.line_location_id ) */
                                    AND nvl(plla.cancel_flag, 'N') = 'N'
                                    AND ((nvl(plla.closed_code, 'OPEN') = 'OPEN' AND (nvl(plla.consigned_flag, 'N') = 'N')) OR (plla.closed_code = 'CLOSED FOR INVOICE' AND plla.consigned_flag = 'Y'));