DBA Data[Home] [Help]

APPS.POS_WCAPPROVE_PVT SQL Statements

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

Line: 52

procedure UpdateWorkflowInfo
(
p_itemtype        in varchar2,
p_itemkey         in varchar2,
p_shipment_header_id in varchar2);
Line: 110

		select to_char(PO_WF_ITEMKEY_S.NEXTVAL)
		into l_seq_for_item_key
		from sys.dual;
Line: 129

			select count(*)
			into   l_wf_created
			from   wf_items
			where  item_type = p_itemtype
			and    item_key  = l_itemkey;
Line: 180

	select shipment_num
	into l_work_confirmation_number
	from rcv_shipment_headers
	where shipment_header_id = p_work_confirmation_id
	and nvl(asn_type,'STD') = 'WC';
Line: 200

        select max(po_header_id)
        into l_po_header_id
        from rcv_shipment_lines
        where shipment_header_id = p_work_confirmation_id;
Line: 288

** Update the old notifications to closed status for this document.
*/
procedure Close_old_notif
(
p_itemtype        in varchar2,
p_itemkey         in varchar2,
p_actid           in number,
p_funcmode        in varchar2,
x_resultout       out NOCOPY varchar2 ) IS

l_work_confirmation_id  Number;
Line: 303

select wf_item_key
from rcv_shipment_headers
where shipment_header_id = p_header_id;
Line: 424

	select created_by
	into l_wc_preparer_id
	from rcv_shipment_headers
	where shipment_header_id= l_work_confirmation_id;
Line: 430

	select employee_id
	into l_employee_id
	from fnd_user
	where user_id = l_wc_preparer_id;
Line: 495

	select poh.segment1,
	       poh.agent_id
	into l_po_number,
	     l_po_preparer_id
	from po_headers_all poh
	where po_header_id = l_po_header_id;
Line: 611

procedure update_workflow_info( p_itemtype        in varchar2,
                                p_itemkey         in varchar2,
                                p_actid           in number,
                                p_funcmode        in varchar2,
                                x_resultout       out NOCOPY varchar2) is
l_shipment_header_id number;
Line: 618

l_api_name varchar2(50) := p_itemkey || ' update_workflow_info';
Line: 621

	l_progress := 'POS_WCAPPROVE_PVT.update_workflow_info: 01.';
Line: 624

				l_api_name,'Enter in update_workflow_info ' || l_progress);
Line: 638

	l_progress := 'POS_WCAPPROVE_PVT.update_workflow_info: 02.';
Line: 644

	UpdateWorkflowInfo(p_itemtype,p_itemkey,l_shipment_header_id);
Line: 648

	l_progress := 'POS_WCAPPROVE_PVT.update_workflow_info: 02.';
Line: 651

				l_api_name,'Leave update_workflow_info ' || l_progress);
Line: 658

				l_api_name,'Exception in update_workflow_info '
			|| l_progress);
Line: 662

end update_workflow_info;
Line: 671

select pk1_value
from fnd_attached_documents
where entity_name='RCV_LINES'
and pk1_value in (select shipment_line_id
		  from rcv_shipment_lines
		  where shipment_header_id=l_shipment_header_id);
Line: 713

	select count(*)
	into l_attach_count
	from fnd_attached_documents
	where entity_name =' RCV_LINES'
	and pk1_value in (select shipment_line_id
			  from rcv_shipment_lines
			  where shipment_header_id=l_shipment_header_id);
Line: 761

/* Insert a submit action  row in po_action_history to signal the
 * submisinon of the document for Approval. Also insert an
 * additional row with a NULL ACTION_CODE to simulate a
 * forward-to. We need to do this for each shipment line in this
 * document.
*/
procedure Ins_actionhist_submit(p_itemtype        in varchar2,
                                p_itemkey         in varchar2,
                                p_actid           in number,
                                p_funcmode        in varchar2,
                                x_resultout       out NOCOPY varchar2)is
l_progress varchar2(200);
Line: 782

select shipment_line_id
from rcv_shipment_lines
where shipment_header_id=l_shipment_header_id;
Line: 788

select max(sequence_num)
from po_action_history
where object_id=l_shipment_header_id
and object_type_code = 'WC';
Line: 794

select action_code
from po_action_history
where object_id = l_shipment_header_id
and object_type_code='WC'
and sequence_num = l_seq_num;
Line: 877

				l_api_name,'before call to InsertPOActionHistory ' ||
				l_sequence_num);
Line: 884

			      InsertPOActionHistory(
				   p_object_id => l_shipment_header_id,
				   p_object_type_code=>'WC',
                                   p_object_sub_type_code => NULL,
                                   p_sequence_num =>l_sequence_num ,
                                   p_action_code =>'SUBMIT' ,
                                   p_action_date =>sysdate ,
                                   p_employee_id => null, --l_wc_preparer_id forsupplier
                                   p_approval_path_id  => NULL ,
                                   p_note => NULL,
                                   p_object_revision_num => NULL,
                                   p_offline_code =>  '',
                                   p_request_id =>  0,
                                   p_program_application_id => 0,
                                   p_program_id =>0 ,
                                   p_program_date => sysdate ,
                                   p_user_id => fnd_global.user_id  ,
                                   p_login_id => fnd_global.login_id);
Line: 924

		/* Insert the null action code*/
		IF (g_asn_debug = 'Y') THEN
		    debug_log(FND_LOG.LEVEL_STATEMENT,
				l_api_name,'insert null action_code ' ||
				l_sequence_num);
Line: 932

		      /*InsertPOActionHistory(
			   p_object_id => l_shipment_header_id,
			   p_object_type_code=>'WC',
			   p_object_sub_type_code => NULL,
			   p_sequence_num =>l_sequence_num+1 ,
			   p_action_code =>NULL ,
			   p_action_date =>sysdate ,
			   p_employee_id => null,--l_wc_preparer_id for supplier
			   p_approval_path_id  => NULL ,
			   p_note => NULL,
			   p_object_revision_num => NULL,
			   p_offline_code =>  '',
			   p_request_id =>  0,
			   p_program_application_id => 0,
			   p_program_id =>0 ,
			   p_program_date => sysdate ,
			   p_user_id => fnd_global.user_id  ,
			   p_login_id => fnd_global.login_id);             */
Line: 982

l_insertion_type            VARCHAR2(30);
Line: 1222

                    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 = l_next_approver(1).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: 1251

                SELECT employee_id
                into l_next_approver_id
                FROM fnd_user
                WHERE user_id = l_next_approver(1).orig_system_id
                and trunc(sysdate) between start_date and nvl(end_date, sysdate+1);
Line: 1269

                                l_api_name,'l_insertion_type '
                                || l_insertion_type);
Line: 1293

                                      aname      => 'AME_INSERTION_TYPE' ,
                                      avalue     => l_insertion_type);
Line: 1362

procedure Insert_Action_History(p_itemtype        in varchar2,
                                p_itemkey         in varchar2,
                                p_actid           in number,
                                p_funcmode        in varchar2,
                                x_resultout       out NOCOPY varchar2) is

l_progress varchar2(200);
Line: 1374

l_api_name varchar2(50) := p_itemkey || ' Insert_Action_History';
Line: 1378

select shipment_line_id
from rcv_shipment_lines
where shipment_header_id=l_shipment_header_id;
Line: 1384

  SELECT  object_id,
          object_type_code,
          object_sub_type_code,
          sequence_num,
          object_revision_num,
          request_id,
          program_application_id,
          program_date,
          program_id,
          last_update_date,
          employee_id
    FROM  PO_ACTION_HISTORY
   WHERE  object_type_code = 'WC'
     AND  object_id  = l_shipment_header_id
     AND  sequence_num = l_sequence_num;
Line: 1416

	l_progress := 'POS_WCAPPROVE_PVT.Insert_Action_History: 01.';
Line: 1419

				l_api_name,'Enter in Insert_Action_History '
			|| l_progress);
Line: 1446

                l_progress := 'POS_WCAPPROVE_PVT.Insert_Action_History: 04.';
Line: 1448

		SELECT count(*)
		INTO l_count
		FROM PO_ACTION_HISTORY
		WHERE object_type_code = 'WC'
		AND object_id   = l_shipment_header_id
		AND action_code IS NULL;
Line: 1468

			SELECT max(sequence_num)
			INTO l_sequence_num
			FROM PO_ACTION_HISTORY
			WHERE object_type_code = 'WC'
			AND object_id = l_shipment_header_id;
Line: 1499

			** want to update the first NULL row in POAH
			** with FORWARD action
			*/


			If l_count = 1 then


				IF (g_asn_debug = 'Y') THEN
				    debug_log(FND_LOG.LEVEL_STATEMENT,
							l_api_name,
						'update Action history ' );
Line: 1513

				UpdatePOActionHistory(
                                p_object_id => Recinfo.object_id,
                                p_object_type_code => Recinfo.object_type_code,
                                p_employee_id => Recinfo.employee_id,
                                p_action_code => 'FORWARD',
                                p_note => NULL,
                                p_user_id => fnd_global.user_id,
                                p_login_id => fnd_global.login_id);
Line: 1533

						'Insert Action history ' );
Line: 1538

			      InsertPOActionHistory(
				   p_object_id => Recinfo.object_id,
				   p_object_type_code=>Recinfo.object_type_code,
                                   p_object_sub_type_code => NULL,
                                   p_sequence_num => Recinfo.sequence_num+1 ,
                                   p_action_code =>NULL ,
                                   p_action_date =>NULL ,
                                   p_employee_id => l_approver_id,
                                   p_approval_path_id  => NULL ,
                                   p_note => NULL,
                                   p_object_revision_num => NULL,
                                   p_offline_code =>  NULL,
                                   p_request_id =>  Recinfo.request_id,
                                   p_program_application_id => Recinfo.program_application_id,
                                   p_program_id =>Recinfo.program_id ,
                                   p_program_date => Recinfo.program_date ,
                                   p_user_id => fnd_global.user_id  ,
                                   p_login_id => fnd_global.login_id);
Line: 1568

			'Exit Insert Action history ' );
Line: 1575

			l_api_name,'invalid_action in Insert_Action_History '
			|| l_progress);
Line: 1582

			l_api_name,'invalid_data in Insert_Action_History '
			|| l_progress);
Line: 1589

				l_api_name,'Exception in Insert_Action_History '
			|| l_progress);
Line: 1593

end Insert_Action_History;
Line: 1616

    SELECT notification_id
    FROM   wf_item_activity_statuses_v
    WHERE  item_type = p_itemtype
    AND    item_key = p_itemkey
    AND    activity_name =  p_activity_name
    ORDER BY activity_end_date DESC;
Line: 1655

		SELECT attribute_value
		into l_note
		FROM   wf_notification_attr_resp_v
		WHERE  group_id = l_notification_id
		AND    attribute_name = 'NOTE';
Line: 1668

	update_approval_status(p_shipment_header_id => l_shipment_header_id,
                               p_note => l_note,
                               p_approval_status => 'APPROVED',
			       p_level => 'LINES',
                               x_resultout => l_result);
Line: 1712

    SELECT notification_id
    FROM   wf_item_activity_statuses_v
    WHERE  item_type = p_itemtype
    AND    item_key = p_itemkey
    AND    activity_name =  p_activity_name
    ORDER BY activity_end_date DESC;
Line: 1751

		SELECT attribute_value
		into l_note
		FROM   wf_notification_attr_resp_v
		WHERE  group_id = l_notification_id
		AND    attribute_name = 'NOTE';
Line: 1766

	update_approval_status(p_shipment_header_id => l_shipment_header_id,
                               p_note => l_note,
                               p_approval_status => 'REJECTED',
			       p_level => 'LINES',
                               x_resultout => l_result);
Line: 1827

	select count(*)
	into l_reject_lines
	from rcv_shipment_lines
	where shipment_header_id = l_shipment_header_id
	and approval_status = 'REJECTED';
Line: 1858

procedure Update_Approval_List_Response
			   (p_itemtype        in varchar2,
                            p_itemkey         in varchar2,
                            p_actid           in number,
                            p_funcmode        in varchar2,
                            x_resultout       out NOCOPY varchar2) IS

CURSOR c_group_id (p_itemtype VARCHAR2,
		   p_itemkey VARCHAR2,
		   p_activity_name VARCHAR2) IS
    SELECT notification_id
    FROM   wf_item_activity_statuses_v
    WHERE  item_type = p_itemtype
    AND    item_key = p_itemkey
    AND    activity_name =  p_activity_name
    ORDER BY activity_end_date DESC;
Line: 1876

    SELECT '1'
     FROM   WF_NOTIFICATIONS
    WHERE   notification_id = p_notif_id
      AND   status = 'CANCELED';
Line: 1882

    SELECT recipient_role, attribute_value
    FROM   wf_notification_attr_resp_v
    WHERE  group_id = p_group_id
    AND    attribute_name = 'RESULT';
Line: 1888

    SELECT attribute_value
    FROM   wf_notification_attr_resp_v
    WHERE  group_id = p_group_id
    AND    attribute_name = 'NOTE';
Line: 1894

    SELECT nvl((wfu.orig_system_id), -9996)
    FROM   wf_users wfu
    WHERE  wfu.name = p_responder
    AND    wfu.orig_system not in ('HZ_PARTY', 'POS', 'ENG_LIST', 'CUST_CONT');
Line: 1899

  l_api_name varchar2(50) := p_itemkey || ' update_approval_list_response';
Line: 1918

  l_insertion_type            VARCHAR2(30);
Line: 1932

	l_progress := 'POS_WCAPPROVE_PVT.Update_Approval_List_Response: 01.';
Line: 1936

				'Enter in Update_Approval_List_Response '
			|| l_progress);
Line: 1988

		l_progress := 'POS_WCAPPROVE_PVT.Update_Approval_List_Response'
					|| ': 02.';
Line: 1992

		SELECT wfn.responder, wfn.recipient_role, wfn.end_date
		INTO l_responder, l_recipient_role, l_response_end_date
		FROM   wf_notifications wfn
		WHERE  wfn.notification_id = l_group_id;
Line: 2039

		l_progress := 'POS_WCAPPROVE_PVT.Update_Approval_List_Response'
				|| ':02.';
Line: 2064

		l_progress := 'POS_WCAPPROVE_PVT.Update_Approval_List_Response'
				|| ': 03.';
Line: 2076

		l_progress := 'POS_WCAPPROVE_PVT.Update_Approval_List_Response'
					|| ': 04.';
Line: 2094

		l_progress := 'POS_WCAPPROVE_PVT.Update_Approval_List_Response'
					|| ': 05.';
Line: 2123

	l_insertion_type := wf_engine.GetItemAttrText(itemtype => p_itemtype,
					 itemkey  => p_itemkey,
					 aname    => 'AME_INSERTION_TYPE');
Line: 2130

				' l_insertion_type '
				|| l_insertion_type);
Line: 2212

		select count(*)
		into l_reject_lines
		from rcv_shipment_lines
		where shipment_header_id = l_shipment_header_id
		and approval_status = 'REJECTED';
Line: 2255

                ame_api2.updateApprovalStatus(applicationIdIn=>l_application_Id,                            transactionIdIn=>l_shipment_header_id,
                            approverIn=>l_current_approver,
                            transactionTypeIn=>l_transaction_type);
Line: 2266

				l_api_name,'Exception in update_approval_list_response '
			|| l_progress);
Line: 2270

end Update_Approval_List_Response;
Line: 2272

procedure Update_Action_History_Approve
			   (p_itemtype        in varchar2,
                            p_itemkey         in varchar2,
                            p_actid           in number,
                            p_funcmode        in varchar2,
                            x_resultout       out NOCOPY varchar2) IS
l_progress varchar2(300);
Line: 2279

l_api_name varchar2(50) := p_itemkey || ' update_action_history_approve';
Line: 2281

	l_progress := 'POS_WCAPPROVE_PVT.Update_Approval_History_Approve: 01.';
Line: 2285

				'Enter in Update_Action_History_Approve '
			|| l_progress);
Line: 2294

	Update_Action_History(p_itemtype => p_itemtype,
			      p_itemkey => p_itemkey,
			      p_action_code => 'APPROVE');
Line: 2303

				'Leave in Update_Action_History_Approve '
			|| l_progress);
Line: 2314

				l_api_name,'Exception in update_action_history_approve '
			|| l_progress);
Line: 2318

end Update_Action_History_Approve;
Line: 2320

procedure Update_Action_History_Reject
			   (p_itemtype        in varchar2,
                            p_itemkey         in varchar2,
                            p_actid           in number,
                            p_funcmode        in varchar2,
                            x_resultout       out NOCOPY varchar2) IS
l_progress varchar2(300);
Line: 2327

l_api_name varchar2(50) := p_itemkey || ' update_action_history_Reject';
Line: 2329

	l_progress := 'POS_WCAPPROVE_PVT.Update_action_history_reject: 01.';
Line: 2333

				'Enter in Update_Action_History_Reject '
			|| l_progress);
Line: 2342

	Update_Action_History(p_itemtype => p_itemtype,
			      p_itemkey => p_itemkey,
			      p_action_code => 'REJECT');
Line: 2351

				'Leave in Update_Action_History_Reject '
			|| l_progress);
Line: 2362

				l_api_name,'Exception in update_action_history_Reject '
			|| l_progress);
Line: 2366

end Update_Action_History_REJECT;
Line: 2370

procedure Update_Action_History
			   (p_itemtype        in varchar2,
                            p_itemkey         in varchar2,
                            p_action_code     in  varchar2) IS

CURSOR c_responderid(l_responder VARCHAR2) IS
    SELECT nvl((wfu.orig_system_id), -9996)
    FROM   wf_users wfu
    WHERE  wfu.name = l_responder
    AND    wfu.orig_system not in ('HZ_PARTY', 'POS', 'ENG_LIST', 'CUST_CONT');
Line: 2384

select rsl.shipment_line_id ,
nvl(rsl.comments,rsh.comments),
rsl.approval_status
from rcv_shipment_lines rsl,
rcv_shipment_headers rsh
where rsh.shipment_header_id = l_shipment_header_id
and rsh.shipment_header_id= rsl.shipment_header_id;
Line: 2393

l_api_name varchar2(50) := p_itemkey || ' update_action_history';
Line: 2410

	l_progress := 'POS_WCAPPROVE_PVT.Update_Action_history: 01.';
Line: 2414

				'Enter in Update_Action_History '
			|| l_progress);
Line: 2432

	l_progress := 'POS_WCAPPROVE_PVT.Update_Action_history: 02.';
Line: 2433

	SELECT nvl(max(wf.notification_id), -9995)
	into    l_notification_id
	FROM    wf_notifications wf,
	wf_item_activity_statuses wias
	WHERE  wias.item_type = p_itemtype
	and wias.item_key = p_itemkey
	and wias.notification_id = wf.group_id;
Line: 2449

	l_progress := 'POS_WCAPPROVE_PVT.Update_Action_history: 03.';
Line: 2450

	SELECT wfn.responder, wfn.recipient_role,
               wfn.original_recipient, wfn.more_info_role
        INTO l_responder, l_recipient_role,
             l_original_recipient, l_more_info_role
        FROM   wf_notifications wfn
        WHERE  wfn.notification_id = l_notification_id;
Line: 2498

	SELECT wfu.orig_system_id
	INTO l_original_recipient_id
	FROM wf_roles wfu
	WHERE wfu.name = l_original_recipient
	AND wfu.orig_system NOT IN ('POS', 'ENG_LIST', 'CUST_CONT');
Line: 2518

		l_progress := 'POS_WCAPPROVE_PVT.update_approval_history: 04.';
Line: 2528

		    UpdateActionHistory(l_more_origsysid,
                        l_original_recipient_id,
                        l_responder_id,
			FALSE,
                        p_action_code,
                        l_comments,
                        l_shipment_header_id);
Line: 2538

				l_api_name,'After updateactionhistory' ||
				l_shipment_header_id);
Line: 2545

			l_api_name,'Leave update_action_history' );
Line: 2554

			l_api_name,'Exception in Update_Action_History '
			|| l_progress);
Line: 2559

END Update_Action_History;
Line: 2561

PROCEDURE UpdateActionHistory(p_more_info_id           IN NUMBER,
                              p_original_recipient_id  IN NUMBER,
                              p_responder_id           IN NUMBER,
			      p_last_approver          IN BOOLEAN,
                              p_action_code            IN VARCHAR2,
                              p_comments               IN VARCHAR2,
                              p_shipment_header_id     IN NUMBER)
IS

-- pragma AUTONOMOUS_TRANSACTION;
Line: 2571

l_api_name varchar2(50) := 'UpdateActionHistory';
Line: 2577

  SELECT  ph.action_code action_code ,
          ph.object_type_code object_type_code ,
          ph.sequence_num sequence_num,
          ph.approval_path_id approval_path_id,
          ph.request_id request_id ,
          ph.program_application_id program_application_id,
          ph.program_date program_date ,
          ph.program_id program_id ,
          ph.last_update_date last_update_date,
          ph.object_id object_id,
	  ph.employee_id employee_id
  FROM
     rcv_shipment_headers rsh,
     po_action_history ph
  WHERE rsh.shipment_header_id = ph.object_id
     and rsh.shipment_header_id=p_shipment_header_id
     and ph.sequence_num = l_sequence_num;
Line: 2599

	l_progress := 'POS_WCAPPROVE_PVT.UpdateActionHistory: 01.';
Line: 2602

				l_api_name,'Enter in UpdateActionHistory '
			|| l_progress);
Line: 2610

	SELECT max(sequence_num)
	INTO l_sequence_num
	FROM PO_ACTION_HISTORY
	WHERE object_type_code = 'WC'
	AND object_id = p_shipment_header_id;
Line: 2635

				 'Before call to InsertPOActionHistory ');
Line: 2639

		      InsertPOActionHistory(
			   p_object_id => Recinfo.object_id,
			   p_object_type_code=>Recinfo.object_type_code,
			   p_object_sub_type_code => NULL,
			   p_sequence_num => Recinfo.sequence_num+1 ,
			   p_action_code =>NULL ,
			   p_action_date =>NULL ,
			   p_employee_id => p_original_recipient_id,
			   p_approval_path_id  => NULL ,
			   p_note => NULL,
			   p_object_revision_num => NULL,
			   p_offline_code =>  NULL,
			   p_request_id =>  Recinfo.request_id,
			   p_program_application_id => Recinfo.program_application_id,
			   p_program_id =>Recinfo.program_id ,
			   p_program_date => Recinfo.program_date ,
			   p_user_id => fnd_global.user_id  ,
			   p_login_id => fnd_global.login_id);
Line: 2664

		 ** post notification function  so that the update
		 ** to action history can be viewed at the moment of
		 ** reassignment. The following code is used to handle
		 ** request for more info:
		 ** 1. at the moment an approver requests for more info,
		 **    action history is updated (performed within post
		 ** notification)
		 ** 2. if the approver approve/reject the requisition
		 **      before the more info request is responded
		 **    then we need to update the action history
		 **      to reflect 'no action' from the more info
		*/
		IF (p_more_info_id is not null) THEN --{


			/*
			** update the original NULL row for the
			** original approver with
			** action code of 'NO ACTION'
			*/


			UpdatePOActionHistory(
			p_object_id => Recinfo.object_id,
			p_object_type_code => Recinfo.object_type_code,
			p_employee_id => p_more_info_id,
			p_action_code => 'NO ACTION',
			p_note => NULL,
			p_user_id => fnd_global.user_id,
			p_login_id => fnd_global.login_id);
Line: 2698

			** insert a new NULL row into PO_ACTION_HISTORY  for
			** the new approver
			*/


		      InsertPOActionHistory(
			   p_object_id => Recinfo.object_id,
			   p_object_type_code=>Recinfo.object_type_code,
			   p_object_sub_type_code => NULL,
			   p_sequence_num => Recinfo.sequence_num+1 ,
			   p_action_code =>NULL ,
			   p_action_date =>NULL ,
			   p_employee_id => p_responder_id,
			   p_approval_path_id  => NULL ,
			   p_note => NULL,
			   p_object_revision_num => NULL,
			   p_offline_code =>  NULL,
			   p_request_id =>  Recinfo.request_id,
			   p_program_application_id => Recinfo.program_application_id,
			   p_program_id =>Recinfo.program_id ,
			   p_program_date => Recinfo.program_date ,
			   p_user_id => fnd_global.user_id  ,
			   p_login_id => fnd_global.login_id);
Line: 2728

	l_progress := 'POS_WCAPPROVE_PVT.UpdateActionHistory: 02.';
Line: 2733

	** update pending row of action history with approval action
	*/
		IF (g_asn_debug = 'Y') THEN
		    debug_log(FND_LOG.LEVEL_STATEMENT,
					l_api_name,
				 'Before call to UpdatePOActionHistory '
			||l_progress);
Line: 2742

		UpdatePOActionHistory(
		p_object_id => Recinfo.object_id,
		p_object_type_code => Recinfo.object_type_code,
		p_employee_id => Recinfo.employee_id,
		p_action_code => p_action_code,
		p_note =>substrb(p_comments,1,4000),
		p_user_id => fnd_global.user_id,
		p_login_id => fnd_global.login_id);
Line: 2760

				'No data found in UpdateActionHistory '
			|| l_progress);
Line: 2768

				l_api_name,'Exception in UpdateActionHistory '
			|| l_progress);
Line: 2773

END UpdateActionHistory;
Line: 2817

PROCEDURE UpdatePOActionHistory (p_object_id            IN NUMBER,
                                 p_object_type_code     IN VARCHAR2,
                                 p_employee_id      IN NUMBER,
                                 p_action_code          IN VARCHAR2,
                                 p_note                 IN VARCHAR2,
                                 p_user_id              IN NUMBER,
                                 p_login_id             IN NUMBER)
IS
        l_progress      VARCHAR2(250) := '';
Line: 2828

	l_api_name varchar2(50) := ' UpdatePOActionHistory';
Line: 2832

	l_progress := 'POS_WCAPPROVE_PVT.UpdatePOActionHistory: 01.';
Line: 2835

				l_api_name,'Enter in UpdatePOActionHistory '
			|| l_progress);
Line: 2868

                SELECT HR.EMPLOYEE_ID
                INTO   l_employee_id
                FROM   FND_USER FND, HR_EMPLOYEES_CURRENT_V HR
                WHERE  FND.USER_ID = NVL(p_user_id, fnd_global.user_id)
                AND    FND.EMPLOYEE_ID = HR.EMPLOYEE_ID;
Line: 2881

	l_progress := 'POS_WCAPPROVE_PVT.UpdatePOActionHistory: 02.';
Line: 2884

				l_api_name,'Before Update '
			|| l_progress);
Line: 2899

				select comments
					into l_note
				from rcv_shipment_headers
				where shipment_header_id=p_object_id;
Line: 2909

        UPDATE PO_ACTION_HISTORY
        SET     last_update_date = sysdate,
                last_updated_by = p_user_id,
                last_update_login = p_login_id,
                employee_id = p_employee_id,
                --employee_id = NVL(l_employee_id, employee_id),
                action_date = sysdate,
                action_code = p_action_code,
                note = l_note
        WHERE   object_id = p_object_id
        AND     object_type_code = p_object_type_code
        AND     action_code IS NULL;
Line: 2924

	l_progress := 'POS_WCAPPROVE_PVT.UpdatePOActionHistory: 02.';
Line: 2938

			l_api_name,'invalid_action in UpdatePOActionHistory '
			|| l_progress);
Line: 2945

				l_api_name,'Exception in UpdatePOActionHistory '
			|| l_progress);
Line: 2950

END UpdatePOActionHistory;
Line: 2953

PROCEDURE InsertPOActionHistory (p_object_id                    IN  NUMBER,
                                  p_object_type_code           IN  VARCHAR2,
                                   p_object_sub_type_code       IN  VARCHAR2,
                                   p_sequence_num               IN  NUMBER,
                                   p_action_code                IN  VARCHAR2,
                                   p_action_date                IN  DATE,
                                   p_employee_id                IN  NUMBER,
                                   p_approval_path_id           IN  NUMBER,
                                   p_note                       IN  VARCHAR2,
                                   p_object_revision_num        IN  NUMBER,
                                   p_offline_code               IN  VARCHAR2,
                                   p_request_id                 IN  NUMBER,
                                   p_program_application_id     IN  NUMBER,
                                   p_program_id                 IN  NUMBER,
                                   p_program_date               IN  DATE,
                                   p_user_id                    IN  NUMBER,
                                   p_login_id                   IN  NUMBER)
IS
-- pragma AUTONOMOUS_TRANSACTION;
Line: 2974

	l_api_name varchar2(50) := ' InsertPOActionHistory';
Line: 2981

	l_progress := 'POS_WCAPPROVE_PVT.InsertPOActionHistory: 01.';
Line: 2984

				l_api_name,'Enter in InsertPOActionHistory '
			|| l_progress);
Line: 2999

	l_progress := 'POS_WCAPPROVE_PVT.InsertPOActionHistory: 02.';
Line: 3001

	SELECT MAX(sequence_num)
	INTO  l_sequence_num
	FROM  PO_ACTION_HISTORY
	WHERE object_id           = p_object_id
	AND   object_type_code    = p_object_type_code;
Line: 3007

	l_progress := 'POS_WCAPPROVE_PVT.InsertPOActionHistory: 03.';
Line: 3010

		l_progress := 'POS_WCAPPROVE_PVT.InsertPOActionHistory: 04.';
Line: 3013

		l_progress := 'POS_WCAPPROVE_PVT.InsertPOActionHistory: 05.';
Line: 3017

	l_progress := 'POS_WCAPPROVE_PVT.InsertPOActionHistory: 06.';
Line: 3022

    l_progress := 'POS_WCAPPROVE_PVT.InsertPOActionHistory: 07.';
Line: 3026

				l_api_name,'l_sequence_num before insert '
			|| l_sequence_num);
Line: 3032

    INSERT INTO PO_ACTION_HISTORY
                (object_id,
                object_type_code,
                object_sub_type_code,
                sequence_num,
                last_update_date,
                last_updated_by,
                employee_id,
                action_code,
                action_date,
                note,
                object_revision_num,
                last_update_login,
                creation_date,
                created_by,
                request_id,
                program_application_id,
                program_id,
                program_date,
                approval_path_id,
                offline_code,
                program_update_date)
    VALUES (p_object_id,
                'WC',
                'WC',
                l_sequence_num,
                sysdate,
                p_user_id,
                p_employee_id,
                p_action_code,
                p_action_date,
                l_note,
                p_object_revision_num,
                p_login_id,
                sysdate,
                p_user_id,
                p_request_id,
                p_program_application_id,
                p_program_id,
                p_program_date,
                p_approval_path_id,
                p_offline_code,
                sysdate);
Line: 3081

				l_api_name,'Exception in InsertPOActionHistory '
			|| l_progress);
Line: 3086

END InsertPOActionHistory;
Line: 3110

select rsl.shipment_line_id
from rcv_shipment_lines rsl
where rsl.shipment_header_id = l_shipment_header_id;
Line: 3116

  SELECT  object_id,
          object_type_code,
          object_sub_type_code,
          sequence_num,
          object_revision_num,
          request_id,
          program_application_id,
          program_date,
          program_id,
          last_update_date,
          employee_id
    FROM  PO_ACTION_HISTORY
   WHERE  object_type_code = 'WC'
     AND  object_id  = l_shipment_header_id
     AND  sequence_num = l_sequence_num;
Line: 3177

			select max(sequence_num)
			into l_sequence_num
			from po_action_history
			where object_type_code ='WC'
			and object_id = l_shipment_header_id;
Line: 3201

			UpdatePOActionHistory(
                                p_object_id => Recinfo.object_id,
                                p_object_type_code => Recinfo.object_type_code,
                                p_employee_id => Recinfo.employee_id,
                                p_action_code => l_action,
                                p_note => wf_engine.context_user_comment,
                                p_user_id => fnd_global.user_id,
                                p_login_id => fnd_global.login_id);
Line: 3211

			InsertPOActionHistory(
                                   p_object_id => Recinfo.object_id,
                                   p_object_type_code=>Recinfo.object_type_code,                                   p_object_sub_type_code => NULL,
                                   p_sequence_num => Recinfo.sequence_num+1 ,
                                   p_action_code =>NULL ,
                                   p_action_date =>NULL ,
                                   p_employee_id => l_new_recipient_id,
                                   p_approval_path_id  => NULL ,
                                   p_note => NULL,
                                   p_object_revision_num => NULL,
                                   p_offline_code =>  NULL,
                                   p_request_id =>  Recinfo.request_id,
                                   p_program_application_id => Recinfo.program_application_id,
                                   p_program_id =>Recinfo.program_id ,
                                   p_program_date => Recinfo.program_date ,
                                   p_user_id => fnd_global.user_id  ,
                                   p_login_id => fnd_global.login_id);
Line: 3340

	update_approval_status(p_shipment_header_id => l_shipment_header_id,
                               p_note => null,
                               p_approval_status => l_approval_status,
			       p_level => 'HEADER',
                               x_resultout => l_result);
Line: 3456

	update_approval_status(p_shipment_header_id => l_shipment_header_id,
			       p_note => null,
			       p_approval_status => l_approval_status,
			       p_level => 'HEADER',
			       x_resultout => l_result);
Line: 3534

procedure update_approval_status
			   (p_shipment_header_id in number,
                            p_note         in varchar2,
                            p_approval_status in varchar2,
			    p_level           in varchar2,
                            x_resultout       out NOCOPY varchar2) IS

cursor lock_rsh(l_shipment_header_id number) is
select null
from rcv_shipment_headers
where shipment_header_id  = l_shipment_header_id
for update of shipment_header_id nowait;
Line: 3553

l_api_name varchar2(50) := ' update_approval_status';
Line: 3556

	l_progress := 'POS_WCAPPROVE_PVT.update_approval_status: 01.';
Line: 3560

				'Enter in update_approval_status '
			|| l_progress);
Line: 3603

		update rcv_shipment_headers
		set approval_status = p_approval_status,
		    comments = nvl(p_note,comments)
		where shipment_header_id = p_shipment_header_id;
Line: 3613

		 * So update the header with the comments.
		*/
		update rcv_shipment_lines
		set approval_status = p_approval_status
		where shipment_header_id=p_shipment_header_id ;
Line: 3619

		update rcv_shipment_headers
		set comments = nvl(p_note,comments)
		where shipment_header_id = p_shipment_header_id;
Line: 3629

				l_api_name,'Exception in update_approval_status '
			|| l_progress);
Line: 3634

END update_approval_status;
Line: 3636

procedure insert_into_rti
			   (p_itemtype        in varchar2,
                            p_itemkey         in varchar2,
                            p_actid           in number,
                            p_funcmode        in varchar2,
                            x_resultout       out NOCOPY varchar2) IS

l_progress varchar2(300);
Line: 3644

l_api_name varchar2(50) := p_itemkey || ' insert_into_rti';
Line: 3648

SELECT rsl.po_line_location_id,
pll.unit_meas_lookup_code,
rsl.unit_of_measure unit_of_measure,
rsl.unit_of_measure primary_unit_of_measure,
rsl.unit_of_measure source_doc_unit_of_measure,
NVL(pll.promised_date, pll.need_by_date) promised_date,
rsl.to_organization_id ship_to_organization_id,
null quantity_ordered,
null amount_ordered,
NVL(pll.price_override, pl.unit_price) po_unit_price,
pll.match_option,
rsl.category_id,
rsl.item_description,
pl.po_line_id,
ph.currency_code,
ph.rate_type currency_conversion_type,
ph.segment1 document_num,
null po_distribution_id, --pod.po_distribution_id,
rsl.req_distribution_id,
rsl.requisition_line_id,
rsl.deliver_to_location_id deliver_to_location_id,
rsl.deliver_to_location_id location_id,
rsl.deliver_to_person_id,
null currency_conversion_date, --pod.rate_date currency_conversion_date,
null currency_conversion_rate, --pod.rate currency_conversion_rate,
rsl.destination_type_code destination_type_code,
rsl.destination_type_code destination_context,
null charge_account_id, --pod.code_combination_id ,
null destination_organization_id, --pod.destination_organization_id,
null subinventory, --pod.destination_subinventory ,
rsl.ship_to_location_id,
rsl.comments,
rsl.attribute_category attribute_category,
rsl.attribute1 attribute1,
rsl.attribute2 attribute2,
rsl.attribute3 attribute3,
rsl.attribute4 attribute4,
rsl.attribute5 attribute5,
rsl.attribute6 attribute6,
rsl.attribute7 attribute7,
rsl.attribute8 attribute8,
rsl.attribute9 attribute9,
rsl.attribute10 attribute10,
rsl.attribute11 attribute11,
rsl.attribute12 attribute12,
rsl.attribute13 attribute13,
rsl.attribute14 attribute14,
rsl.attribute15 attribute15,
NVL(pll.enforce_ship_to_location_code,'NONE') enforce_ship_to_location_code,
rsl.shipment_line_id,
rsl.item_id,
rsl.item_revision,
rsh.vendor_id,
rsh.shipment_num,
rsh.freight_carrier_code,
rsh.bill_of_lading,
rsh.packing_slip,
rsh.shipped_date,
rsh.expected_receipt_date,
rsh.waybill_airbill_num ,
rsh.vendor_site_id,
rsl.to_organization_id,
rsl.routing_header_id,
rsl.vendor_item_num,
rsl.vendor_lot_num,
rsl.ussgl_transaction_code,
rsl.government_context,
pll.po_header_id,
ph.revision_num po_revision_num,
pl.line_num document_line_num,
pll.shipment_num document_shipment_line_num,
null document_distribution_num , --pod.distribution_num
pll.po_release_id,
pl.job_id,
ph.org_id,
rsl.amount_shipped amount,
rsl.quantity_shipped  quantity,
rsl.quantity_shipped  source_doc_quantity,
rsl.quantity_shipped  primary_quantity,
rsl.quantity_shipped  quantity_shipped,
rsl.amount_shipped amount_shipped,
rsl.requested_amount requested_amount,
rsl.material_stored_amount material_stored_amount,
pll.matching_basis
FROM
--po_distributions_all pod,
po_line_locations_all pll,
po_lines_all pl,
po_headers_all ph,
rcv_shipment_lines rsl,
rcv_shipment_headers rsh
WHERE
rsh.shipment_header_id = l_shipment_header_id
and rsl.shipment_header_id =  rsh.shipment_header_id
and rsl.po_header_id =  ph.po_header_id
--and pod.po_header_id = ph.po_header_id
--and pod.line_location_id = pll.line_location_id
and rsl.po_line_id =  pl.po_line_id
and rsl.po_line_location_id =  pll.line_location_id
and rsh.receipt_source_code = 'VENDOR'
and pll.po_line_id = pl.po_line_id
AND NVL(pll.approved_flag, 'N') = 'Y'
AND NVL(pll.cancel_flag, 'N') = 'N'
AND pll.shipment_type IN('STANDARD', 'BLANKET', 'SCHEDULED','PREPAYMENT');
Line: 3759

select pod.po_distribution_id,
pod.rate_date currency_conversion_date,
pod.rate currency_conversion_rate,
pod.code_combination_id charge_account_id,
pod.destination_organization_id,
pod.destination_subinventory subinventory,
pod.distribution_num document_distribution_num,
pod.quantity_ordered,
pod.amount_ordered,
pod.destination_type_code destination_type_code,
pod.destination_type_code destination_context
from po_distributions_all pod
where pod.line_location_id = l_line_location_id;
Line: 3773

select rsl.shipment_line_id
from rcv_shipment_lines rsl
where rsl.shipment_header_id = l_shipment_header_id;
Line: 3809

l_insert_into_rti boolean := TRUE;
Line: 3813

	l_progress := 'POS_WCAPPROVE_PVT.insert_into_rti: 01.';
Line: 3817

				'Enter in insert_into_rti '
			|| l_progress);
Line: 3832

		SELECT rcv_headers_interface_s.NEXTVAL
		INTO l_header_interface_id
		FROM SYS.DUAL;
Line: 3836

		select rcv_interface_groups_s.nextval
		into l_group_id
		from dual;
Line: 3863

		select vendor_id,
			vendor_site_id,
			ship_to_org_id,
			ship_to_location_id,
			expected_receipt_date,
			shipment_num
		into l_vendor_id,
			l_vendor_site_id,
			l_ship_to_org_id,
			l_ship_to_location_id,
			l_expected_receipt_date,
			l_shipment_num
		from rcv_shipment_headers
		where shipment_header_id=l_shipment_header_id;
Line: 3880

				l_api_name,'insert into rhi');
Line: 3884

		INSERT INTO rcv_headers_interface( header_interface_id
                                         , group_id
                                         , processing_status_code
                                         , receipt_source_code
					 , asn_type
                                         , transaction_type
                                         , last_update_date
                                         , last_updated_by
                                         , creation_date
                                         , created_by
                                         , vendor_id
                                         , vendor_site_id
                                         , ship_to_organization_id
                                         , location_id
                                         , expected_receipt_date
                                         , employee_id
                                         , validation_flag
					 , shipment_num
		) VALUES (
			l_header_interface_id,
			l_group_id ,
			'PENDING', --processing_status_code,
			'VENDOR', --receipt_source_code,
			'STD',
			'NEW', -- transaction_type
			sysdate, --last_update_date,
			fnd_global.user_id , --last_updated_by
			sysdate, --creation_date
			fnd_global.login_id , --created_by
			l_vendor_id,
			l_vendor_site_id,
			l_ship_to_org_id,
			l_ship_to_location_id,
			l_expected_receipt_date,
			x_emp_id,
			'Y',
			l_shipment_num
			 );
Line: 3925

	/* Update rcv_shipment_headers with receipt_num */
/*
*/

	 IF (g_asn_debug = 'Y') THEN
	    debug_log(FND_LOG.LEVEL_STATEMENT,
			l_api_name,'before cursor open');
Line: 3937

		l_progress := 'POS_WCAPPROVE_PVT.insert_into_rti:02.';
Line: 3954

			select  muom.uom_code
			into l_uom_code
			from mtl_units_of_measure muom
			WHERE  muom.unit_of_measure =
				wcr_line_info.unit_of_measure;
Line: 3985

                l_progress := 'POS_WCAPPROVE_PVT.insert_into_rti:03.';
Line: 4021

			select nvl(sum(amount),0)
			into l_transacted_amount
			from rcv_transactions
			where po_distribution_id=
				wcr_line_info.po_distribution_id
			and transaction_type = 'RECEIVE';
Line: 4033

			select nvl(sum(amount),0)
			into l_interface_amount
			from rcv_transactions_interface
			where po_distribution_id=
				wcr_line_info.po_distribution_id
			and processing_status_code='PENDING'
			and transaction_status_code = 'PENDING'
			and transaction_type = 'RECEIVE';
Line: 4103

					l_api_name,'amount to be inserted '||
						wcr_line_info.amount  );
Line: 4106

			  l_insert_into_rti := TRUE;
Line: 4108

			  l_insert_into_rti := FALSE;
Line: 4111

			select nvl(sum(quantity),0)
			into l_transacted_quantity
			from rcv_transactions
			where po_distribution_id=
				wcr_line_info.po_distribution_id
			and transaction_type = 'RECEIVE';
Line: 4124

			select nvl(sum(quantity),0)
			into l_interface_quantity
			from rcv_transactions_interface
			where po_distribution_id=
				wcr_line_info.po_distribution_id
			and processing_status_code='PENDING'
			and transaction_status_code = 'PENDING'
			and transaction_type = 'RECEIVE';
Line: 4204

					l_api_name,'quantity to be inserted '||
						wcr_line_info.quantity  );
Line: 4207

			  l_insert_into_rti := TRUE;
Line: 4209

			  l_insert_into_rti := FALSE;
Line: 4213

		If (l_insert_into_rti) then --{
		select rcv_transactions_interface_s.nextval
		into l_interface_id
		from dual;
Line: 4223

		rcv_asn_interface_trx_ins_pkg.insert_row
			    (l_row_id,
			     l_interface_id,--interface_id
			     l_group_id, --group_id
			     sysdate, --last_updated_date
			     fnd_global.user_id, --last_updated_by,
			     sysdate, --creation_date,
			     fnd_global.login_id, --created_by,
			     fnd_global.login_id, -- last_update_login,
			     NULL, --request_id,
			     null, --program_application_id,
			     null, --program_id,
			     null, --program_update_date,
			     'RECEIVE', --transaction_type,
			     sysdate, --transaction_date,
			     'PENDING', --processing_status_code,
			     'IMMEDIATE', --processing_mode_code,
			     --'BATCH',
			     null, --processing_request_id,
			     'PENDING', --.transaction_status_code,
			     wcr_line_info.category_id,
			     wcr_line_info.quantity, --quantity
			     wcr_line_info.unit_of_measure,
			     'ISP', --.interface_source_code,
			     NULL, --.interface_source_line_id,
			     NULL, --.inv_transaction_id,
			     wcr_line_info.item_id,
			     wcr_line_info.item_description,
			     wcr_line_info.item_revision,
			     l_uom_code, --uom_code,
			     x_emp_id, --employee_id,
			     'DELIVER', --auto_transact_code,
			     l_shipment_header_id, --l_shipment_header_id
			     wcr_line_info.shipment_line_id,
			     wcr_line_info.ship_to_location_id,
			     wcr_line_info.primary_quantity,
			     wcr_line_info.primary_unit_of_measure,
			     'VENDOR', --.receipt_source_code,
			     wcr_line_info.vendor_id,
			     wcr_line_info.vendor_site_id,
			     NULL, --from_organization_id,
			     NULL, --from_subinventory,
			     wcr_line_info.to_organization_id,
			     NULL, --.intransit_owning_org_id,
			     wcr_line_info.routing_header_id,
			     NULL, --.routing_step_id,
			     'PO', --source_document_code,
			     NULL, --.parent_transaction_id,
			     wcr_line_info.po_header_id,
			     wcr_line_info.po_revision_num,
			     wcr_line_info.po_release_id,
			     wcr_line_info.po_line_id,
			     wcr_line_info.po_line_location_id,
			     wcr_line_info.po_unit_price,
			     wcr_line_info.currency_code,
			     wcr_line_info.currency_conversion_type,
			     wcr_line_info.currency_conversion_rate,
			     wcr_line_info.currency_conversion_date,
			     wcr_line_info.po_distribution_id,
			     wcr_line_info.requisition_line_id,
			     wcr_line_info.req_distribution_id,
			     wcr_line_info.charge_account_id,
			     NULL, --.substitute_unordered_code,
			     NULL, --.receipt_exception_flag,
			     NULL, --.accrual_status_code,
			     'NOT INSPECTED' ,--.inspection_status_code,
			     NULL, --.inspection_quality_code,
			     wcr_line_info.destination_type_code,
			     wcr_line_info.deliver_to_person_id,
			     wcr_line_info.location_id,
			     wcr_line_info.deliver_to_location_id,
			     NULL, --.subinventory,
			     NULL, --.locator_id,
			     NULL, --.wip_entity_id,
			     NULL, --.wip_line_id,
			     NULL, --.department_code,
			     NULL, --.wip_repetitive_schedule_id,
			     NULL, --.wip_operation_seq_num,
			     NULL, --.wip_resource_seq_num,
			     NULL, --.bom_resource_id,
			     wcr_line_info.shipment_num,
			     wcr_line_info.freight_carrier_code,
			     wcr_line_info.bill_of_lading,
			     wcr_line_info.packing_slip,
			     wcr_line_info.shipped_date,
			     wcr_line_info.expected_receipt_date,
			     NULL, --.actual_cost,
			     NULL, --.transfer_cost,
			     NULL, --.transportation_cost,
			     NULL, --.transportation_account_id,
			     NULL, --.num_of_containers,
			     wcr_line_info.waybill_airbill_num,
			     wcr_line_info.vendor_item_num,
			     wcr_line_info.vendor_lot_num,
			     NULL,--.rma_reference,
			     wcr_line_info.comments,
			     wcr_line_info.attribute_category,
			     wcr_line_info.attribute1,
			     wcr_line_info.attribute2,
			     wcr_line_info.attribute3,
			     wcr_line_info.attribute4,
			     wcr_line_info.attribute5,
			     wcr_line_info.attribute6,
			     wcr_line_info.attribute7,
			     wcr_line_info.attribute8,
			     wcr_line_info.attribute9,
			     wcr_line_info.attribute10,
			     wcr_line_info.attribute11,
			     wcr_line_info.attribute12,
			     wcr_line_info.attribute13,
			     wcr_line_info.attribute14,
			     wcr_line_info.attribute15,
			     NULL, --.ship_head_attribute_category,
			     NULL, --.ship_head_attribute1,
			     NULL, --.ship_head_attribute2,
			     NULL, --.ship_head_attribute3,
			     NULL, --.ship_head_attribute4,
			     NULL, --.ship_head_attribute5,
			     NULL, --.ship_head_attribute6,
			     NULL, --.ship_head_attribute7,
			     NULL, --.ship_head_attribute8,
			     NULL, --.ship_head_attribute9,
			     NULL, --.ship_head_attribute10,
			     NULL, --.ship_head_attribute11,
			     NULL, --.ship_head_attribute12,
			     NULL, --.ship_head_attribute13,
			     NULL, --.ship_head_attribute14,
			     NULL, --.ship_head_attribute15,
			     NULL, --.ship_line_attribute_category,
			     NULL, --.ship_line_attribute1,
			     NULL, --.ship_line_attribute2,
			     NULL, --.ship_line_attribute3,
			     NULL, --.ship_line_attribute4,
			     NULL, --.ship_line_attribute5,
			     NULL, --.ship_line_attribute6,
			     NULL, --.ship_line_attribute7,
			     NULL, --.ship_line_attribute8,
			     NULL, --.ship_line_attribute9,
			     NULL, --.ship_line_attribute10,
			     NULL, --.ship_line_attribute11,
			     NULL, --.ship_line_attribute12,
			     NULL, --.ship_line_attribute13,
			     NULL, --.ship_line_attribute14,
			     NULL, --.ship_line_attribute15,
			     wcr_line_info.ussgl_transaction_code,
			     wcr_line_info.government_context,
			     NULL, --.reason_id,
			     wcr_line_info.destination_context,
			     wcr_line_info.source_doc_quantity,
			     wcr_line_info.source_doc_unit_of_measure,
			     NULL, --.movement_id,
			     NULL, --l_header_interface_id, --.header_interface_id,
			     NULL, --.vendor_cum_shipped_qty,
			     NULL, --.item_num,
			     wcr_line_info.document_num,
			     wcr_line_info.document_line_num,
			     NULL, --.truck_num,
			     NULL, --.ship_to_location_code,
			     NULL, --.container_num,
			     NULL, --.substitute_item_num,
			     NULL, --.notice_unit_price,
			     NULL, --.item_category,
			     NULL, --.location_code,
			     NULL, --.vendor_name,
			     NULL, --.vendor_num,
			     NULL, --.vendor_site_code,
			     NULL, --.from_organization_code,
			     NULL, --.to_organization_code,
			     NULL, --.intransit_owning_org_code,
			     NULL, --.routing_code,
			     NULL, --.routing_step,
			     NULL, --.release_num,
			     wcr_line_info.document_shipment_line_num,
			     wcr_line_info.document_distribution_num,
			     NULL, --.deliver_to_person_name,
			     NULL, --.deliver_to_location_code,
			     NULL, --.use_mtl_lot,
			     NULL, --.use_mtl_serial,
			     NULL, --.LOCATOR,
			     NULL, --.reason_name,
			     NULL, --.validation_flag,
			     NULL, --.substitute_item_id,
			     NULL, --.quantity_shipped,
			     NULL, --.quantity_invoiced,
			     NULL, --.tax_name,
			     NULL, --.tax_amount,
			     NULL, --.req_num,
			     NULL, --.req_line_num,
			     NULL, --.req_distribution_num,
			     NULL, --.wip_entity_name,
			     NULL, --.wip_line_code,
			     NULL, --.resource_code,
			     NULL, --.shipment_line_status_code,
			     NULL, --.barcode_label,
			     NULL, --.country_of_origin_code,
			     NULL, --.from_locator_id, --WMS Change
			     NULL, --.qa_collection_id,
			     NULL, --.oe_order_header_id,
			     NULL, --.oe_order_line_id,
			     NULL, --.customer_id,
			     NULL, --.customer_site_id,
			     NULL, --.customer_item_num,
			     NULL, --.create_debit_memo_flag,
			     NULL, --.put_away_rule_id,
			     NULL, --.put_away_strategy_id,
			     NULL, --.lpn_id,
			     NULL, --.transfer_lpn_id,
			     NULL, --.cost_group_id,
			     NULL, --.mobile_txn,
			     NULL, --.mmtt_temp_id,
			     NULL, --.transfer_cost_group_id,
			     NULL, --.secondary_quantity,
			     NULL, --.secondary_unit_of_measure,
			     NULL, --.secondary_uom_code,
			     NULL, --.qc_grade,
			     NULL, --.oe_order_num,
			     NULL, --.oe_order_line_num,
			     NULL, --.customer_account_number,
			     NULL, --.customer_party_name,
			     NULL, --.source_transaction_num,
			     NULL, --.parent_source_transaction_num,
			     NULL, --.parent_interface_txn_id,
			     NULL, --.customer_item_id,
			     NULL, --.interface_available_qty,
			     NULL, --.interface_transaction_qty,
			     NULL, --.from_locator,
			     NULL, --.lpn_group_id,
			     NULL, --.order_transaction_id,
			     NULL, --.license_plate_number,
			     NULL, --.transfer_license_plate_number,
			     wcr_line_info.amount,
			     wcr_line_info.job_id,
			     NULL, --.project_id,
			     NULL, --.task_id,
			     NULL, --.asn_attach_id,
			     NULL, --.timecard_id,
			     NULL, --.timecard_ovn,
			     NULL, --.interface_available_amt,
			     NULL, --.interface_transaction_amt
			     wcr_line_info.org_id,  --
			     wcr_line_info.matching_basis,
			     NULL, --wcr_line_info.amount_shipped, --amount_shipped
			     wcr_line_info.requested_amount,
			     wcr_line_info.material_stored_amount

			);
Line: 4471

				l_api_name,'After insert '  );
Line: 4496

	update rcv_shipment_headers
	set receipt_num= l_receipt_num,
	    last_update_date = sysdate,
            last_updated_by = fnd_global.user_id,
            last_update_login = fnd_global.login_id
	where shipment_header_id = l_shipment_header_id;
Line: 4504

			l_api_name,'Leave insert_into_rti '  );
Line: 4515

				l_api_name,'Exception in insert_into_rti '
			|| l_progress);
Line: 4520

END insert_into_rti;
Line: 4598

		UPDATE rcv_transactions_interface
		set transaction_status_code = 'ERROR'
		 where group_id = l_group_id;
Line: 4639

	update wf_notifications set status = 'CLOSED'
        where notification_id in (
           select ias.notification_id
             from wf_item_activity_statuses ias,
                  wf_notifications ntf
            where ias.item_type = p_itemtype
              and ias.item_key  = p_itemkey
              and ntf.notification_id  = ias.notification_id);
Line: 4658

procedure UpdateWorkflowInfo
(
p_itemtype        in varchar2,
p_itemkey         in varchar2,
p_shipment_header_id in varchar2) IS
-- pragma AUTONOMOUS_TRANSACTION;
Line: 4665

l_api_name varchar2(50) := p_itemkey || ' UpdateWorkflowInfo';
Line: 4669

	l_progress := 'POS_WCAPPROVE_PVT.UpdateWorkflowInfo: 01';
Line: 4673

                                l_api_name,'Enter in UpdateWorkflowInfo ' || l_progress);
Line: 4682

        UPDATE rcv_shipment_headers
        SET WF_ITEM_TYPE = p_itemtype,
            WF_ITEM_KEY  = p_itemkey,
            last_updated_by         = fnd_global.user_id,
            last_update_login       = fnd_global.login_id,
            last_update_date        = sysdate
        WHERE  shipment_header_id = p_shipment_header_id;
Line: 4698

                                l_api_name,'Exception in UpdateWorkflowInfo ' || l_progress);
Line: 4701

end UpdateWorkflowInfo;
Line: 4723

                        UPDATE PO_ACTION_HISTORY
                          set object_id = p_object_id,
                              object_type_code = p_object_type_code,
                              sequence_num = p_sequence_num,
                              last_update_date = sysdate,
                              last_updated_by = p_user_id,
                              creation_date = sysdate,
                              created_by = p_user_id,
                              action_code = p_action_code,
                              action_date =  sysdate,
                              employee_id = p_employee_id,
                              last_update_login = p_login_id,
                              request_id = 0,
                              program_application_id = 0,
                              program_id = 0,
                              program_update_date = '',
                              offline_code = ''
                              WHERE
                              object_id= p_object_id and
                              object_type_code = p_object_type_code and
                              sequence_num = p_sequence_num;
Line: 4757

  select org_id
  from po_headers_all
  where po_header_id = p_document_id;
Line: 4788

    select distinct full_name
    into   l_value
    from   per_all_people_f hre
    where  hre.person_id = p_approver_id
    and trunc(sysdate) BETWEEN effective_start_date
        and effective_end_date;
Line: 4817

        select max(po_header_id)
        into l_po_header_id
        from rcv_shipment_lines
        where shipment_header_id = p_shipment_header_id;
Line: 4844

		select ship_to_org_id
		into l_ship_to_org_id
		from rcv_shipment_headers
		where shipment_header_id=p_shipment_header_id;
Line: 4856

		 SELECT        (next_receipt_num + 1)
		 INTO          x_receipt_num
		 FROM          rcv_parameters
		 WHERE         organization_id = l_ship_to_org_id
		 FOR UPDATE OF next_receipt_num;
Line: 4863

		    SELECT COUNT(*)
		    INTO   l_count
		    FROM   rcv_shipment_headers
		    WHERE  receipt_num = x_receipt_num
		    AND    ship_to_org_id = l_ship_to_org_id;
Line: 4870

		       UPDATE rcv_parameters
			  SET next_receipt_num = x_receipt_num
			WHERE organization_id = l_ship_to_org_id;
Line: 4898

        POS_WC_CREATE_UPDATE_PVT.GET_PAY_ITEM_PROGRESS
                                (p_wc_id,
                                 p_wc_stage,
                                 l_progress,
                                 l_return_status,
                                 l_return_msg);
Line: 4921

	select count(*)
	into l_count
	from gms_awards_all awd,
	gms_award_distributions adl,
	po_distributions_all pod
	where adl.award_id     = awd.award_id
	and adl.adl_line_num = 1
	and adl.po_distribution_id =pod.po_distribution_id
	and adl.award_set_id = pod.award_id
	and pod.po_distribution_id = p_wc_id;
Line: 4935

		select awd.award_number
		into l_award_number
		from gms_awards_all awd,
		gms_award_distributions adl,
		po_distributions_all pod
		where adl.award_id     = awd.award_id
		and adl.adl_line_num = 1
		and adl.po_distribution_id =pod.po_distribution_id
		and adl.award_set_id = pod.award_id
		and pod.po_header_id = p_wc_id;
Line: 4957

	select count(*)
	into l_count
	from hr_locations_all_tl hl,
	po_distributions_all pod
	where pod.deliver_to_location_id = hl.location_id and
	hl.language (+) =userenv('LANG') and
	pod.po_distribution_id = p_wc_id;
Line: 4969

		select hl.location_code
		into l_deliver_to_location
		from hr_locations_all_tl hl,
		po_distributions_all pod
		where pod.deliver_to_location_id = hl.location_id and
		hl.language (+) =userenv('LANG') and
		pod.po_distribution_id = p_wc_id;
Line: 4988

	select count(*)
	into l_count
	from po_line_locations_all poll
	where poll.line_location_id = p_wc_id
	and nvl(poll.matching_basis,'QUANTITY')='AMOUNT';
Line: 4999

		select poll.amount
		into l_amount
		from po_line_locations_all poll
		where poll.line_location_id = p_wc_id
		and nvl(poll.matching_basis,'QUANTITY')='AMOUNT';
Line: 5017

	select count(*)
	into l_count
	from po_line_locations_all poll
	where poll.line_location_id = p_wc_id
	and nvl(poll.matching_basis,'QUANTITY')='QUANTITY';
Line: 5028

		select poll.quantity
		into l_quantity
		from po_line_locations_all poll
		where poll.line_location_id = p_wc_id
		and nvl(poll.matching_basis,'QUANTITY')='QUANTITY';
Line: 5046

	select count(*)
	into l_count
	from pa_projects_all pa,
	po_distributions_all pod
	where pod.project_id = pa.project_id and
	pod.po_distribution_id = p_wc_id;
Line: 5058

		select pa.name
		into l_project_name
		from pa_projects_all pa,
		po_distributions_all pod
		where pod.project_id = pa.project_id and
		pod.po_distribution_id = p_wc_id;
Line: 5076

	select count(*)
	into l_count
	from pa_tasks pa,
	po_distributions_all pod
	where pod.task_id = pa.task_id and
	pod.po_distribution_id = p_wc_id;
Line: 5088

		select pa.task_name
		into l_task_name
		from pa_tasks pa,
		po_distributions_all pod
		where pod.task_id = pa.task_id and
		pod.po_distribution_id = p_wc_id;
Line: 5105

	select count(*)
	into l_count
	from gl_code_combinations_kfv glc,
	po_distributions_all pod
	where pod.code_combination_id = glc.code_combination_id and
	pod.po_distribution_id = p_wc_id;
Line: 5117

		select glc.concatenated_segments
		into l_segments
		from gl_code_combinations_kfv glc,
		po_distributions_all pod
		where pod.code_combination_id = glc.code_combination_id and
		pod.po_distribution_id = p_wc_id;
Line: 5134

	select count(*)
	into l_count
	from org_organization_definitions ood,
	po_distributions_all pod
	where pod.expenditure_organization_id = ood.organization_id
	and pod.po_distribution_id = p_wc_id;
Line: 5146

		select ood.organization_name
		into l_org_name
		from org_organization_definitions ood,
		po_distributions_all pod
		where pod.expenditure_organization_id = ood.organization_id
		and pod.po_distribution_id = p_wc_id;