The following lines contain the word 'select', 'insert', 'update' or 'delete':
FUNCTION Get_Emd_Update_Url (pn_aunction_header_id NUMBER)
RETURN VARCHAR2
IS
l_ext_fwk_agent VARCHAR2(240);
l_emd_update_link VARCHAR2(4000);
l_emd_update_link := l_ext_fwk_agent || '?'|| 'page=/oracle/apps/pon/emd/creation/webui/ponEmdUpdatePG'
|| '&' ||'akRegionApplicationId=396' || '&' ||'OAHP=PON_EMD_ADMIN_HOME'||'&'||'OASF=PON_EMD_UPDATE'
||'&'||'OAPB=PON_SOURCING_BRAND'||'&'|| 'notificationId=&' || '#NID' ||'&'||'language_code=' || fnd_global.current_language;
l_emd_update_link := '';
Return l_emd_update_link;
END Get_Emd_Update_Url;
SELECT item_type,
item_key
FROM wf_item_activity_statuses
WHERE notification_id = pn_notification_id;
SELECT SUBSTR(context,1,INSTR(context,':',1)-1),
SUBSTR(context,INSTR(context,':')+1,
(INSTR(context,':',1,2) - INSTR(context,':')-1)),
message_name
FROM wf_notifications
WHERE notification_id = pn_notification_id;
select count(auction_header_id),
nvl(sum(decode(approval_status,'APPROVED',1,0)),0)
into l_approval_count,l_approved_count
from pon_neg_team_members
where auction_header_id = p_auction_header_id
--FOR ERIC TEST ONLY,BEGIN
---------------------------------------------------------
--and approver_flag='Y';
select activity_label
into l_activity_status
from wf_item_activity_statuses_v
where item_type = 'PONAPPRV'
and item_key = p_top_process_item_key
and activity_status_code = 'NOTIFIED';
select activity_label
into l_activity_status
from wf_item_activity_statuses_v
where item_type = 'PONAPPRV'
and item_key = p_top_process_item_key
and activity_status_code = 'NOTIFIED';
select user_id
into l_user_id
from fnd_user
where user_name = p_user_name;
select neg.approver_flag, neg.approval_status, auc.approval_status,
wf_approval_item_key
into l_user_approval,l_user_status,l_auction_status,l_parent_process_itemKey
from pon_neg_team_members neg, pon_auction_headers_all auc
where auc.auction_header_id = p_auction_header_id
and neg.auction_header_id= auc.auction_header_id
and neg.user_id = l_user_id;
update pon_neg_team_members
set approver_flag ='N'
where auction_header_id = p_auction_header_id
and user_id = l_user_id;
/* Select notification Id from the item key and user name */
select notification_id
into l_nid
from WF_ITEM_ACTIVITY_STATUSES
where ASSIGNED_USER = p_user_name
and ITEM_TYPE = l_itemType
and ITEM_KEY = l_itemkey
and activity_status ='NOTIFIED';
PROCEDURE UPDATE_NOTIF_ONLINE (p_auction_header_id number,
p_user_name varchar2,
p_result varchar2,
p_note_to_buyer varchar2,
p_signed_date DATE,
p_resultOut out nocopy number) is
l_itemKey varchar2(240);
select user_id
into l_user_id
from fnd_user
where user_name = p_user_name;
select neg.approver_flag, neg.approval_status, auc.approval_status,
wf_approval_item_key
into l_user_approval,l_user_status,l_auction_status,l_itemKey
from pon_neg_team_members neg, pon_auction_headers_all auc
where auc.auction_header_id = p_auction_header_id
and neg.auction_header_id= auc.auction_header_id
and neg.user_id = l_user_id;
/* Select notification Id from the item key and user name */
begin
select notification_id
into l_nid
from WF_ITEM_ACTIVITY_STATUSES
where ASSIGNED_USER = p_user_name
and ITEM_TYPE = l_itemType
and ITEM_KEY = l_itemkey
and activity_status ='NOTIFIED';
SELECT wf_approval_item_key
INTO l_item_key_main_process
FROM pon_auction_headers_all
WHERE auction_header_id = p_auction_header_id;
end UPDATE_NOTIF_ONLINE;
select activity_label, item_key,notification_id
from wf_item_activity_statuses_v
where item_type = p_item_type
and item_key like p_parent_item_key || '_%'
and activity_status_code = 'NOTIFIED';
PROCEDURE UPDATE_DOC_TO_CANCELLED ( itemtype in varchar2,
Itemkey in varchar2,
actid in number,
uncmode in varchar2,
resultout out nocopy varchar2) is
l_auction_header_id NUMBER;
update pon_auction_headers_all
set auction_status = 'CANCELLED'
where auction_header_id=l_auction_header_id;
end UPDATE_DOC_TO_CANCELLED;
insert into vhk_dummy values(msg);
select fnd.user_name, fnd.user_id, pon.close_bidding_date,
pon.auction_title,
decode(nvl(pon.open_auction_now_flag,'N'),'Y',to_date(null),pon.open_bidding_date) open_bidding_date,
nvl(pon.open_auction_now_flag,'N') open_auction_now_flag,
pon.document_number, trading_partner_contact_id, trading_partner_name, trading_partner_contact_name,
open_bidding_date, close_bidding_date, nvl(auction_round_number, 1),
nvl(amendment_number, 0), auction_header_id_orig_amend, view_by_date
from fnd_user fnd,pon_auction_headers_all pon
where fnd.person_party_id = pon.trading_partner_contact_id and
pon.auction_header_id = p_auction_header_id and
rownum=1;
select to_char(PON_AUCTION_WF_APPROVALS_S.NEXTVAL)
into l_seq from sys.dual;
select dt.doctype_group_name,auh.doctype_id
into l_doctype_group_name,l_doctype_id
from pon_auction_headers_all auh, pon_auc_doctypes dt
where auh.auction_header_id = p_auction_header_id
and auh.doctype_id = dt.doctype_id;
select document_number
into l_orig_document_number
from pon_auction_headers_all
where auction_header_id = l_auction_header_id_orig_amend;
select emp.full_name into l_creator_full_name from
per_all_people_f emp,
fnd_user fnd
where fnd.employee_id=emp.person_id and
fnd.user_id = l_creator_user_id and
trunc(sysdate) between emp.effective_start_date and emp.effective_end_date;
select user_id
into l_submit_user_id
from fnd_user
where user_name = p_submit_user_name;
/* Update Headers table */
UPDATE pon_auction_headers_all set
wf_approval_item_key = l_itemKey,
approval_status = 'INPROCESS'
WHERE auction_header_id = p_auction_header_id;
select u.user_name user_name,
u.user_id,
auc.close_bidding_date close_bidding_date,
auc.auction_title,
decode(nvl(auc.open_auction_now_flag,'N'),'Y',to_date(null),auc.open_bidding_date) open_bidding_date,
decode(nvl(auc.publish_auction_now_flag,'N'),'Y',to_date(null),auc.view_by_date) view_by_date,
auc.document_number doc_number,
trading_partner_contact_id auction_contact_id,
nvl(auc.publish_auction_now_flag,'N') publish_auction_now_flag,
nvl(auc.open_auction_now_flag,'N') open_auction_now_flag,
auc.auction_header_id_orig_amend
from pon_neg_team_members neg, pon_auction_headers_all auc, fnd_user u
where neg.auction_header_id = auc.auction_header_id and
auc.auction_header_id = p_auction_header_id
and neg.APPROVER_FLAG ='Y'
AND neg.MENU_NAME <> 'EMD_ADMIN' --FOR ERIC TEST ONLY
and u.user_id = neg.user_id;
select sysdate+((l_reminder_date - sysdate) * l_timeout_factor)
into l_reminder_date
from dual;
select document_number
into l_orig_document_number
from pon_auction_headers_all
where auction_header_id = r1.auction_header_id_orig_amend;
SELECT 'Y'
INTO l_result
FROM
pon_auction_headers_all auc
, pon_neg_team_members neg
WHERE auc.auction_header_id = neg.auction_header_id
AND auc.auction_header_id = p_auction_header_id
AND auc.approval_status = 'INPROCESS'
AND neg.user_id = p_user_id
AND neg.MENU_NAME = 'EMD_ADMIN'
and neg.approver_flag = 'Y'
AND neg.approval_status IS NULL;
--INSERT INTO ERIC_LOG VALUES ('EMD Is_Valid_Response error : '||ls_error, 'l_result = '|| l_result,'p_user_id ='||p_user_id,'p_auction_header_id = '||p_auction_header_id,'','','','');--for eric test only
select 'Y'
into l_result
from pon_auction_headers_all auc,
pon_neg_team_members neg
where auc.auction_header_id = neg.auction_header_id
and auc.auction_header_id = p_auction_header_id
and auc.approval_status = 'INPROCESS'
and neg.user_id = p_user_id
AND neg.MENU_NAME <> 'EMD_ADMIN' --FOR ERIC TEST ONLY
and neg.approver_flag = 'Y'
and neg.approval_status is null;
/* Insert a row into history table */
UPD_AUCTION_STATUSHISTORY(l_auction_header_id,
l_result,
l_notes,
l_user_id,
'USER',
l_signed_date);-- Adding by amundhra for Federal CLM, signed date
/* Insert a row into history table */
UPD_AUCTION_STATUSHISTORY(p_auctionHeaderId, p_decision,
p_notes, p_user_id,'USER',NULL);-- Adding by amundhra for Federal CLM, signed date will be null here
Select wf_approval_item_key
into l_top_process_itemKey
from pon_auction_headers_all
where auction_header_id = p_auctionHeaderId;
/*Update PON_NEG_TEAM_MEMEBERS APPROVAL_STATUS field */
/* Insert a row into history table */
--changed by amundhra for Federal CLM
--added l_signed_date in the IN PARAM
UPD_AUCTION_STATUSHISTORY(l_auction_header_id,
l_result,
l_notes,
l_user_id,
'USER',
l_signed_date); ---- Adding by amundhra for Federal CLM
SELECT effective_date
INTO l_effective_date
FROM pon_auction_headers_all
WHERE auction_header_id = p_auction_header_id;
UPDATE pon_auction_headers_all
SET effective_date = p_signed_date,
signed_date = p_signed_date
WHERE auction_header_id = p_auction_header_id;
UPDATE pon_auction_headers_all
SET signed_date = p_signed_date
WHERE auction_header_id = p_auction_header_id;
SELECT max(action_date)
INTO l_approve_date
FROM pon_action_history
WHERE object_id = l_auction_header_id
and object_type_code = 'NEGOTIATION'
and action_type = 'APPROVE';
SELECT max(action_date)
INTO l_reject_date
FROM pon_action_history
WHERE object_id = l_auction_header_id
and object_type_code = 'NEGOTIATION'
and action_type = 'REJECT';
--INSERT INTO ERIC_LOG VALUES ('ENTER USER Branch','','','','','','',''); --for eric test only
Update pon_neg_team_members
set approval_status = decode(p_status,'APPROVE','APPROVED','REJECT','REJECTED',p_status)
where auction_header_id = p_auction_header_id
and user_id = p_user_id
AND approver_flag = 'Y' -- for eric test only
AND MENU_NAME<>'EMD_ADMIN'; -- for eric test only
insert into pon_action_history
(object_id,
object_id2,
object_type_code,
sequence_num,
action_type,
action_date,
action_user_id,
action_note,
signed_date) --Added by amundhra for Federal CLM, inserting into the action_history table
values (
p_auction_header_id,
p_auction_header_id,
'NEGOTIATION',
0,
decode(p_status,'APPROVED','APPROVE','REJECTED','REJECT',p_status),
sysdate,
p_user_id,
p_notes,
p_signed_date --added by amundhra for Federal CLM, digned date needs to be stored in action history
);
UPDATE pon_neg_team_members
SET approval_status = decode(p_status
,'APPROVE'
,'APPROVED'
,'REJECT'
,'REJECTED'
,p_status
)
WHERE auction_header_id = p_auction_header_id
AND user_id = p_user_id
AND MENU_NAME='EMD_ADMIN'
AND approver_flag = 'Y';
INSERT INTO pon_action_history
(object_id
,object_id2
,object_type_code
,sequence_num
,action_type
,action_date
,action_user_id
,action_note,
signed_date)
VALUES
(p_auction_header_id
,p_auction_header_id
,'NEGOTIATION-EMD'
,0
,decode(p_status
,'APPROVED'
,'APPROVE'
,'REJECTED'
,'REJECT'
,p_status
)
,SYSDATE
,p_user_id
,p_notes
,p_signed_date); -- added signed date , will be null here
update pon_auction_headers_all
set approval_status = p_status,
draft_locked = 'N',
draft_locked_by = null,
draft_locked_by_contact_id = null,
draft_locked_date = null
where auction_header_id = p_auction_header_id;
SELECT
u.user_name user_name
, u.user_id
, auc.close_bidding_date close_bidding_date
, auc.auction_title
, decode( nvl(auc.open_auction_now_flag,'N')
,'Y'
,to_date(NULL)
,auc.open_bidding_date) open_bidding_date
, decode( nvl(auc.publish_auction_now_flag,'N')
, 'Y'
, to_date(NULL)
, auc.view_by_date ) view_by_date
, auc.document_number doc_number
, trading_partner_contact_id auction_contact_id
, nvl(auc.publish_auction_now_flag ,'N') publish_auction_now_flag
, nvl(auc.open_auction_now_flag,'N') open_auction_now_flag
, auc.auction_header_id_orig_amend
FROM
pon_neg_team_members neg
, pon_auction_headers_all auc
, fnd_user u
WHERE neg.auction_header_id = auc.auction_header_id
AND auc.auction_header_id = p_auction_header_id
AND MENU_NAME='EMD_ADMIN'
AND approver_flag = 'Y' --for eric test only
AND u.user_id = neg.user_id;
SELECT SYSDATE + ((l_reminder_date - SYSDATE) * l_timeout_factor)
INTO l_reminder_date
FROM dual;
l_review_emd_changes_url := Get_Emd_Update_Url (l_auction_header_id ); --FOR ERIC TEST ONLY
SELECT document_number
INTO l_orig_document_number
FROM pon_auction_headers_all
WHERE auction_header_id = r1.auction_header_id_orig_amend;
/* Insert a row into history table */
UPD_AUCTION_STATUSHISTORY(l_auction_header_id
,l_result
,l_notes
,l_user_id
,'EMD'
,NULL); -- Adding by amundhra for Federal CLM, signed date will be null here
/*Update PON_NEG_TEAM_MEMEBERS APPROVAL_STATUS field */
/* Insert a row into history table */
UPD_AUCTION_STATUSHISTORY( l_auction_header_id
, l_result
, l_notes
, l_user_id
, 'EMD'
,NULL); -- Adding by amundhra for Federal CLM, signed date will be null here
select wf_approval_item_key
into l_itemKey
from pon_auction_headers_all
where auction_header_id = p_auction_header_id;
select document_number
into x_amend_doc_number
from pon_auction_headers_all
where
auction_header_id = p_auction_header_id;
select wf_approval_item_key
into l_itemKey
from pon_auction_headers_all
where auction_header_id = p_auction_header_id;
select nvl(cancel_amendment,'N')
into resultout
from pon_auction_headers_all
where
auction_header_id = l_auction_header_id;
PON_NEG_UPDATE_PKG.CANCEL_FEDERAL_NEGOTIATION(l_auction_header_id,
'Y',
l_cancel_note_to_supplier,
fnd_global.user_id,
l_document_number,
l_error_code);
select pon1.auction_header_id,pon1.document_number,pon1.revision
into l_auction_id_prev_doc,l_document_number,l_revision
from pon_auction_headers_all pon1
where
pon1.auction_header_id = (select pon2.auction_header_id_prev_amend
from pon_auction_headers_all pon2
where pon2.auction_header_id = l_auction_header_id);
select wf_approval_item_key
into l_itemKey
from pon_auction_headers_all
where auction_header_id = p_auction_header_id;
select document_number
into x_amend_doc_number
from pon_auction_headers_all
where
auction_header_id = p_auction_header_id;