DBA Data[Home] [Help]

APPS.PO_AME_WF_PVT SQL Statements

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

Line: 30

PROCEDURE update_pending_signature (
           itemtype          IN VARCHAR2,
           itemkey           IN VARCHAR2,
           p_po_header_id    IN NUMBER);
Line: 39

PROCEDURE update_auth_status_approve(
            p_document_id  IN  NUMBER,
            p_item_type      IN VARCHAR2,
            p_item_key       IN VARCHAR2);
Line: 71

PROCEDURE InsertActionHistoryPoAme(
    p_document_id       IN NUMBER,
    p_draft_id          IN VARCHAR2,
    p_document_type     IN VARCHAR2,
    p_document_subtype  IN VARCHAR2,
	p_revision_num      IN NUMBER,
    p_employee_id       IN NUMBER,
    p_approval_group_id IN NUMBER,
    p_action            IN VARCHAR2,
  	p_note              IN VARCHAR2 default null)
IS
  PRAGMA AUTONOMOUS_TRANSACTION;
Line: 91

  SELECT MAX(sequence_num)
    INTO l_sequence_num
    FROM PO_ACTION_HISTORY
   WHERE object_type_code = p_document_type --'PO'
     AND object_sub_type_code = p_document_subtype --'STANDARD'
     AND object_id = p_document_id;
Line: 98

  po_forward_sv1.insert_action_history ( p_document_id,
                                         p_document_type,
                                         p_document_subtype,
                                         l_sequence_num + 1,
                                         p_action,
                                         sysdate,
                                         p_employee_id,
                                         NULL,
                                         p_note,
                                         p_revision_num,
                                         NULL,
                                         fnd_global.conc_request_id,
                                         fnd_global.prog_appl_id,
                                         fnd_global.conc_program_id,
                                         SYSDATE,
                                         fnd_global.user_id,
                                         fnd_global.login_id,
                                         p_approval_group_id);
Line: 122

END InsertActionHistoryPoAme;
Line: 148

PROCEDURE UpdateActionHistoryPoAme(
    p_document_id           NUMBER,
    p_draft_id              NUMBER,
    p_document_type     IN  VARCHAR2,
    p_document_subtype  IN  VARCHAR2,
    p_action                VARCHAR2,
    p_note                  VARCHAR2,
    p_current_approver      NUMBER)
IS
  PRAGMA AUTONOMOUS_TRANSACTION;
Line: 168

    UPDATE po_action_history
       SET action_code = p_action,
           note = p_note,
           action_date = sysdate
     WHERE object_id = p_document_id
       AND employee_id = p_current_approver
       AND action_code IS NULL
       AND object_type_code = p_document_type
       AND object_sub_type_code = p_document_subtype
       AND rownum =1;
Line: 181

     UPDATE po_action_history
        SET action_code = p_action, note = p_note, action_date = sysdate
      WHERE object_id = p_document_id
        AND action_code IS NULL
        AND object_type_code = p_document_type
        AND object_sub_type_code = p_document_subtype;
Line: 196

END UpdateActionHistoryPoAme;
Line: 240

  l_insertion_type                VARCHAR2(30);
Line: 275

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress);
Line: 310

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' Calling AME API with transaction id ' || l_transaction_id);
Line: 337

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||'.'||l_progress||':'||
                                                     ' g_next_approvers.count:'||g_next_approvers.count||
                                                     ' l_completeYNO:'||l_completeYNO);
Line: 345

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' BEFORE ESIGNER EXISTS');
Line: 353

      	      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' BEFORE update_pending_signature');
Line: 355

		  update_pending_signature(itemtype, itemkey, l_document_id);
Line: 363

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||'.'||l_progress||':'||
                                                       ' l_position_has_valid_approvers:'||l_position_has_valid_approvers||
                                                       ' g_next_approvers.count:'||g_next_approvers.count);
Line: 409

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress);
Line: 476

      PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey, l_log_head||':'||l_progress||':'||SQLERRM);
Line: 532

         SELECT person_id, full_name
           INTO l_next_approver_id, l_next_approver_name
           FROM ( SELECT person.person_id, person.full_name
                    FROM per_all_people_f person,
                         per_all_assignments_f asg,
						 wf_users wu
                   WHERE asg.position_id = g_next_approvers(l_approver_index).orig_system_id
				     AND wu.orig_system     = ame_util.perorigsystem
                     AND wu.orig_system_id  = person.person_id
                     AND TRUNC(SYSDATE) BETWEEN person.effective_start_date AND NVL(person.effective_end_date, TRUNC( SYSDATE))
                     AND person.person_id = asg.person_id
                     AND asg.primary_flag = 'Y'
                     AND asg.assignment_type IN ( 'E', 'C' )
                     AND ( person.current_employee_flag = 'Y' OR person.current_npw_flag = 'Y' )
                     AND asg.assignment_status_type_id NOT IN
                                       ( SELECT assignment_status_type_id
                                           FROM per_assignment_status_types
                                          WHERE per_system_status = 'TERM_ASSIGN' )
                     AND TRUNC(SYSDATE) BETWEEN asg.effective_start_date AND asg.effective_end_date
                   ORDER BY person.last_name)
          WHERE ROWNUM = 1;
Line: 570

          g_next_approvers.delete(l_approver_index);
Line: 748

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress);
Line: 770

      PO_WF_DEBUG_PKG.insert_debug (itemtype, itemkey, l_log_head||':'||l_progress
                                                       ||': g_next_approvers.name'
                                                       ||g_next_approvers(l_approver_index).name);
Line: 776

    SELECT TO_CHAR (l_document_id)||'-'||TO_CHAR (po_wf_itemkey_s.nextval)
      INTO l_item_key
      FROM sys.dual;
Line: 835

      PO_WF_DEBUG_PKG.insert_debug (itemtype, itemkey, l_log_head||':'||l_progress
                                                       ||' g_next_approvers.orig_system:'
                                                       ||g_next_approvers (l_approver_index).orig_system);
Line: 857

        SELECT person_id , full_name
          INTO l_next_approver_id, l_next_approver_name
          FROM ( SELECT person.person_id , person.full_name
                   FROM per_all_people_f person ,
                        per_all_assignments_f asg,
						wf_users wu
                  WHERE asg.position_id = g_next_approvers (l_approver_index).orig_system_id
				    AND wu.orig_system     = ame_util.perorigsystem
                    AND wu.orig_system_id  = person.person_id
                    AND TRUNC (sysdate) BETWEEN person.effective_start_date AND NVL (person.effective_end_date ,TRUNC (sysdate))
                    AND person.person_id = asg.person_id
                    AND asg.primary_flag = 'Y'
                    AND asg.assignment_type IN ('E','C')
                    AND ( person.current_employee_flag = 'Y' OR person.current_npw_flag = 'Y' )
                    AND asg.assignment_status_type_id NOT IN
                                         ( SELECT assignment_status_type_id
                                             FROM per_assignment_status_types
                                            WHERE per_system_status = 'TERM_ASSIGN'
                                          )
                    AND TRUNC (sysdate) BETWEEN asg.effective_start_date AND asg.effective_end_date
                  ORDER BY person.last_name )
         WHERE ROWNUM = 1;
Line: 886

      SELECT employee_id
        INTO l_next_approver_id
        FROM fnd_user
       WHERE user_id = g_next_approvers (l_approver_index).orig_system_id
         AND TRUNC (sysdate) BETWEEN start_date AND NVL (end_date ,sysdate + 1);
Line: 904

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' l_next_approver_user_name:'||l_next_approver_user_name);
Line: 966

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' g_production_Indexes.Count:'||g_production_Indexes.Count);
Line: 975

          PO_WF_DEBUG_PKG.insert_debug (itemtype, itemkey, l_log_head||':'||l_progress||' j:' || j);
Line: 976

          PO_WF_DEBUG_PKG.insert_debug (itemtype, itemkey, l_log_head||':'||l_progress||' g_production_Indexes(j):' || g_production_Indexes(j));
Line: 977

          PO_WF_DEBUG_PKG.insert_debug (itemtype, itemkey, l_log_head||':'||l_progress||' l_approver_index:' || l_approver_index);
Line: 978

          PO_WF_DEBUG_PKG.insert_debug (itemtype, itemkey, l_log_head||':'||l_progress||' g_variable_Names(j):' || g_variable_Names(j));
Line: 979

          PO_WF_DEBUG_PKG.insert_debug (itemtype, itemkey, l_log_head||':'||l_progress||' g_variable_Values(j):' || g_variable_Values(j));
Line: 989

			PO_WF_DEBUG_PKG.insert_debug (itemtype, itemkey, l_log_head||':'||l_progress||' Esigner exists (into post approval grp)');
Line: 992

      PO_WF_DEBUG_PKG.insert_debug (itemtype, itemkey, l_log_head||':'||l_progress||' No Production Rules');
Line: 1028

      PO_WF_DEBUG_PKG.insert_debug ( itemtype, itemkey, l_log_head||':'||l_progress
                                                        ||' g_next_approvers.api_insertion:'
                                                        ||g_next_approvers(l_approver_index).api_insertion);
Line: 1033

    IF (g_next_approvers (l_approver_index).api_insertion = 'Y') THEN
      n_varval (5) := 1;
Line: 1045

      PO_WF_DEBUG_PKG.insert_debug (itemtype, itemkey, l_log_head||':'||l_progress
                                                       ||' RESP:'||n_varval(6)
                                                       ||' APPL_ID:'||n_varval(7));
Line: 1087

  g_next_approvers.delete;
Line: 1098

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress);
Line: 1208

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress);
Line: 1233

     SELECT employee_id
      INTO    l_forwardee.orig_system_id
     FROM fnd_user
      WHERE user_name = l_forwardee.name;
Line: 1264

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress
                                                   ||' p_response'||p_response
                                                   ||' l_forwardee.name:'||l_forwardee.name);
Line: 1267

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress
                                                   ||' p_response'||p_response
                                                   ||' l_forwardee.orig_system:'||l_forwardee.orig_system);
Line: 1270

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress
                                                   ||' l_forwardee.orig_system_id:'||l_forwardee.orig_system_id);
Line: 1279

       SELECT name
         INTO l_forwardee.name
         FROM ( SELECT name
                  FROM wf_roles
                 WHERE orig_system = l_forwardee.orig_system
                   AND orig_system_id = l_forwardee.orig_system_id
                 ORDER BY start_date )
        WHERE ROWNUM = 1;
Line: 1292

      SELECT name
        INTO l_current_approver.name
        FROM ( SELECT name
                 FROM wf_roles
                WHERE orig_system = l_current_approver.orig_system
                  AND orig_system_id = l_current_approver.orig_system_id
                ORDER BY start_date )
       WHERE ROWNUM = 1;
Line: 1310

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress
                                                   ||' l_current_approver.name:'||l_current_approver.name);
Line: 1312

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress
                                                   ||' l_current_approver.orig_system:'||l_current_approver.orig_system);
Line: 1314

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress
                                                   ||' l_current_approver.orig_system_id:'||l_current_approver.orig_system_id);
Line: 1323

    ame_api2.updateApprovalStatus(
	  applicationIdIn => applicationId,
      transactionIdIn => l_ame_transaction_id,
      transactionTypeIn => l_transaction_type,
      approverIn => l_current_approver,
      forwardeeIn => l_forwardee);
Line: 1330

    ame_api2.updateApprovalStatus(
	  applicationIdIn => applicationId,
      transactionIdIn => l_ame_transaction_id,
      transactionTypeIn => l_transaction_type,
      approverIn => l_current_approver);
Line: 1342

    SELECT parent_item_type, parent_item_key
      INTO l_parent_item_type, l_parent_item_key
      FROM wf_items
     WHERE item_type = itemtype
       AND item_key = itemkey;
Line: 1408

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress);
Line: 1411

  SELECT parent_item_type, parent_item_key
    INTO l_parent_item_type, l_parent_item_key
    FROM wf_items
   WHERE item_type = itemtype
     AND item_key = itemkey;
Line: 1445

PROCEDURE insert_action_history(
            itemtype        IN VARCHAR2,
            itemkey         IN VARCHAR2,
            actid           IN NUMBER,
            funcmode        IN VARCHAR2,
            resultout       OUT NOCOPY VARCHAR2)
IS

  l_progress            VARCHAR2(3) := '000';
Line: 1465

  l_api_name            VARCHAR2(500) := 'insert_action_history';
Line: 1485

    PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey, l_log_head||':'||l_progress);
Line: 1502

  InsertActionHistoryPoAme(
    p_document_id       => l_document_id,
    p_draft_id          => l_draft_id,
    p_document_type     => l_document_type,
    p_document_subtype  => l_document_subtype,
	p_revision_num      => l_revision_num,
    p_employee_id       => l_next_approver_id,
    p_approval_group_id => l_approval_group_id,
    p_action            => l_action );
Line: 1528

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress);
Line: 1531

END insert_action_history;
Line: 1555

PROCEDURE update_action_history_forward(
            itemtype        IN VARCHAR2,
            itemkey         IN VARCHAR2,
            actid           IN NUMBER,
            funcmode        IN VARCHAR2,
            resultout       OUT NOCOPY VARCHAR2)
IS
  l_progress           VARCHAR2(3) := '000';
Line: 1576

  l_api_name           VARCHAR2(500) := 'Update_Action_History_Forward';
Line: 1598

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress);
Line: 1614

  UpdateActionHistoryPoAme (
    p_document_id      => l_document_id,
    p_draft_id         => l_draft_id,
    p_document_type    => l_document_type,
    p_document_subtype => l_document_subtype,
    p_action           => l_action,
    p_note             =>l_note,
    p_current_approver => l_current_approver);
Line: 1634

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' Exception:'||sqlerrm);
Line: 1637

END Update_Action_History_Forward;
Line: 1660

PROCEDURE update_action_history_approve(
            itemtype        IN VARCHAR2,
            itemkey         IN VARCHAR2,
            actid           IN NUMBER,
            funcmode        IN VARCHAR2,
            resultout       OUT NOCOPY VARCHAR2)
IS
  l_progress           VARCHAR2(3) := '000';
Line: 1682

  l_api_name           VARCHAR2(500) := 'Update_Action_History_Approve';
Line: 1705

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress);
Line: 1732

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress
                                                   ||' Doc Info:'||TO_CHAR(l_document_id)||'-'
                                                   ||TO_CHAR(l_draft_id)||'-'||l_document_type
                                                   ||'-'||l_document_subtype);
Line: 1738

  UpdateActionHistoryPoAme (
    p_document_id      => l_document_id,
    p_draft_id         => l_draft_id,
    p_document_type    => l_document_type,
    p_document_subtype => l_document_subtype,
    p_action           => l_action,
    p_note             =>l_note,
    p_current_approver => l_current_approver);
Line: 1758

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress);
Line: 1761

END Update_Action_History_Approve;
Line: 1784

PROCEDURE update_action_history_reject(
            itemtype        IN VARCHAR2,
            itemkey         IN VARCHAR2,
            actid           IN NUMBER,
            funcmode        IN VARCHAR2,
            resultout       OUT NOCOPY VARCHAR2)
IS
  l_progress           VARCHAR2(3) := '000';
Line: 1805

  l_api_name           VARCHAR2(500) := 'Update_Action_History_Reject';
Line: 1821

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress);
Line: 1855

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress
                                                   ||' Doc Info:'||TO_CHAR(l_document_id)||'-'
                                                   ||TO_CHAR(l_draft_id)||'-'||l_document_type
                                                   ||'-'||l_document_subtype);
Line: 1861

  UpdateActionHistoryPoAme (
    p_document_id      => l_document_id,
    p_draft_id         => l_draft_id,
    p_document_type    => l_document_type,
    p_document_subtype => l_document_subtype,
    p_action           => l_action,
    p_note             =>l_note,
    p_current_approver => l_current_approver);
Line: 1880

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress);
Line: 1883

END Update_Action_History_Reject;
Line: 1906

PROCEDURE update_action_history_timeout(
            itemtype        IN VARCHAR2,
            itemkey         IN VARCHAR2,
            actid           IN NUMBER,
            funcmode        IN VARCHAR2,
            resultout       OUT NOCOPY VARCHAR2)
IS
  l_progress           VARCHAR2(3) := '000';
Line: 1926

  l_api_name           VARCHAR2(500) := 'Update_Action_History_Timeout';
Line: 1942

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress);
Line: 1963

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress
                                                   ||' Doc Info:'||TO_CHAR(l_document_id)
                                                   ||'-'||TO_CHAR(l_draft_id)||'-'
                                                   ||l_document_type||'-'||l_document_subtype);
Line: 1969

  UpdateActionHistoryPoAme (
    p_document_id      => l_document_id,
    p_draft_id         => l_draft_id,
    p_document_type    => l_document_type,
    p_document_subtype => l_document_subtype,
    p_action           => l_action,
    p_note             =>l_note,
    p_current_approver => l_current_approver);
Line: 1988

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress);
Line: 1991

END Update_Action_History_Timeout;
Line: 2014

PROCEDURE update_action_history_app_fwd(
            itemtype        IN VARCHAR2,
            itemkey         IN VARCHAR2,
            actid           IN NUMBER,
            funcmode        IN VARCHAR2,
            resultout       OUT NOCOPY VARCHAR2)
IS
  l_progress           VARCHAR2(3) := '000';
Line: 2034

  l_api_name           VARCHAR2(500) := 'update_action_history_app_fwd';
Line: 2050

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress);
Line: 2071

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress
                                                   ||' Doc Info:'||TO_CHAR(l_document_id)
                                                   ||'-'||TO_CHAR(l_draft_id)||'-'
                                                   ||l_document_type||'-'||l_document_subtype);
Line: 2077

  UpdateActionHistoryPoAme (
    p_document_id      => l_document_id,
    p_draft_id         => l_draft_id,
    p_document_type    => l_document_type,
    p_document_subtype => l_document_subtype,
    p_action           => l_action,
    p_note             => l_note,
    p_current_approver => l_current_approver);
Line: 2096

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress);
Line: 2099

END update_action_history_app_fwd;
Line: 2152

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress);
Line: 2163

  SELECT parent_item_type, parent_item_key
    INTO l_parent_item_type, l_parent_item_key
    FROM wf_items
   WHERE item_type = itemtype
     AND item_key = itemkey;
Line: 2174

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' Returned from process_response_internal');
Line: 2192

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' Process_Response_App_Forward completed');
Line: 2250

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress);
Line: 2261

  SELECT parent_item_type, parent_item_key
    INTO l_parent_item_type, l_parent_item_key
    FROM wf_items
   WHERE item_type = itemtype
     AND item_key = itemkey;
Line: 2287

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' Completed');
Line: 2345

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' Start');
Line: 2360

  SELECT parent_item_type, parent_item_key
    INTO l_parent_item_type, l_parent_item_key
    FROM wf_items
   WHERE item_type = itemtype
     AND item_key = itemkey;
Line: 2384

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' Completed');
Line: 2441

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' Start');
Line: 2452

  SELECT parent_item_type, parent_item_key
    INTO l_parent_item_type, l_parent_item_key
    FROM wf_items
   WHERE item_type = itemtype
     AND item_key = itemkey;
Line: 2478

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' Completed');
Line: 2536

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' Start');
Line: 2550

  SELECT parent_item_type, parent_item_key
    INTO l_parent_item_type, l_parent_item_key
    FROM wf_items
   WHERE item_type = itemtype
     AND item_key = itemkey;
Line: 2580

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' Completed');
Line: 2635

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' Start');
Line: 2722

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' Start');
Line: 2723

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||' funcmode:'||funcmode);
Line: 2741

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' l_action:'||l_action);
Line: 2764

          SELECT original_recipient,
                 DECODE(more_info_role, NULL, recipient_role, more_info_role)
            INTO l_original_recipient, l_current_recipient_role
            FROM wf_notifications
           WHERE notification_id = WF_ENGINE.context_nid
             AND (more_info_role IS NOT NULL OR recipient_role <> original_recipient );
Line: 2783

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||
		                l_progress||' l_new_recipient_id:'||l_new_recipient_id);
Line: 2806

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress
                                                       ||' l_current_recipient_id:'||l_current_recipient_id);
Line: 2818

        UpdateActionHistoryPoAme(
		  p_document_id      => l_document_id,
          p_draft_id         => l_draft_id,
          p_document_type    => l_document_type,
          p_document_subtype => l_document_subtype,
          p_action           => l_action,
          p_note             => wf_engine.context_user_comment,
          p_current_approver => l_current_recipient_id );
Line: 2827

        InsertActionHistoryPoAme(
		  p_document_id       => l_document_id,
          p_draft_id          => l_draft_id,
          p_document_type     => l_document_type,
          p_document_subtype  => l_document_subtype,
	      p_revision_num      => l_revision_num,
          p_employee_id       => l_new_recipient_id,
          p_approval_group_id => l_approval_group_id,
          p_action            => NULL );
Line: 2855

    SELECT fu.user_id
      INTO l_responder_id
      FROM fnd_user fu,
           wf_notifications wfn
     WHERE wfn.notification_id = l_nid
       AND wfn.original_recipient = fu.user_name;
Line: 2870

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' l_preserved_ctx:'||l_preserved_ctx);
Line: 2871

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' l_responder_id:'||l_responder_id);
Line: 2892

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' l_session_user_id:'||l_session_user_id);
Line: 2893

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' l_session_resp_id:'||l_session_resp_id);
Line: 2894

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' l_session_appl_id:'||l_session_appl_id);
Line: 2902

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' l_preparer_resp_id:'||l_preparer_resp_id);
Line: 2903

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' l_preparer_appl_id:'||l_preparer_appl_id);
Line: 2946

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' Completed');
Line: 3023

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' Start');
Line: 3041

    SELECT nls_language, nls_territory
      INTO l_language, l_territory
      FROM fnd_languages
     WHERE language_code = l_language_code;
Line: 3048

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' Error when fetching language:'||sqlerrm);
Line: 3104

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' l_request_id:'||l_request_id);
Line: 3118

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' Exception when submitting the request');
Line: 3119

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' fnd_message:'||l_msg);
Line: 3125

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' Exception:'||sqlerrm);
Line: 3189

    SELECT fl.file_name, dbms_lob.getlength(fl.file_data)
      FROM fnd_documents d,
           fnd_attached_documents ad,
           fnd_doc_category_usages dcu,
           fnd_attachment_functions af,
           fnd_lobs fl
     WHERE ( (ad.pk1_value = TO_CHAR(l_po_header_id) AND ad.entity_name = 'PO_HEADERS') OR
             (ad.pk1_value =  (SELECT To_Char(vendor_id)
                                 FROM po_headers_all
                                WHERE po_header_id = l_po_header_id) AND ad.entity_name = 'PO_VENDORS') OR
             (ad.pk1_value IN (SELECT To_Char(po_line_id)
                                 FROM po_lines_all
                                WHERE po_header_id = l_po_header_id ) AND ad.entity_name = 'PO_LINES') OR
             (ad.pk1_value IN (SELECT To_Char(from_header_id)
                                 FROM po_lines_all
                                WHERE po_header_id = l_po_header_id
                                  AND from_header_id IS NOT NULL ) AND ad.entity_name = 'PO_HEADERS') OR
             (ad.pk1_value IN (SELECT To_Char(from_line_id)
                                 FROM po_lines_all
                                WHERE po_header_id = l_po_header_id
                                  AND from_line_id IS NOT NULL ) AND ad.entity_name = 'PO_LINES') OR
             (ad.pk1_value IN (SELECT To_Char(line_location_id)
                                 FROM po_line_locations_all
                                WHERE po_header_id = l_po_header_id
                                  AND shipment_type IN ('PRICE BREAK', 'STANDARD', 'PREPAYMENT')) AND ad.entity_name = 'PO_SHIPMENTS') OR
             (ad.pk2_value IN (SELECT To_Char(item_id)
                                 FROM po_lines_all
                                WHERE po_header_id = l_po_header_id
                                  AND TO_CHAR(PO_COMMUNICATION_PVT.getInventoryOrgId()) = ad.pk1_value
                                  AND item_id IS NOT NULL ) AND ad.entity_name = 'MTL_SYSTEM_ITEMS') )
       AND d.document_id = ad.document_id
       AND dcu.category_id = d.category_id
       AND dcu.attachment_function_id = af.attachment_function_id
       AND d.datatype_id = 6
       AND af.function_name = 'PO_PRINTPO'
       AND d.media_id = fl.file_id
       AND dcu.enabled_flag = 'Y'
     GROUP BY fl.file_name, dbms_lob.getlength(fl.file_data)
     ORDER BY fl.file_name;
Line: 3241

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' Start');
Line: 3259

    SELECT pv.language
      INTO l_supp_lang
      FROM po_vendor_sites_all pv, po_headers_all ph
     WHERE ph.po_header_id = l_header_id
       AND ph.vendor_site_id = pv.vendor_site_id;
Line: 3267

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress
                                                       ||' Error while fetching vendor site language:'||sqlerrm);
Line: 3274

    SELECT nls_language
      INTO l_language
      FROM fnd_languages
     WHERE language_code = l_language_code;
Line: 3281

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress
                                                       ||' Error while fetching the language code:'||sqlerrm);
Line: 3310

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' Checking for supplier file attachments');
Line: 3318

            PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' No Supplier file attachments');
Line: 3324

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' l_attachments_exist:'||l_attachments_exist);
Line: 3344

          PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' Check for duplicate filenames');
Line: 3350

          SELECT 'Y'
            INTO l_duplicate_filenames
            FROM dual
           WHERE EXISTS ( SELECT fl.file_name
                            FROM fnd_documents d,
                                 fnd_attached_documents ad,
                                 fnd_doc_category_usages dcu,
                                 fnd_attachment_functions af,
                                 fnd_lobs fl
                           WHERE ( (ad.pk1_value = TO_CHAR(l_document_id) AND ad.entity_name = 'PO_HEADERS') OR
                                    --
                                   (ad.pk1_value = TO_CHAR((SELECT vendor_id
                                                              FROM po_headers_all
                                                             WHERE po_header_id = l_document_id))
                                                   AND ad.entity_name = 'PO_VENDORS') OR
                                    --
                                   (ad.pk1_value IN (SELECT po_line_id
                                                       FROM po_lines_all
                                                      WHERE po_header_id = l_document_id)
                                                AND ad.entity_name = 'PO_LINES') OR
                                    --
                                   (ad.pk1_value IN (SELECT from_header_id
                                                       FROM po_lines_all
                                                      WHERE po_header_id = l_document_id
                                                        AND from_header_id IS NOT NULL) AND ad.entity_name = 'PO_HEADERS') OR
                                    --
                                   (ad.pk1_value IN (SELECT from_line_id
                                                       FROM po_lines_all
                                                      WHERE po_header_id = l_document_id
                                                        AND from_line_id IS NOT NULL) AND ad.entity_name = 'PO_LINES') OR
                                    --
                                   (ad.pk1_value IN (SELECT line_location_id
                                                       FROM po_line_locations_all
                                                      WHERE po_header_id = l_document_id
                                                        AND shipment_type IN ('PRICE BREAK', 'STANDARD', 'PREPAYMENT'))
                                                AND ad.entity_name = 'PO_SHIPMENTS') OR
                                    --
                                   (ad.pk2_value IN (SELECT item_id
                                                       FROM po_lines_all
                                                      WHERE po_header_id = l_document_id
                                                        AND TO_CHAR(PO_COMMUNICATION_PVT.getInventoryOrgId()) = ad.pk1_value
                                                        AND item_id IS NOT NULL) AND ad.entity_name = 'MTL_SYSTEM_ITEMS'))
                             AND d.document_id = ad.document_id
                             AND dcu.category_id = d.category_id
                             AND dcu.attachment_function_id = af.attachment_function_id
                             AND d.datatype_id = 6
                             AND af.function_name = 'PO_PRINTPO'
                             AND d.media_id = fl.file_id
                             AND dcu.enabled_flag = 'Y'
                           GROUP BY fl.file_name
                          HAVING COUNT(*)>1);
Line: 3408

              PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' No duplicate attachments');
Line: 3416

            PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' Duplicate filenames found');
Line: 3440

            PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' l_error_flag:'||l_error_flag);
Line: 3454

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||'Exception when detecting duplicates');
Line: 3455

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' sqlerrm:'||sqlerrm);
Line: 3471

    SELECT nls_territory
      INTO l_territory
      FROM fnd_languages
     WHERE nls_language = l_supp_lang;
Line: 3528

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' l_request_id:'||l_request_id);
Line: 3543

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' Exception when submitting the request');
Line: 3544

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' fnd_message:'||l_msg);
Line: 3551

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' Exception:'||sqlerrm);
Line: 3614

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' Start');
Line: 3621

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress
                                                   ||' l_forward_to_username_response:'||l_forward_to_username_response);
Line: 3639

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' l_current_approver:'||l_current_approver);
Line: 3644

  InsertActionHistoryPoAme(
    p_document_id       => l_document_id,
    p_draft_id          => l_draft_id,
    p_document_type     => l_document_type,
    p_document_subtype  => l_document_subtype,
	p_revision_num      => l_revision_num,
    p_employee_id       => l_current_approver,
    p_approval_group_id => l_approval_group_id,
    p_action            => 'FORWARD');
Line: 3656

  InsertActionHistoryPoAme(
    p_document_id       => l_document_id,
    p_draft_id          => l_draft_id,
    p_document_type     => l_document_type,
    p_document_subtype  => l_document_subtype,
	p_revision_num      => l_revision_num,
    p_employee_id       => l_current_approver,
    p_approval_group_id => l_approval_group_id,
    p_action            => NULL);
Line: 3729

    SELECT wfi.item_type,
           wfi.item_key,
           wfn.recipient_role,
           wfn.original_recipient
      FROM wf_items wfi,
           wf_item_activity_statuses wfias,
           wf_notifications wfn
     WHERE wfi.parent_item_key = itemkey
       AND wfi.item_type = itemtype
       AND wfias.item_type = wfi.item_type
       AND wfias.item_key = wfi.item_key
       AND wfias.activity_status = 'NOTIFIED'
       AND wfias.notification_id IS NOT NULL
       AND wfias.notification_id = wfn.notification_id;
Line: 3760

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' Start');
Line: 3763

  SELECT parent_item_type, parent_item_key
    INTO l_parent_item_type, l_parent_item_key
    FROM wf_items
   WHERE item_type = itemtype
     AND item_key = itemkey;
Line: 3788

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' l_ame_transaction_id:'||l_ame_transaction_id);
Line: 3789

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' l_transaction_type:'||l_transaction_type);
Line: 3815

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress
                                                       ||' Index:'||TO_CHAR(i));
Line: 3817

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress
                                                       ||' orig_system:'|| l_approver_list(i).orig_system);
Line: 3819

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress
                                                       ||' orig_system_id:'|| l_approver_list(i).orig_system_id);
Line: 3821

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress
                                                       ||' authority:'|| l_approver_list(i).authority);
Line: 3823

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress
                                                       ||' approval_status:'|| l_approver_list(i).approval_status);
Line: 3825

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress
                                                       ||' api_insertion:'|| l_approver_list(i).api_insertion);
Line: 3827

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress
                                                       ||' group_or_chain_id:'|| l_approver_list(i).group_or_chain_id);
Line: 3829

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress
                                                       ||' beatByFirstResponderStatus:'||ame_util.beatByFirstResponderStatus);
Line: 3831

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress
                                                       ||' oamGenerated:'||ame_util.oamGenerated);
Line: 3833

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress
                                                       ||' l_approver_group_id:'||l_approver_group_id);
Line: 3839

           AND  l_approver_list(i).api_insertion = ame_util.oamGenerated
           AND  l_approver_list(i).group_or_chain_id = l_approver_group_id) THEN

        l_orig_system :=  l_approver_list(i).orig_system;
Line: 3858

            SELECT person_id
              INTO l_person_id
              FROM ( SELECT person.person_id
                       FROM per_all_people_f person,
                            per_all_assignments_f asg,
							wf_users wu
                      WHERE asg.position_id = l_orig_system_id
					    AND wu.orig_system     = ame_util.perorigsystem
                        AND wu.orig_system_id  = person.person_id
                        AND TRUNC(SYSDATE) BETWEEN person.effective_start_date AND NVL(person.effective_end_date, TRUNC( SYSDATE) )
                        AND person.person_id = asg.person_id
                        AND asg.primary_flag = 'Y'
                        AND asg.assignment_type IN ( 'E', 'C' )
                        AND ( person.current_employee_flag = 'Y' OR person.current_npw_flag = 'Y' )
                        AND asg.assignment_status_type_id NOT IN
                                         (SELECT assignment_status_type_id
                                            FROM per_assignment_status_types
                                           WHERE per_system_status = 'TERM_ASSIGN' )
                        AND TRUNC(SYSDATE) BETWEEN asg.effective_start_date AND asg.effective_end_date
                      ORDER BY person.last_name )
             WHERE ROWNUM = 1;
Line: 3886

          SELECT employee_id
            INTO l_person_id
            FROM fnd_user
           WHERE user_id = l_orig_system_id
             AND TRUNC(SYSDATE) BETWEEN start_date AND NVL(end_date, SYSDATE + 1);
Line: 3896

          PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' l_person_id:'||l_person_id);
Line: 3912

            PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress
                                                           ||' l_child_approver_empid:'||l_child_approver_empid);
Line: 3914

            PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress
                                                           ||' l_child_approver_groupid:'||l_child_approver_groupid);
Line: 3923

              PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress
                                                             ||' l_child_wf_cur.item_key:'||l_child_wf_cur.item_key);
Line: 3936

		  UpdateActionHistoryPoAme (
	        p_document_id      => l_po_header_id,
            p_draft_id         => l_draft_id,
            p_document_type    => l_document_type,
            p_document_subtype => l_document_subtype,
            p_action           => 'NO ACTION',
            p_note             => l_note,
            p_current_approver => l_person_id);
Line: 3963

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' child item_key:'||l_child_wf_cur.item_key);
Line: 3982

		    UpdateActionHistoryPoAme (
	           p_document_id      => l_po_header_id,
            p_draft_id         => l_draft_id,
            p_document_type    => l_document_type,
            p_document_subtype => l_document_subtype,
            p_action           => 'NO ACTION',
            p_note             => l_note,
            p_current_approver => l_person_id);
Line: 4015

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress);
Line: 4040

PROCEDURE update_resp_verf_failed(
            itemtype        IN VARCHAR2,
            itemkey         IN VARCHAR2,
            actid           IN NUMBER,
            funcmode        IN VARCHAR2,
            resultout       OUT NOCOPY VARCHAR2)
IS
  l_progress          VARCHAR2(3) := '000';
Line: 4050

  l_api_name          VARCHAR2(500) := 'update_resp_verf_failed';
Line: 4066

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' Start');
Line: 4069

  SELECT parent_item_type, parent_item_key
    INTO l_parent_item_type, l_parent_item_key
    FROM wf_items
   WHERE item_type = itemtype
     AND item_key = itemkey;
Line: 4083

END update_resp_verf_failed;
Line: 4105

PROCEDURE update_resp_verf_failed_reject(
            itemtype        IN VARCHAR2,
            itemkey         IN VARCHAR2,
            actid           IN NUMBER,
            funcmode        IN VARCHAR2,
            resultout       OUT NOCOPY VARCHAR2)
IS
  l_progress          VARCHAR2(3) := '000';
Line: 4115

  l_api_name          VARCHAR2(500) := 'update_resp_verf_failed_reject';
Line: 4131

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' Start');
Line: 4134

  SELECT parent_item_type, parent_item_key
    INTO l_parent_item_type, l_parent_item_key
    FROM wf_items
   WHERE item_type = itemtype
     AND item_key = itemkey;
Line: 4148

END update_resp_verf_failed_reject;
Line: 4196

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' Start');
Line: 4226

PROCEDURE update_action_history_reminder(
            itemtype        IN VARCHAR2,
            itemkey         IN VARCHAR2,
            actid           IN NUMBER,
            funcmode        IN VARCHAR2,
            resultout       OUT NOCOPY VARCHAR2)
IS
  l_no_of_reminder      NUMBER;
Line: 4245

  l_api_name            VARCHAR2(500) := 'update_action_history_reminder';
Line: 4261

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' Start');
Line: 4286

  UpdateActionHistoryPoAme(
    p_document_id      => l_document_id,
    p_draft_id         => l_draft_id,
    p_document_type    => l_document_type,
    p_document_subtype => l_document_subtype,
    p_action           => l_action,
    p_note             => NULL,
    p_current_approver => l_current_approver);
Line: 4302

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress);
Line: 4305

END update_action_history_reminder;
Line: 4357

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress||' Start');
Line: 4373

    SELECT HR.PERSON_ID
      INTO x_user_id
      FROM FND_USER FND, PO_WORKFORCE_CURRENT_X HR
     WHERE FND.USER_NAME = l_forward_to_username_response
       AND FND.EMPLOYEE_ID = HR.PERSON_ID
       AND ROWNUM = 1;
Line: 4430

SELECT LEVEL,
       item_type,
       item_key,
       end_date
FROM   wf_items
START WITH item_type = t_item_type
           AND item_key = t_item_key
CONNECT BY PRIOR item_type = parent_item_type
                 AND PRIOR item_key = parent_item_key
ORDER  BY LEVEL DESC;
Line: 4524

      UPDATE po_headers_all
      SET authorization_status = decode(approved_date, NULL, 'INCOMPLETE',
                                        'REQUIRES REAPPROVAL'),
          wf_item_type = p_item_type,
          wf_item_key = p_item_key,
	         approved_flag = decode(approved_date, NULL, 'N', 'R'),
          pending_signature_flag    = 'N',
          acceptance_required_flag  = 'N',
          acceptance_due_date       = Null,
          last_updated_by           = FND_GLOBAL.user_id,
          last_update_login         = FND_GLOBAL.login_id,
          last_update_date          = sysdate,
          ame_approval_id           = DECODE(ame_transaction_type,
		                                       NULL,NULL,
											   po_ame_approvals_s.NEXTVAL)
      WHERE po_header_id = p_document_id;
Line: 4693

SELECT DISTINCT poh.employee_id
FROM   po_action_history poh
WHERE  poh.object_id = p_po_header_id
       AND poh.employee_id IS NOT NULL
       AND poh.sequence_num >= (SELECT MAX(sequence_num)
                                FROM   po_action_history poh1
                                WHERE  poh1.object_id = p_po_header_id
                                       AND poh1.action_code = 'SUBMIT')
UNION
SELECT agent_id
FROM po_headers_all
WHERE po_header_id = p_po_header_id;
Line: 4720

  SELECT segment1
  INTO   l_document_number
  FROM   po_headers_all
  WHERE  po_header_id = p_document_id;
Line: 4765

	SELECT acceptance_id
    INTO l_acceptance_id
 	  FROM po_acceptances
  	WHERE po_header_id=p_document_id;
Line: 4778

    SELECT psc.user_name
    INTO l_supp_contact_user_name
    FROM po_supplier_contacts_val_v psc,
         po_headers_all poh
    WHERE psc.vendor_contact_id= poh.vendor_contact_id
    AND psc.vendor_site_id= poh.vendor_site_id
    AND po_header_id=p_document_id;
Line: 4898

    SELECT wf_item_type, wf_item_key
    INTO l_item_type,l_item_key
    FROM po_headers_all
    WHERE po_header_id = p_document_id;
Line: 4966

             p_message  => 'Authorization status update complete' );
Line: 4970

     UpdateActionHistoryPoAme(
	   p_document_id      => p_document_id,
       p_draft_id         => p_draft_id,
       p_document_type    => p_document_type,
       p_document_subtype => p_document_sub_type,
       p_action           => 'NO ACTION',
       p_note             => l_note,
       p_current_approver => NULL);
Line: 4985

             p_message  => 'Updated the existing NULL actions with NO ACTION');
Line: 4988

     InsertActionHistoryPoAme (
	   p_document_id       => p_document_id,
       p_draft_id          => p_draft_id,
       p_document_type     => p_document_type,
       p_document_subtype  => p_document_sub_type,
		p_revision_num     => p_revision_num,
       p_employee_id       => p_current_employee_id,
       p_approval_group_id => NULL,
       p_action            => 'WITHDRAW',
       p_note              => p_note);
Line: 5005

             p_message  => 'Inserted WITHDRAW action in action history');
Line: 5009

      SELECT nvl(SEND_WITHDRW_NOTF_FLAG,'N')
      INTO   l_send_notf_flag
      FROM   po_doc_style_headers ds,
             po_headers_all poh
      WHERE  poh.po_header_id = p_document_id
             AND poh.style_id = ds.style_id;
Line: 5117

     PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_log_head || ' 001 ');
Line: 5134

      ame_api2.updateApprovalStatus ( applicationIdIn => applicationId,
                                    transactionIdIn => l_ame_transaction_id,
                                    transactionTypeIn => l_transaction_type,
                                    approverIn => g_next_approvers(l_approver_index),
                                    updateItemIn => TRUE);
Line: 5140

		PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||' 002 :'||' updated ame for '||
		                             g_next_approvers(l_approver_index).name || ' with null status');
Line: 5148

   PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_log_head || ' return e_signer_flag=' || e_signer_flag);
Line: 5335

           SELECT person_id , full_name
             INTO l_next_approver_id, l_next_approver_name
             FROM ( SELECT person.person_id , person.full_name
                      FROM per_all_people_f person ,
                           per_all_assignments_f asg ,
						   wf_users wu
                     WHERE asg.position_id = ApproverList(l_approver_index).orig_system_id
					   AND wu.orig_system     = ame_util.perorigsystem
                       AND wu.orig_system_id  = person.person_id
                       AND TRUNC (sysdate) BETWEEN person.effective_start_date AND NVL (person.effective_end_date ,TRUNC (sysdate))
                       AND person.person_id = asg.person_id
                       AND asg.primary_flag = 'Y'
                       AND asg.assignment_type IN ('E','C')
                       AND ( person.current_employee_flag = 'Y' OR person.current_npw_flag = 'Y' )
                       AND asg.assignment_status_type_id NOT IN
                                            ( SELECT assignment_status_type_id
                                                FROM per_assignment_status_types
                                               WHERE per_system_status = 'TERM_ASSIGN'
                                             )
                       AND TRUNC (sysdate) BETWEEN asg.effective_start_date AND asg.effective_end_date
                     ORDER BY person.last_name )
            WHERE ROWNUM = 1;
Line: 5359

           SELECT employee_id
             INTO l_next_approver_id
             FROM fnd_user
            WHERE user_id = ApproverList(l_approver_index).orig_system_id
              AND TRUNC (sysdate) BETWEEN start_date AND NVL (end_date ,sysdate + 1);
Line: 5401

         SELECT displayed_field
           INTO l_approver_category
         FROM po_lookup_codes
           WHERE  lookup_type = 'PO_APPROVER_TYPE'
           AND lookup_code = l_approver_category;
Line: 5426

	   -- Insert record in x_approver_tab
       x_approver_tab.extend;
Line: 5646

     PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_log_head || ' 001 ');
Line: 5666

      SELECT displayed_field
        INTO l_response_code
        FROM Po_Lookup_Codes
       WHERE Lookup_Type = 'ERECORD_RESPONSE'
         AND Lookup_Code = l_esigner_response;
Line: 5677

      SELECT displayed_field
        INTO l_reason_code
        FROM Po_Lookup_Codes
       WHERE Lookup_Type = 'ERECORD_REASON'
         AND Lookup_Code = 'ERES_REASON';
Line: 5688

      SELECT displayed_field
        INTO l_signer_type
        FROM Po_Lookup_Codes
       WHERE Lookup_Type = 'ERECORD_SIGNER_TYPE'
         AND Lookup_Code = Decode(l_signer,'BUYER','CUSTOMER');
Line: 5719

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_log_head || ' 002 ');
Line: 5720

			PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_log_head || ' l_response_code ' || l_response_code
      || ' l_reason_code' || l_reason_code || ' l_signer_type' || l_signer_type || ' l_event_name' || l_event_name
      || '  l_requester' ||l_requester || ' l_user_name' || l_user_name || ' l_notif_id ' || l_notif_id) ;
Line: 5777

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_log_head || ' 003');
Line: 5790

             PO_WF_DEBUG_PKG.INSERT_DEBUG(itemtype, itemkey, 'End erecords_exception:PO_AME_WF_PVT.CREATE_ERECORD ');
Line: 5791

             PO_WF_DEBUG_PKG.INSERT_DEBUG(itemtype, itemkey, 'ERROR RETURNED '||l_msg_data || 'error is ' || SQLERRM  || ' code is ' || SQLCODE);
Line: 5848

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, 'PO_AME_WF_PVT.check_for_esigner_exists: ' || l_esigner_exists);
Line: 5877

PROCEDURE update_pending_signature(
            itemtype       IN VARCHAR2,
            itemkey        IN VARCHAR2,
            p_po_header_id IN NUMBER)
IS
  l_api_name                      VARCHAR2(100) := 'update_pending_signature';
Line: 5890

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head || ' 001');
Line: 5893

  UPDATE po_headers_all
  SET pending_signature_flag='E'
  WHERE po_header_id = p_po_header_id
  AND NVL(acceptance_required_flag,'N') <>'S';
Line: 5899

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_log_head || ' no os rows updated' || SQL%ROWCOUNT);
Line: 5908

END update_pending_signature;
Line: 5932

PROCEDURE update_auth_status_approve(
            p_document_id  IN  NUMBER,
            p_item_type      IN VARCHAR2,
            p_item_key       IN VARCHAR2)
IS
PRAGMA AUTONOMOUS_TRANSACTION;
Line: 5940

  l_api_name                      VARCHAR2(500) := 'update_auth_status_approve';
Line: 5949

    PO_WF_DEBUG_PKG.insert_debug(p_item_type,p_item_key, l_log_head || ' 001');
Line: 5959

    PO_WF_DEBUG_PKG.insert_debug(p_item_type,p_item_key, l_log_head || ' 002 Updating status for Userid-' || l_user_id
                                                   || ' LoginId-' || l_login_id || ' and DocumentId' || p_document_id);
Line: 5963

  UPDATE  po_headers poh
  SET     poh.authorization_status = po_document_action_pvt.g_doc_status_approved
         ,poh.approved_flag = 'Y'
         ,poh.approved_date = sysdate
         ,poh.last_update_date = sysdate
         ,poh.last_updated_by = l_user_id
         ,poh.last_update_login = l_login_id
         ,poh.pending_signature_flag = 'N'
         ,poh.acceptance_required_flag  = 'N'
         ,acceptance_due_date = Null
  WHERE   poh.po_header_id = p_document_id;
Line: 5976

    PO_WF_DEBUG_PKG.insert_debug(p_item_type,p_item_key, l_log_head || ' 003 : After updating po_headers_all ');
Line: 5979

  UPDATE  po_line_locations_all poll
  SET     poll.approved_flag = 'Y'
         ,poll.approved_date = sysdate
         ,poll.last_update_date = sysdate
         ,poll.last_updated_by = l_user_id
         ,poll.last_update_login = l_login_id
  WHERE   poll.po_header_id = p_document_id
  AND     poll.po_release_id IS NULL
  AND     nvl (poll.approved_flag,'N') <> 'Y';
Line: 5990

    PO_WF_DEBUG_PKG.insert_debug(p_item_type,p_item_key, l_log_head || ' After updating po_line_locations_all' );
Line: 5995

END update_auth_status_approve;
Line: 6019

PROCEDURE update_auth_status_esign(
            itemtype   IN        VARCHAR2,
            itemkey    IN        VARCHAR2,
            actid      IN        NUMBER,
            funcmode   IN        VARCHAR2,
            resultout  OUT NOCOPY VARCHAR2)
IS
  l_document_id                   NUMBER;
Line: 6032

  l_api_name                      VARCHAR2(500) := 'update_pending_signature';
Line: 6049

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head || ' 001');
Line: 6062

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head || ' 002 Updating status DocumentId' || l_document_id);
Line: 6065

  update_auth_status_approve(
    p_document_id => l_document_id,
    p_item_type   => itemtype,
    p_item_key    => itemkey);
Line: 6072

  PO_DELREC_PVT.create_update_delrec (
     p_api_version      => 1.0,
     x_return_status    => l_return_status,
     x_msg_count        => l_msg_count,
     x_msg_data         => l_msg_data,
     p_action           => 'APPROVE',
     p_doc_type         => l_document_type,
     p_doc_subtype      => l_document_subtype,
     p_doc_id           => l_document_id,
     p_line_id          => NULL,
     p_line_location_id => NULL);
Line: 6088

    SELECT max(action_date)
    INTO l_acceptance_date
    FROM PO_ACCEPTANCES
    WHERE Po_Header_Id = l_document_id
    AND Revision_Num = l_revision_num
    AND Signature_Flag = 'Y'
    AND ACCEPTING_PARTY IN ('B','S')
    AND ACCEPTED_FLAG= 'Y';
Line: 6101

    PO_CONTERMS_WF_PVT.UPDATE_CONTRACT_TERMS(
      p_po_header_id      => l_document_id,
      p_signed_date       => l_acceptance_date,
      x_return_status     => l_return_status,
      x_msg_data          => l_msg_data,
      x_msg_count         => l_msg_count);
Line: 6138

       PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head || ' in binding excpetion with error messsage ' ||  x_error_msg);
Line: 6147

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head||':'||l_progress);
Line: 6150

END update_auth_status_esign;
Line: 6202

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head || ' 001');
Line: 6211

  SELECT wf_item_key
  INTO  l_po_itemkey
  FROM po_headers_all poh
  WHERE poh.po_header_id = l_document_id;
Line: 6222

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head || ' 002 result : ' || l_result);
Line: 6275

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head || ' 001 ');
Line: 6284

    PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head || ' l_esigners_exists ' ||  l_esigner_exists);
Line: 6298

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head || ' l_esigners_exists ' ||  l_esigner_exists);
Line: 6356

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head || ' 001 ');
Line: 6376

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head || ' supressing approver name ' ||  l_approver_list(l_approver_index).name);
Line: 6436

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_log_head || ' 001 ');