DBA Data[Home] [Help]

APPS.POR_AME_REQ_WF_PVT SQL Statements

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

Line: 13

PROCEDURE UpdateActionHistory(p_document_id      NUMBER,
                              p_action           VARCHAR2,
                              p_note             VARCHAR2,
                              p_current_approver NUMBER);
Line: 19

procedure insertActionHistoryPo( p_document_id in number,
			p_draft_id	in	number,
			p_document_type in varchar2,
			p_document_subtype in varchar2,
			p_transaction_type in varchar2,
                        p_employee_id in number,
                        p_approval_group_id in number);
Line: 27

procedure UpdateActionHistoryPo(p_transaction_type	VARCHAR2,
			p_document_id      NUMBER,
			p_draft_id				 NUMBER,
      p_document_type IN  VARCHAR2,   --Bug 13444730
      p_document_subtype IN  VARCHAR2,   --Bug 13444730
      p_action           VARCHAR2,
      p_note             VARCHAR2,
      p_current_approver NUMBER);
Line: 81

  l_insertion_type            VARCHAR2(30);
Line: 95

      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 101

           PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 144

          PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 162

		  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 182

                      PO_WF_DEBUG_PKG.insert_debug(itemtype, itemkey,'POR_AME_REQ_WF_PVT Get_Next_Approvers: Unable to get the next approvers from AME.'||l_progress||sqlerrm);
Line: 183

                      PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_doc_string);
Line: 194

              PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 203

                PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 208

                PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 251

           PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_doc_string);
Line: 332

           PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 372

            PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 375

        SELECT
            to_char(l_document_id) || '-' || to_char(PO_WF_ITEMKEY_S.nextval)
        INTO l_item_key
        FROM sys.dual;
Line: 584

            PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 596

                select first_position_id, first_approver_id
                into l_first_position_id, l_first_approver_id
                from po_requisition_headers_all
                where l_document_id = requisition_header_id;
Line: 608

              SELECT full_name
              INTO l_next_approver_name
              FROM per_all_people_f person
              WHERE person_id = l_first_approver_id
            --Bug#7207213#This query fetches multiple records so adding a filter
              and trunc(sysdate) between person.effective_start_date and nvl(person.effective_end_date, trunc(sysdate));
Line: 619

              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
                       WHERE asg.position_id = g_next_approvers(l_approver_index).orig_system_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: 639

            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: 658

            PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 691

            po_wf_debug_pkg.insert_debug(itemtype,itemkey,l_progress);
Line: 840

		po_wf_debug_pkg.insert_debug(itemtype,itemkey,l_progress);
Line: 859

	l_progress:= 'g_next_approvers(l_approver_index).api_insertion: '||g_next_approvers(l_approver_index).api_insertion;
Line: 861

		po_wf_debug_pkg.insert_debug(itemtype,itemkey,l_progress);
Line: 863

        if (g_next_approvers(l_approver_index).api_insertion = 'Y') then
		n_varval(5) := 1;
Line: 880

            PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 919

            PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 934

      g_next_approvers.delete;
Line: 948

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_doc_string );
Line: 959

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_doc_string );
Line: 1009

            PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 1041

            PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 1072

            PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 1086

		PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 1097

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 1106

		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: 1114

		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: 1131

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

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

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

       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: 1229

        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: 1247

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 1250

    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: 1273

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 1318

	select first_position_id, first_approver_id
	into l_first_position_id, l_first_approver_id
	from po_requisition_headers_all
	where l_req_header_id = requisition_header_id;
Line: 1328

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 1339

	PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 1355

	PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 1379

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 1387

          PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 1389

          PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, approverList(i).orig_system || to_char(i) || ' ' ||
                                                         approverList(i).orig_system_id);
Line: 1391

          PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,'authority' || ' ' || approverList(i).authority);
Line: 1392

          PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,'approval_status'|| ' ' || approverList(i).approval_status);
Line: 1393

          PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,'api_insertion'|| ' ' || approverList(i).api_insertion);
Line: 1394

          PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,'group_or_chain_id' || ' ' || approverList(i).group_or_chain_id);
Line: 1399

            and approverList(i).api_insertion = ame_util.oamGenerated
            and approverList(i).group_or_chain_id = l_approver_group_id) then

            l_orig_system     := approverList(i).orig_system;
Line: 1419

              SELECT person_id into l_person_id FROM (
                       SELECT person.person_id FROM per_all_people_f person, per_all_assignments_f asg
                       WHERE asg.position_id = l_orig_system_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: 1441

             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: 1480

          UpdateActionHistory(l_req_header_id, 'NO ACTION',
                            l_note, l_person_id);
Line: 1484

         		UpdateActionHistoryPo(l_transaction_type,l_req_header_id, l_draft_id,
                                  l_document_type,l_document_subtype, 'NO ACTION',
										              l_note, l_person_id);
Line: 1505

             PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 1511

          UpdateActionHistory(l_req_header_id, 'NO ACTION',
                                l_note, l_person_id);
Line: 1516

            PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 1529

	   -- Get the approver id as the person id to update the action history
	   l_person_id := po_wf_util_pkg.GetItemAttrNumber( itemtype => l_child_wf_cur.item_type,
                                                            itemkey  => l_child_wf_cur.item_key,
                                                            aname    => 'APPROVER_EMPID');
Line: 1536

             PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 1541

	   -- update the action history table
         --Bug 12944203
     if l_document_type = 'REQUISITION' THEN
           l_note := fnd_message.get_string('ICX', 'ICX_POR_REQ_ALREADY_REJECTED');
Line: 1545

           UpdateActionHistory(l_req_header_id, 'NO ACTION',
                                        l_note, l_person_id);
Line: 1553

        UpdateActionHistoryPo(l_transaction_type,l_req_header_id, l_draft_id,
                              l_document_type,l_document_subtype, 'NO ACTION',
										          l_note, l_person_id);
Line: 1561

             PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 1572

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 1633

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 1636

    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: 1694

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 1740

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 1745

    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: 1806

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

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 1860

    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: 1926

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 1974

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 1977

    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: 2035

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 2082

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 2085

    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: 2143

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 2174

procedure insertActionHistory( p_req_header_id in number,
                               p_employee_id in number,
                               p_approval_group_id in number)

is
pragma AUTONOMOUS_TRANSACTION;
Line: 2193

  SELECT max(sequence_num)
  INTO l_sequence_num
  FROM PO_ACTION_HISTORY
  WHERE object_type_code = 'REQUISITION'
      AND object_id = p_req_header_id;
Line: 2199

  SELECT object_sub_type_code,
          object_revision_num, approval_path_id, request_id,
          program_application_id, program_date, program_id
  INTO l_object_sub_type_code,
          l_object_revision_num, l_approval_path_id, l_request_id,
          l_program_application_id, l_program_date, l_program_id
  FROM PO_ACTION_HISTORY
  WHERE object_type_code = 'REQUISITION'
     AND object_id = p_req_header_id
     AND sequence_num = l_sequence_num;
Line: 2210

       /* update po action history */
           po_forward_sv1.insert_action_history (
      	   p_req_header_id,
      	   'REQUISITION',
     	   l_object_sub_type_code,
     	   l_sequence_num + 1,
     	   NULL,
     	   NULL,
     	   p_employee_id,
     	   NULL,
     	   NULL,
		l_object_revision_num,
		NULL,                  /* offline_code */
		l_request_id,
		l_program_application_id,
		l_program_id,
		l_program_date,
     	   fnd_global.user_id,
     	   fnd_global.login_id,
           p_approval_group_id);
Line: 2233

end insertActionHistory;
Line: 2257

procedure Insert_Action_History( itemtype        in varchar2,
                                 itemkey         in varchar2,
                                 actid           in number,
                                 funcmode        in varchar2,
                                 resultout       out NOCOPY varchar2) IS

  l_progress                  VARCHAR2(500) := '000';
Line: 2281

    l_progress := 'Insert_Action_History: 001';
Line: 2283

         PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2321

	l_progress := 'Insert_Action_History: 004 - Calling insertActionHistory.';
Line: 2323

	PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2325

	insertActionHistory(l_req_header_id, l_next_approver_id, l_approval_group_id);
Line: 2327

	l_progress := 'Insert_Action_History: 005 - Done with insertActionHistory.';
Line: 2329

	PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2342

		l_progress := 'Insert_Action_History: 006 - Calling insertActionHistory.';
Line: 2344

			PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2347

		insertActionHistoryPo(l_document_id, l_draft_id,
			l_document_type,
			l_document_subtype ,
			l_transaction_type,
			l_next_approver_id, l_approval_group_id);
Line: 2353

		l_progress := 'Insert_Action_History: 007 - Done with insertActionHistory.';
Line: 2355

			PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2376

    l_progress := 'Insert_Action_History: 999';
Line: 2378

       /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2385

    wf_core.context('POR_AME_REQ_WF_PVT','Insert_Action_History',l_progress,sqlerrm);
Line: 2386

    PO_REQAPPROVAL_INIT1.send_error_notif(itemType, itemkey, l_preparer_user_name, l_doc_string, sqlerrm, 'POR_AME_REQ_WF_PVT.INSERT_ACTION_HISTORY');
Line: 2388

 END Insert_Action_History;
Line: 2412

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(500) := '000';
Line: 2438

    l_progress := 'Update_Action_History_Approve: 001';
Line: 2440

       /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2482

		l_progress := 'Update_Action_History_Approve: 002-'|| to_char(l_document_id)||'-'||
			l_document_type||'-'||l_document_subtype;
Line: 2485

			PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2488

		/* UpdateActionHistory(l_document_id, l_action,
			l_note, l_current_approver);bug 10100356*/
Line: 2490

 	        PO_APPROVAL_LIST_HISTORY_SV.Update_Action_History( itemtype=>itemtype,
 	                                           itemkey=>itemkey,
 	                                           x_action=>l_action,
 	                                          x_req_header_id=>l_document_id,
 	                                          x_last_approver=>l_result,
 	                                           x_note=>l_note);
Line: 2502

		l_progress := 'Update_Action_History_Approve: 003-'|| to_char(l_document_id)||
					'-'||to_char(l_draft_id)||'-'||
					l_document_type||'-'||l_document_subtype;
Line: 2506

			PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2510

		UpdateActionHistoryPo(l_transaction_type,l_document_id, l_draft_id,
                          l_document_type,l_document_subtype, l_action,
                          l_note, l_current_approver);
Line: 2525

    l_progress := 'Update_Action_History_Approve: 004';
Line: 2527

       /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2535

    wf_core.context('POR_AME_REQ_WF_PVT','Update_Action_History_Approve',l_progress,sqlerrm);
Line: 2536

    PO_REQAPPROVAL_INIT1.send_error_notif(itemType, itemkey, l_preparer_user_name, l_doc_string, sqlerrm, 'POR_AME_REQ_WF_PVT.UPDATE_ACTION_HISTORY_APPROVE');
Line: 2539

END Update_Action_History_Approve;
Line: 2563

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(100) := '000';
Line: 2590

    l_progress := 'Update_Action_History_Reject: 001';
Line: 2592

       /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2635

		l_progress := 'Update_Action_History_Reject: 002-'|| to_char(l_document_id)||'-'||
		l_document_type||'-'||l_document_subtype;
Line: 2638

			PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2641

		/*UpdateActionHistory(l_document_id, l_action,
			l_note, l_current_approver);bug 10100356*/
Line: 2643

 	        PO_APPROVAL_LIST_HISTORY_SV.Update_Action_History( itemtype=>itemtype,
 	                                           itemkey=>itemkey,
 	                                           x_action=>l_action,
 	                                          x_req_header_id=>l_document_id,
 	                                          x_last_approver=>l_result,
 	                                           x_note=>l_note);
Line: 2654

		l_progress := 'Update_Action_History_Reject: 003-'|| to_char(l_document_id)||'-'||to_char(l_draft_id)||'-'||
		l_document_type||'-'||l_document_subtype;
Line: 2657

			PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2661

		UpdateActionHistoryPo(l_transaction_type,l_document_id, l_draft_id,
                          l_document_type,l_document_subtype, l_action,
                          l_note, l_current_approver);
Line: 2676

    l_progress := 'Update_Action_History_Reject: 004';
Line: 2678

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2685

    wf_core.context('POR_AME_REQ_WF_PVT','Update_Action_History_Reject',l_progress,sqlerrm);
Line: 2686

    PO_REQAPPROVAL_INIT1.send_error_notif(itemType, itemkey, l_preparer_user_name, l_doc_string, sqlerrm, 'POR_AME_REQ_WF_PVT.Update_Action_History_Reject');
Line: 2689

END Update_Action_History_Reject;
Line: 2713

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(100) := '000';
Line: 2740

    l_progress := 'Update_Action_History_Timeout: 001';
Line: 2742

       /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2783

		l_progress := 'Update_Action_History_Timeout: 002-'|| to_char(l_document_id)||'-'||
		l_document_type||'-'||l_document_subtype;
Line: 2786

			PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2789

		/*UpdateActionHistory(l_document_id, l_action,
					l_note, l_current_approver);bug 10100356*/
Line: 2791

 	        PO_APPROVAL_LIST_HISTORY_SV.Update_Action_History( itemtype=>itemtype,
 	                                           itemkey=>itemkey,
 	                                           x_action=>l_action,
 	                                          x_req_header_id=>l_document_id,
 	                                          x_last_approver=>l_result,
 	                                           x_note=>l_note);
Line: 2803

		l_progress := 'Update_Action_History_Timeout: 003-'|| to_char(l_document_id)||'-'||to_char(l_draft_id)||'-'||
				l_document_type||'-'||l_document_subtype;
Line: 2806

			PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2810

		UpdateActionHistoryPo(l_transaction_type,l_document_id, l_draft_id,
                          l_document_type,l_document_subtype, l_action,
                          l_note, l_current_approver);
Line: 2820

    l_progress := 'Update_Action_History_Timeout: 003';
Line: 2822

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2829

    wf_core.context('POR_AME_REQ_WF_PVT','Update_Action_History_Timeout',l_progress,sqlerrm);
Line: 2830

    PO_REQAPPROVAL_INIT1.send_error_notif(itemType, itemkey, l_preparer_user_name, l_doc_string, sqlerrm, 'POR_AME_REQ_WF_PVT.Update_Action_History_Timeout');
Line: 2833

END Update_Action_History_Timeout;
Line: 2856

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(500) := '000';
Line: 2882

    l_progress := 'Update_Action_History_Forward: 001';
Line: 2884

       /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2926

		l_progress := 'Update_Action_History_Forward: 002-'|| to_char(l_document_id)||'-'||
			l_document_type||'-'||l_document_subtype;
Line: 2929

			PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2932

		UpdateActionHistory(l_document_id, l_action,
			l_note, l_current_approver);
Line: 2941

		l_progress := 'Update_Action_History_Forward: 003-'|| to_char(l_document_id)||'-'||to_char(l_draft_id)||'-'||
					l_document_type||'-'||l_document_subtype;
Line: 2944

			PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2948

		UpdateActionHistoryPo(l_transaction_type,l_document_id, l_draft_id,
                          l_document_type,l_document_subtype, l_action,
                          l_note, l_current_approver);
Line: 2963

    l_progress := 'Update_Action_History_Forward: 004';
Line: 2965

       /* DEBUG */  PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,l_progress);
Line: 2973

    wf_core.context('POR_AME_REQ_WF_PVT','Update_Action_History_Forward',l_progress,sqlerrm);
Line: 2974

    PO_REQAPPROVAL_INIT1.send_error_notif(itemType, itemkey, l_preparer_user_name, l_doc_string, sqlerrm, 'POR_AME_REQ_WF_PVT.UPDATE_ACTION_HISTORY_FORWARD');
Line: 2977

END Update_Action_History_Forward;
Line: 3001

procedure Update_Action_History_No_Act (itemtype        in varchar2,
                                    itemkey         in varchar2,
                                    actid           in number,
                                    funcmode        in varchar2,
                                    resultout       out NOCOPY varchar2    ) is
l_doc_header_id         NUMBER;
Line: 3017

    x_progress := 'POR_AME_REQ_WF_PVT.Update_Action_History_No_Act: 01';
Line: 3052

    x_progress := 'POR_AME_REQ_WF_PVT.Update_Action_History_No_Act: 02 - l_doc_header_id ' || l_doc_header_id || ' -- l_doc_type :' || l_doc_type ;
Line: 3055

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
Line: 3062

         UpdateActionHistory(l_doc_header_id, 'NO ACTION', l_note, NULL);
Line: 3068

    x_progress := 'POR_AME_REQ_WF_PVT.Update_Action_History_No_Act: 03';
Line: 3070

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey,x_progress);
Line: 3077

    wf_core.context('POR_AME_REQ_WF_PVT','Update_Action_History_No_Act',x_progress);
Line: 3078

    PO_REQAPPROVAL_INIT1.send_error_notif(itemType, itemkey, l_preparer_user_name, l_doc_string, sqlerrm, 'POR_AME_REQ_WF_PVT.Update_Action_History_No_Act');
Line: 3080

END Update_Action_History_No_Act;
Line: 3103

PROCEDURE UpdateActionHistory(p_document_id      NUMBER,
                              p_action           VARCHAR2,
                              p_note             VARCHAR2,
                              p_current_approver NUMBER) IS

pragma AUTONOMOUS_TRANSACTION;
Line: 3114

       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 = 'REQUISITION'
              and rownum=1;
Line: 3126

       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 = 'REQUISITION'
;
Line: 3143

END UpdateActionHistory;
Line: 3195

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_doc_string );
Line: 3242

            select first_position_id, first_approver_id
            into l_first_position_id, l_first_approver_id
            from po_requisition_headers_all
            where documentId = requisition_header_id;
Line: 3259

                  SELECT full_name
                  INTO l_next_approver_name
                  FROM per_all_people_f person
                  WHERE person_id = l_first_approver_id
                  --Bug#7207213#This query fetches multiple records so adding a filter
                  and trunc(sysdate) between person.effective_start_date and nvl(person.effective_end_date, trunc(sysdate));
Line: 3269

                        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
                               WHERE asg.position_id = g_next_approvers(l_approver_index).orig_system_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: 3296

                     ame_api2.updateApprovalStatus( applicationIdIn    =>applicationId,
                                                    transactionIdIn    =>documentId,
                                                    transactionTypeIn  =>documentType,
                                                    approverIn         => g_next_approvers(l_approver_index)
                                                  );
Line: 3315

                     g_next_approvers.delete(l_approver_index);
Line: 3430

procedure insertActionHistoryPo( p_document_id in number,
				p_draft_id	in	number,
				p_document_type in varchar2,
				p_document_subtype in varchar2,
				p_transaction_type in varchar2,
                               p_employee_id in number,
                               p_approval_group_id in number)

is
pragma AUTONOMOUS_TRANSACTION;
Line: 3460

	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: 3470

		SELECT 'Y'
		INTO l_record_exists
		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
		AND action_code is null;
Line: 3482

	SELECT object_id, object_type_code,object_sub_type_code,
		object_revision_num, approval_path_id, request_id,
		program_application_id, program_date, program_id
	INTO l_object_id, l_object_type_code, l_object_sub_type_code,
		l_object_revision_num, l_approval_path_id, l_request_id,
		l_program_application_id, l_program_date, l_program_id
	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
     	AND sequence_num = l_sequence_num;
Line: 3496

	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 IN ('MODIFICATION', 'POST_AWARD_REQUEST') -- PAR Approval
	AND object_id = p_draft_id;
Line: 3506

		SELECT 'Y'
		INTO l_record_exists
		FROM PO_ACTION_HISTORY
		WHERE object_type_code = p_document_type --'PO'
		AND object_sub_type_code = 'MODIFICATION' --'STANDARD'
		AND object_id = p_draft_id
		AND action_code is null;
Line: 3518

	SELECT object_id, object_type_code,object_sub_type_code,
	object_revision_num, approval_path_id, request_id,
	program_application_id, program_date, program_id
	INTO l_object_id,l_object_type_code, l_object_sub_type_code,
	l_object_revision_num, l_approval_path_id, l_request_id,
	l_program_application_id, l_program_date, l_program_id
	FROM PO_ACTION_HISTORY
	WHERE object_type_code = p_document_type --'PO'
	AND object_sub_type_code IN ('MODIFICATION', 'POST_AWARD_REQUEST') -- PAR Approval
	AND object_id = p_draft_id
     	AND sequence_num = l_sequence_num;
Line: 3533

		update po_action_history
		set employee_id = p_employee_id,
			approval_group_id = p_approval_group_id
		where object_type_code = l_object_type_code
   		AND object_sub_type_code = l_object_sub_type_code
   		AND object_id = l_object_id
   		AND action_code is null;
Line: 3541

		/* update po action history */
          po_forward_sv1.insert_action_history (
      	   			l_object_id,
      	   			l_object_type_code,
     	   	 		l_object_sub_type_code,
     	   			l_sequence_num + 1,
     	   			NULL,
     	   			NULL,
     	   			p_employee_id,
     	   			NULL,
     	   			NULL,
				l_object_revision_num,
				NULL,                  /* offline_code */
				l_request_id,
				l_program_application_id,
				l_program_id,
				l_program_date,
     	   			fnd_global.user_id,
     	   			fnd_global.login_id,
           			p_approval_group_id);
Line: 3564

end insertActionHistoryPo;
Line: 3589

PROCEDURE UpdateActionHistoryPo(p_transaction_type	VARCHAR2,
				p_document_id      NUMBER,
				p_draft_id	NUMBER,
        p_document_type IN  VARCHAR2,   --Bug 13444730
        p_document_subtype IN  VARCHAR2, --Bug 13444730
        p_action           VARCHAR2,
        p_note             VARCHAR2,
        p_current_approver NUMBER) IS

pragma AUTONOMOUS_TRANSACTION;
Line: 3605

	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: 3618

	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: 3631

	UPDATE po_action_history
	SET action_code = p_action,
	note = p_note,
	action_date = sysdate
	WHERE object_id = p_draft_id and
	employee_id = p_current_approver and
	action_code is null and
	object_type_code = p_document_type and
	object_sub_type_code='MODIFICATION'
	and rownum=1;
Line: 3644

	UPDATE po_action_history
	SET action_code = p_action,
	note = p_note,
	action_date = sysdate
	WHERE object_id = p_draft_id and
	action_code is null and
	object_type_code = p_document_type and
	object_sub_type_code='MODIFICATION';
Line: 3658

	UPDATE po_action_history
	SET action_code = p_action,
	note = p_note,
	action_date = sysdate
	WHERE object_id = p_draft_id and
	employee_id = p_current_approver and
	action_code is null and
	object_type_code = p_document_type and
	object_sub_type_code='POST_AWARD_REQUEST'
	and rownum=1;
Line: 3671

	UPDATE po_action_history
	SET action_code = p_action,
	note = p_note,
	action_date = sysdate
	WHERE object_id = p_draft_id and
	action_code is null and
	object_type_code = p_document_type and
	object_sub_type_code='POST_AWARD_REQUEST';
Line: 3690

END UpdateActionHistoryPo;
Line: 3732

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);
Line: 3735

    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: 3750

        PO_WF_DEBUG_PKG.insert_debug(itemtype,itemkey, l_progress);