The following lines contain the word 'select', 'insert', 'update' or 'delete':
-- inserting the record into pa_events.
If (p_event_in_rec.P_event_number Is NULL
OR p_event_in_rec.P_event_number = PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM)
Then
--generating event number for project level events
If (P_task_id Is NULL)
Then
SELECT NVL(max(event_num),0)+1
INTO P_event_in_rec.p_event_number
FROM pa_events e
WHERE e.project_id = P_project_id
AND e.task_id IS NULL;
SELECT NVL(max(event_num),0)+1
INTO P_event_in_rec.p_event_number
FROM pa_events e
WHERE e.project_id =P_project_id
AND e.task_id = P_task_id;
SELECT conversion_type
INTO l_funding_rate_type
FROM pa_conversion_types_v
WHERE user_conversion_type = p_event_in_rec.p_funding_rate_type
or conversion_type = p_event_in_rec.p_funding_rate_type;
SELECT conversion_type
INTO l_projfunc_bil_rate_type
FROM pa_conversion_types_v
WHERE user_conversion_type = p_event_in_rec.p_projfunc_rate_type
or conversion_type = p_event_in_rec.p_projfunc_rate_type;
SELECT conversion_type
INTO l_project_bil_rate_type
FROM pa_conversion_types_v
WHERE user_conversion_type = p_event_in_rec.p_project_rate_type
or conversion_type = p_event_in_rec.p_project_rate_type;
,x_msg => 'Beginning Insert event. '
,x_log_level => 5);
SELECT conversion_type
INTO l_funding_rate_type
FROM pa_conversion_types_v
WHERE user_conversion_type = p_event_in_rec.p_funding_rate_type
or conversion_type = p_event_in_rec.p_funding_rate_type;
SELECT conversion_type
INTO l_projfunc_bil_rate_type
FROM pa_conversion_types_v
WHERE user_conversion_type = p_event_in_rec.p_projfunc_rate_type
or conversion_type = p_event_in_rec.p_projfunc_rate_type;
SELECT conversion_type
INTO l_project_bil_rate_type
FROM pa_conversion_types_v
WHERE user_conversion_type = p_event_in_rec.p_project_rate_type
or conversion_type = p_event_in_rec.p_project_rate_type;
--Call to table handler to insert the events into the database
--Calling PA_EVENTS_PKG.
PA_EVENTS_PKG.Insert_Row
(X_Rowid =>rowid
,X_Event_Id =>p_event_in_rec.p_event_id
,X_product_code =>p_pm_product_code
,X_event_reference =>p_event_in_rec.p_pm_event_reference
,X_Task_Id =>P_task_id
,X_Event_Num =>p_event_in_rec.p_event_number
,X_Last_Update_Date =>SYSDATE
,X_Last_Updated_By =>G_USER_ID
,X_Creation_Date =>SYSDATE
,X_Created_By =>G_USER_ID
,X_Last_Update_Login =>G_LOGIN_ID
,X_Event_Type =>p_event_in_rec.P_event_type
,X_Description =>p_event_in_rec.P_description
,X_Bill_Amount =>0
,X_Revenue_Amount =>0
,X_Revenue_Distributed_Flag =>'N'
,X_Bill_Hold_Flag =>p_event_in_rec.P_bill_hold_flag
,X_Completion_date =>p_event_in_rec.P_completion_date
,X_Rev_Dist_Rejection_Code =>NULL
,X_Attribute_Category =>p_event_in_rec.P_attribute_category
,X_Attribute1 =>p_event_in_rec.P_attribute1
,X_Attribute2 =>p_event_in_rec.P_attribute2
,X_Attribute3 =>p_event_in_rec.P_attribute3
,X_Attribute4 =>p_event_in_rec.P_attribute4
,X_Attribute5 =>p_event_in_rec.P_attribute5
,X_Attribute6 =>p_event_in_rec.P_attribute6
,X_Attribute7 =>p_event_in_rec.P_attribute7
,X_Attribute8 =>p_event_in_rec.P_attribute8
,X_Attribute9 =>p_event_in_rec.P_attribute9
,X_Attribute10 =>p_event_in_rec.P_attribute10
,X_Project_Id =>P_project_id
,X_Organization_Id =>P_Organization_Id
,X_Billing_Assignment_Id =>NULL
,X_Event_Num_Reversed =>NULL
,X_Calling_Place =>NULL
,X_Calling_Process =>NULL
,X_Bill_Trans_Currency_Code =>p_event_in_rec.P_bill_trans_currency_code
,X_Bill_Trans_Bill_Amount =>p_event_in_rec.P_bill_trans_bill_amount
,X_Bill_Trans_rev_Amount =>p_event_in_rec.P_bill_trans_rev_amount
,X_Project_Currency_Code =>l_project_currency_code
,X_Project_Rate_Type =>p_event_in_rec.P_project_rate_type
,X_Project_Rate_Date =>p_event_in_rec.P_project_rate_date
,X_Project_Exchange_Rate =>p_event_in_rec.P_project_exchange_rate
,X_Project_Inv_Rate_Date =>NULL
,X_Project_Inv_Exchange_Rate =>NULL
,X_Project_Bill_Amount =>NULL
,X_Project_Rev_Rate_date =>NULL
,X_Project_Rev_Exchange_Rate =>NULL
,X_Project_Revenue_Amount =>NULL
,X_ProjFunc_Currency_Code =>l_projfunc_currency_code
,X_ProjFunc_Rate_Type =>p_event_in_rec.P_projfunc_rate_type
,X_ProjFunc_Rate_date =>p_event_in_rec.P_projfunc_rate_date
,X_ProjFunc_Exchange_Rate =>p_event_in_rec.P_projfunc_exchange_rate
,X_ProjFunc_Inv_Rate_date =>NULL
,X_ProjFunc_Inv_Exchange_Rate =>NULL
,X_ProjFunc_Bill_Amount =>NULL
,X_ProjFunc_Rev_Rate_date =>NULL
,X_Projfunc_Rev_Exchange_Rate =>NULL
,X_ProjFunc_Revenue_Amount =>NULL
,X_Funding_Rate_Type =>p_event_in_rec.P_funding_rate_type
,X_Funding_Rate_date =>p_event_in_rec.P_funding_rate_date
,X_Funding_Exchange_Rate =>p_event_in_rec.P_funding_exchange_rate
,X_Invproc_Currency_Code =>l_invproc_currency_code
,X_Invproc_Rate_Type =>l_invproc_rate_type
,X_Invproc_Rate_date =>l_invproc_rate_date
,X_Invproc_Exchange_Rate =>l_invproc_exchange_rate
,X_Revproc_Currency_Code =>l_revproc_currency_code
,X_Revproc_Rate_Type =>l_revproc_rate_type
,X_Revproc_Rate_date =>l_revproc_rate_date
,X_Revproc_Exchange_Rate =>l_revproc_exchange_rate
,X_Inv_Gen_Rejection_Code =>NULL
,X_Adjusting_Revenue_Flag =>p_event_in_rec.P_adjusting_revenue_flag
,X_inventory_org_id =>p_inv_org_id
,X_inventory_item_id =>p_event_in_rec.P_inventory_item_id
,X_quantity_billed =>p_event_in_rec.P_quantity_billed
,X_uom_code =>p_event_in_rec.P_uom_code
,X_unit_price =>p_event_in_rec.P_unit_price
,X_reference1 =>p_event_in_rec.P_reference1
,X_reference2 =>p_event_in_rec.P_reference2
,X_reference3 =>p_event_in_rec.P_reference3
,X_reference4 =>p_event_in_rec.P_reference4
,X_reference5 =>p_event_in_rec.P_reference5
,X_reference6 =>p_event_in_rec.P_reference6
,X_reference7 =>p_event_in_rec.P_reference7
,X_reference8 =>p_event_in_rec.P_reference8
,X_reference9 =>p_event_in_rec.P_reference9
,X_reference10 =>p_event_in_rec.P_reference10
,X_Deliverable_Id =>p_event_in_rec.P_deliverable_id
,X_Action_Id =>p_event_in_rec.P_action_id
,X_Record_Version_Number => 1
,X_Agreement_Id =>p_agreement_id); -- Fedral Uptake
PROCEDURE UPDATE_EVENT
( p_api_version_number IN NUMBER
,p_commit IN VARCHAR2
,p_init_msg_list IN VARCHAR2
,p_pm_product_code IN VARCHAR2
,p_event_in_tbl IN Event_In_Tbl_Type
,p_event_out_tbl OUT NOCOPY Event_Out_Tbl_Type --File.Sql.39 bug 4440895
,p_msg_count OUT NOCOPY NUMBER --File.Sql.39 bug 4440895
,p_msg_data OUT NOCOPY VARCHAR2 --File.Sql.39 bug 4440895
,p_return_status OUT NOCOPY VARCHAR2) --File.Sql.39 bug 4440895
AS
Cursor chk_proj_curs(P_project_number VARCHAR2)
Is
Select project_id
From pa_projects_all
Where segment1 = P_project_number;
p_api_name VARCHAR2(100):='UPDATE_EVENT';
pa_debug.set_err_stack('PA_EVENT_PUB.UPDATE_EVENT');
pa_debug.write_log (x_module => 'pa.plsql.PA_EVENT_PUB.UPDATE_EVENT.begin'
,x_msg => 'Beginning of Update Event'
,x_log_level => 5);
pa_debug.write_log (x_module => 'pa.plsql.PA_EVENT_PUB.UPDATE_EVENT.begin'
,x_msg => 'Calling mandatory input parameters-1'
,x_log_level => 5);
,p_function_name =>'PA_EV_UPDATE_EVENT'
,x_return_status =>p_return_status
,x_msg_count =>p_msg_count
,x_msg_data =>p_msg_data );
Savepoint Update_event;
pa_debug.write_log (x_module => 'pa.plsql.PA_EVENT_PUB.UPDATE_EVENT.begin'
,x_msg => ' Calling mandatory input parameters-2'
,x_log_level => 5);
,p_calling_place => 'UPDATE_EVENT'
,x_return_status => p_return_status );
pa_debug.write_log (x_module => 'pa.plsql.PA_EVENT_PUB.UPDATE_EVENT.begin'
,x_msg => 'Calling conv_event_ref_to_id'
,x_log_level => 5);
Select project_id, record_version_number
Into P_project_id, p_event_in_rec.P_record_version_number
From pa_events
Where event_id = p_event_in_rec.P_event_id;
pa_debug.write_log (x_module =>'pa.plsql.PA_EVENT_PUB.UPDATE_EVENT.begin'
,x_msg =>'Defaulting currency from pa_events for the given event'
,x_log_level =>5);
--Select default currency from pa_events for the given event
--And use those for validations if the currency fields are not
--overwritten by the new changes.
Select ev.Project_currency_code
,ev.ProjFunc_Inv_Rate_date
,ev.Project_Inv_Exchange_Rate
,ev.Project_Bill_Amount
,ev.Project_Rev_Rate_date
,ev.Project_Rev_Exchange_Rate
,ev.Project_Revenue_Amount
,ev.Project_Rate_type
,ev.Project_Rate_date
,ev.Project_Exchange_rate
,ev.ProjFunc_Currency_Code
,ev.ProjFunc_Inv_Rate_date
,ev.ProjFunc_Inv_Exchange_Rate
,ev.ProjFunc_Bill_Amount
,ev.ProjFunc_Rev_Rate_date
,ev.Projfunc_Rev_Exchange_Rate
,ev.ProjFunc_Revenue_Amount
,ev.ProjFunc_Rate_type
,ev.ProjFunc_Rate_date
,ev.ProjFunc_Exchange_rate
,ev.Invproc_Currency_Code
,ev.Invproc_Rate_Type
,ev.Invproc_Rate_date
,ev.Invproc_Exchange_Rate
,ev.Revproc_Currency_Code
,ev.Revproc_Rate_Type
,ev.Revproc_Rate_date
,ev.revproc_exchange_rate
,ev.Inv_Gen_Rejection_Code
,ev.Funding_Rate_type
,ev.Funding_Rate_date
,ev.Funding_Exchange_rate
,ev.Bill_trans_currency_code
Into l_project_currency_code
,l_ProjFunc_Inv_Rate_date
,l_Project_Inv_Exchange_Rate
,l_Project_Bill_Amount
,l_Project_Rev_Rate_date
,l_Project_Rev_Exchange_Rate
,l_Project_Revenue_Amount
,l_project_bil_rate_type
,l_project_bil_rate_date
,l_project_bil_exchange_rate
,l_ProjFunc_Currency_Code
,l_ProjFunc_Inv_Rate_date
,l_ProjFunc_Inv_Exchange_Rate
,l_ProjFunc_Bill_Amount
,l_ProjFunc_Rev_Rate_date
,l_Projfunc_Rev_Exchange_Rate
,l_ProjFunc_Revenue_Amount
,l_projfunc_bil_rate_type
,l_projfunc_bil_rate_date
,l_projfunc_bil_exchange_rate
,l_Invproc_Currency_Code
,l_Invproc_Rate_Type
,l_Invproc_Rate_date
,l_Invproc_Exchange_Rate
,l_Revproc_Currency_Code
,l_Revproc_Rate_Type
,l_Revproc_Rate_date
,l_revproc_exchange_rate
,l_Inv_Gen_Rejection_Code
,l_funding_rate_type
,l_funding_rate_date
,l_funding_exchange_rate
,l_bill_trans_curr_code
From pa_events ev
Where event_id=p_event_in_rec.p_event_id;
Select multi_currency_billing_flag
,funding_rate_date_code
,project_bil_rate_date_code
,projfunc_bil_rate_date_code
Into l_multi_currency_billing_flag
,l_funding_rate_date_code
,l_project_bil_rate_date_code
,l_projfunc_bil_rate_date_code
From pa_projects_all
Where project_id=P_project_id;
pa_debug.write_log (x_module => 'pa.plsql.PA_EVENT_PUB.UPDATE_EVENT.begin'
,x_msg => 'Calling check_update_event_ok'
,x_log_level => 5);
-- Calls check_update_event_ok function
If PA_EVENT_PVT.check_update_event_ok
(P_pm_product_code =>p_pm_product_code
,P_event_in_rec =>p_event_in_rec
,P_project_currency_code =>l_project_currency_code
,P_proj_func_currency_code =>l_projfunc_currency_code
,P_project_bil_rate_date_code =>l_project_bil_rate_date_code
,P_project_rate_type =>l_project_bil_rate_type
,p_project_bil_rate_date =>l_project_bil_rate_date
,p_projfunc_bil_rate_date_code =>l_projfunc_bil_rate_date_code
,P_projfunc_rate_type =>l_projfunc_bil_rate_type
,p_projfunc_bil_rate_date =>l_projfunc_bil_rate_date
,P_funding_rate_type =>l_funding_rate_type
,P_multi_currency_billing_flag =>l_multi_currency_billing_flag
,P_event_type_classification =>l_event_type_classification
,P_event_processed =>l_event_processed /* Added for bug Bug 7110782 */
,p_project_id =>p_project_id
,p_projfunc_bil_exchange_rate =>l_projfunc_bil_exchange_rate -- Added for bug 3013137
,p_funding_bill_rate_date_code =>l_funding_rate_date_code --Added for bug 3053190
,x_task_id =>p_task_id
,x_organization_id =>p_organization_id
,x_inv_org_id =>p_inv_org_id
,x_agreement_id =>P_agreement_id -- Federal Uptake
) = 'N'
Then
p_return_status := FND_API.G_RET_STS_ERROR;
pa_debug.write_log (x_module => 'pa.plsql.PA_EVENT_PUB.UPDATE_EVENT.begin'
,x_msg => 'Beginning Validate Flexfields'
,x_log_level => 5);
Select decode(p_event_in_rec.P_attribute_category
,NULL,attribute_category
,PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,NULL
,p_event_in_rec.P_attribute_category)
,decode(p_event_in_rec.P_attribute1
,NULL,attribute1
,PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,NULL
,p_event_in_rec.P_attribute1)
,decode(p_event_in_rec.P_attribute2
,NULL,attribute2
,PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,NULL
,p_event_in_rec.P_attribute2)
,decode(p_event_in_rec.P_attribute3
,NULL,attribute3
,PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,NULL
,p_event_in_rec.P_attribute3)
,decode(p_event_in_rec.P_attribute4
,NULL,attribute4
,PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,NULL
,p_event_in_rec.P_attribute4 )
,decode(p_event_in_rec.P_attribute5
,NULL,attribute5
,PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,NULL
,p_event_in_rec.P_attribute5 )
,decode(p_event_in_rec.P_attribute6
,NULL,attribute6
,PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,NULL
,p_event_in_rec.P_attribute6 )
,decode(p_event_in_rec.P_attribute7
,NULL,attribute7
,PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,NULL
,p_event_in_rec.P_attribute7 )
,decode(p_event_in_rec.P_attribute8
,NULL,attribute8
,PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,NULL
,p_event_in_rec.P_attribute8 )
,decode(p_event_in_rec.P_attribute9
,NULL,attribute9
,PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,NULL
,p_event_in_rec.P_attribute9 )
,decode(p_event_in_rec.P_attribute10
,NULL,attribute10
,PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,NULL
,p_event_in_rec.P_attribute10 )
Into p_event_in_rec.P_attribute_category
,p_event_in_rec.P_attribute1
,p_event_in_rec.P_attribute2
,p_event_in_rec.P_attribute3
,p_event_in_rec.P_attribute4
,p_event_in_rec.P_attribute5
,p_event_in_rec.P_attribute6
,p_event_in_rec.P_attribute7
,p_event_in_rec.P_attribute8
,p_event_in_rec.P_attribute9
,p_event_in_rec.P_attribute10
From pa_events
Where event_id=p_event_in_rec.P_event_id;
pa_debug.write_log (x_module => 'pa.plsql.PA_EVENT_PUB.UPDATE_EVENT.begin'
,x_msg => 'Beginning defaulting mcb parameters'
,x_log_level => 5);
pa_debug.write_log (x_module => 'pa.plsql.PA_EVENT_PUB.UPDATE_EVENT.begin'
,x_msg => 'Beginning defaulting parameters before updating table'
,x_log_level => 5);
--before inserting the record into pa_events.
If (p_event_in_rec.P_event_number Is NULL
OR p_event_in_rec.P_event_number = PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM)
Then
SELECT task_id
INTO l_task_id
FROM pa_events e
Where event_id=p_event_in_rec.P_event_id;
--Validating if the existing task_id matches with the updated task_id
--In case of any mismatch new event_number is generated before updating the record.
If p_event_in_rec.p_task_number is NOT NULL
Then
If (nvl(P_task_id,-1) <> nvl(l_task_id,-1))
Then
--generating event number for project level events
If (P_task_id Is NULL )
Then
SELECT NVL(max(event_num),0)+1
INTO P_event_in_rec.p_event_number
FROM pa_events e
WHERE e.project_id = P_project_id
AND e.task_id IS NULL;
SELECT NVL(max(event_num),0)+1
INTO P_event_in_rec.p_event_number
FROM pa_events e
WHERE e.project_id =P_project_id
AND e.task_id = P_task_id;
SELECT event_num
INTO P_event_in_rec.p_event_number
FROM pa_events e
Where event_id=p_event_in_rec.P_event_id;
SELECT event_num
INTO P_event_in_rec.p_event_number
FROM pa_events e
Where event_id=p_event_in_rec.P_event_id;
Select Rowid
Into rowid
From pa_events
Where event_id=p_event_in_rec.p_event_id;
Select decode(p_event_in_rec.P_bill_hold_flag
,NULL,BILL_HOLD_FLAG
,PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,NULL
,p_event_in_rec.P_bill_hold_flag)
,decode(p_event_in_rec.P_adjusting_revenue_flag
,NULL,ADJUSTING_REVENUE_FLAG
,PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,NULL
,p_event_in_rec.P_adjusting_revenue_flag)
--Defaulting inventory org id and item ids
,decode(p_event_in_rec.P_inventory_org_name
,NULL,inventory_org_id
,PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,NULL
,p_inv_org_id)
,decode(p_event_in_rec.P_inventory_item_id
,NULL,inventory_item_id
,PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,NULL
,p_event_in_rec.P_inventory_item_id)
--Defaulting organization id.
,decode(p_event_in_rec.P_organization_name
,NULL,organization_id
,PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,organization_id
,p_organization_id)
--Defaulting OKE related fields.
,decode(p_event_in_rec.P_quantity_billed
,NULL,quantity_billed
,PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM,NULL
,p_event_in_rec.P_quantity_billed)
,decode(p_event_in_rec.P_uom_code
,NULL,uom_code
,PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,NULL
,p_event_in_rec.P_uom_code)
,decode(p_event_in_rec.P_unit_price
,NULL,unit_price
,PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,NULL
,p_event_in_rec.P_unit_price)
--Defaulting references.
,decode(p_event_in_rec.P_reference1
,NULL,reference1
,PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,NULL
,p_event_in_rec.P_reference1)
,decode(p_event_in_rec.P_reference2
,NULL,reference2
,PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,NULL
,p_event_in_rec.P_reference2)
,decode(p_event_in_rec.P_reference3
,NULL,reference3
,PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,NULL
,p_event_in_rec.P_reference3)
,decode(p_event_in_rec.P_reference4
,NULL,reference4
,PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,NULL
,p_event_in_rec.P_reference4 )
,decode(p_event_in_rec.P_reference5
,NULL,reference5
,PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,NULL
,p_event_in_rec.P_reference5 )
,decode(p_event_in_rec.P_reference6
,NULL,reference6
,PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,NULL
,p_event_in_rec.P_reference6 )
,decode(p_event_in_rec.P_reference7
,NULL,reference7
,PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,NULL
,p_event_in_rec.P_reference7 )
,decode(p_event_in_rec.P_reference8
,NULL,reference8
,PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,NULL
,p_event_in_rec.P_reference8 )
,decode(p_event_in_rec.P_reference9
,NULL,reference9
,PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,NULL
,p_event_in_rec.P_reference9 )
,decode(p_event_in_rec.P_reference10
,NULL,reference10
,PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,NULL
,p_event_in_rec.P_reference10 )
--defaulting completion date
,decode(p_event_in_rec.P_completion_date
,NULL,completion_date
,PA_INTERFACE_UTILS_PUB.G_PA_MISS_DATE,SYSDATE
,p_event_in_rec.P_completion_date)
--Defaulting event type.
,decode(p_event_in_rec.P_event_type
,NULL,event_type
,PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,event_type
,p_event_in_rec.P_event_type)
--Defaulting bill trans revenue and bill trans bill amounts
,decode(p_event_in_rec.P_bill_trans_rev_amount
,NULL,bill_trans_rev_amount
,p_event_in_rec.P_bill_trans_rev_amount)
,decode(p_event_in_rec.P_bill_trans_bill_amount
,NULL,bill_trans_bill_amount
,p_event_in_rec.P_bill_trans_bill_amount)
--Defaulting task_id.
,decode(p_event_in_rec.p_task_number
,NULL,task_id
,PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR,NULL
,P_task_id)
,decode(p_event_in_rec.p_description, null, description,
PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR, description, p_event_in_rec.p_description)
,record_version_number
,decode(ADJUSTING_REVENUE_FLAG,'N', /* Added for bug 6863270 */
decode(p_event_in_rec.p_bill_trans_bill_amount, PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM, bill_trans_bill_amount,
null, bill_trans_bill_amount, p_event_in_rec.p_bill_trans_bill_amount),0)
,decode(p_event_in_rec.p_bill_trans_rev_amount, PA_INTERFACE_UTILS_PUB.G_PA_MISS_NUM, bill_trans_rev_amount,
null, bill_trans_rev_amount, p_event_in_rec.p_bill_trans_rev_amount)
Into p_event_in_rec.P_bill_hold_flag
,p_event_in_rec.P_adjusting_revenue_flag
,p_inv_org_id
,p_event_in_rec.P_inventory_item_id
,P_organization_id
,p_event_in_rec.P_quantity_billed
,p_event_in_rec.P_uom_code
,p_event_in_rec.P_unit_price
,p_event_in_rec.P_reference1
,p_event_in_rec.P_reference2
,p_event_in_rec.P_reference3
,p_event_in_rec.P_reference4
,p_event_in_rec.P_reference5
,p_event_in_rec.P_reference6
,p_event_in_rec.P_reference7
,p_event_in_rec.P_reference8
,p_event_in_rec.P_reference9
,p_event_in_rec.P_reference10
,p_event_in_rec.P_completion_date
,p_event_in_rec.P_event_type
,p_event_in_rec.P_bill_trans_rev_amount
,p_event_in_rec.P_bill_trans_bill_amount
,P_task_id
,p_event_in_rec.P_description
,l_record_version_number
,l_bill_trans_bill_amt /* Added for bug 4093948 */
,l_bill_trans_rev_amt /* Added for bug 4093948 */
From pa_events
Where event_id=p_event_in_rec.P_event_id;
--Unless the user updates with a valid description the
--description gets defaulted with the event type.
If (p_event_in_rec.P_description Is NULL
OR p_event_in_rec.P_description = PA_INTERFACE_UTILS_PUB.G_PA_MISS_CHAR)
Then
p_event_in_rec.P_description := p_event_in_rec.P_event_type;
pa_debug.write_log (x_module => 'pa.plsql.PA_EVENT_PUB.UPDATE_EVENT.begin'
,x_msg => 'Begin Updating event. '
,x_log_level => 5);
SELECT conversion_type
INTO l_funding_rate_type
FROM pa_conversion_types_v
WHERE user_conversion_type = p_event_in_rec.p_funding_rate_type
or conversion_type = p_event_in_rec.p_funding_rate_type;
SELECT conversion_type
INTO l_projfunc_bil_rate_type
FROM pa_conversion_types_v
WHERE user_conversion_type = p_event_in_rec.p_projfunc_rate_type
or conversion_type = p_event_in_rec.p_projfunc_rate_type;
SELECT conversion_type
INTO l_project_bil_rate_type
FROM pa_conversion_types_v
WHERE user_conversion_type = p_event_in_rec.p_project_rate_type
or conversion_type = p_event_in_rec.p_project_rate_type;
SELECT ev.Task_Id
,ev.Event_Num
,ev.Event_Type
,ev.Bill_Amount
,ev.Revenue_Amount
,ev.Revenue_Distributed_Flag
,ev.Bill_Hold_Flag
,ev.Completion_date
,Rev_Dist_Rejection_Code
,ev.Attribute_Category
,ev.Attribute1
,ev.Attribute2
,ev.Attribute3
,ev.Attribute4
,ev.Attribute5
,ev.Attribute6
,ev.Attribute7
,ev.Attribute8
,ev.Attribute9
,ev.Attribute10
,ev.Project_Id
,ev.Organization_Id
,ev.Billing_Assignment_Id
,ev.Event_Num_Reversed
,ev.Calling_Place
,ev.Calling_Process
,ev.Bill_Trans_Currency_Code
,ev.Bill_Trans_Bill_Amount
,ev.Project_Currency_Code
,ev.Project_Rate_Type
,ev.Project_Rate_Date
,ev.Project_Exchange_Rate
,ev.Project_Inv_Rate_Date
,ev.Project_Inv_Exchange_Rate
,ev.Project_Bill_Amount
,ev.Project_Rev_Rate_date
,ev.Project_Rev_Exchange_Rate
,ev.Project_Revenue_Amount
,ev.ProjFunc_Currency_Code
,ev.ProjFunc_Rate_Type
,ev.ProjFunc_Rate_date
,ev.ProjFunc_Exchange_Rate
,ev.ProjFunc_Inv_Rate_date
,ev.ProjFunc_Inv_Exchange_Rate
,ev.ProjFunc_Bill_Amount
,ev.ProjFunc_Rev_Rate_date
,ev.Projfunc_Rev_Exchange_Rate
,ev.ProjFunc_Revenue_Amount
,ev.Funding_Rate_Type
,ev.Funding_Rate_date
,ev.Funding_Exchange_Rate
,ev.Invproc_Currency_Code
,ev.Invproc_Rate_Type
,ev.Invproc_Rate_date
,ev.Invproc_Exchange_Rate
,ev.Revproc_Currency_Code
,ev.Revproc_Rate_Type
,ev.Revproc_Rate_date
,ev.Revproc_Exchange_Rate
,ev.Inv_Gen_Rejection_Code
,ev.Adjusting_Revenue_Flag
,ev.inventory_org_id
,ev.inventory_item_id
,ev.quantity_billed
,ev.uom_code
,ev.unit_price
,ev.reference1
,ev.reference2
,ev.reference3
,ev.reference4
,ev.reference5
,ev.reference6
,ev.reference7
,ev.reference8
,ev.reference9
,ev.reference10
,ev.agreement_id
INTO p_task_id
,p_event_in_rec.p_event_number
,p_event_in_rec.P_event_type
,l_bill_amount
,l_revenue_amount
,l_revenue_distributed_flag
,p_event_in_rec.P_bill_hold_flag
,p_event_in_rec.P_completion_date
,l_rev_dist_rejection_code
,p_event_in_rec.P_attribute_category
,p_event_in_rec.P_attribute1
,p_event_in_rec.P_attribute2
,p_event_in_rec.P_attribute3
,p_event_in_rec.P_attribute4
,p_event_in_rec.P_attribute5
,p_event_in_rec.P_attribute6
,p_event_in_rec.P_attribute7
,p_event_in_rec.P_attribute8
,p_event_in_rec.P_attribute9
,p_event_in_rec.P_attribute10
,P_project_id
,P_Organization_Id
,l_Billing_Assignment_Id
,l_Event_Num_Reversed
,l_Calling_Place
,l_Calling_Process
,p_event_in_rec.P_bill_trans_currency_code
,l_Bill_Trans_Bill_Amt
,l_project_currency_code
,p_event_in_rec.P_project_rate_type
,p_event_in_rec.P_project_rate_date
,p_event_in_rec.P_project_exchange_rate
,l_ProjFunc_Inv_Rate_date
,l_Project_Inv_Exchange_Rate
,l_Project_Bill_Amount
,l_Project_Rev_Rate_date
,l_Project_Rev_Exchange_Rate
,l_Project_Revenue_Amount
,l_ProjFunc_Currency_Code
,p_event_in_rec.P_projfunc_rate_type
,p_event_in_rec.P_projfunc_rate_date
,p_event_in_rec.P_projfunc_exchange_rate
,l_ProjFunc_Inv_Rate_date
,l_ProjFunc_Inv_Exchange_Rate
,l_ProjFunc_Bill_Amount
,l_ProjFunc_Rev_Rate_date
,l_Projfunc_Rev_Exchange_Rate
,l_ProjFunc_Revenue_Amount
,p_event_in_rec.P_funding_rate_type
,p_event_in_rec.P_funding_rate_date
,p_event_in_rec.P_funding_exchange_rate
,l_Invproc_Currency_Code
,l_Invproc_Rate_Type
,l_Invproc_Rate_date
,l_Invproc_Exchange_Rate
,l_Revproc_Currency_Code
,l_Revproc_Rate_Type
,l_Revproc_Rate_date
,l_revproc_exchange_rate
,l_Inv_Gen_Rejection_Code
,p_event_in_rec.P_adjusting_revenue_flag
,p_inv_org_id
,p_event_in_rec.P_inventory_item_id
,p_event_in_rec.P_quantity_billed
,p_event_in_rec.P_uom_code
,p_event_in_rec.P_unit_price
,p_event_in_rec.P_reference1
,p_event_in_rec.P_reference2
,p_event_in_rec.P_reference3
,p_event_in_rec.P_reference4
,p_event_in_rec.P_reference5
,p_event_in_rec.P_reference6
,p_event_in_rec.P_reference7
,p_event_in_rec.P_reference8
,p_event_in_rec.P_reference9
,p_event_in_rec.P_reference10
,P_agreement_id
FROM pa_events ev
WHERE event_id = p_event_in_rec.p_event_id;
PA_EVENTS_PKG.Update_Row
(X_Rowid =>Rowid
,X_Event_Id =>p_event_in_rec.P_event_id
,X_Task_Id =>p_task_id
,X_Event_Num =>p_event_in_rec.p_event_number
,X_Last_Update_Date =>SYSDATE
,X_Last_Updated_By =>G_USER_ID
,X_Last_Update_Login =>G_LOGIN_ID
,X_Event_Type =>p_event_in_rec.P_event_type
,X_Description =>p_event_in_rec.P_description
,X_Bill_Amount =>0
,X_Revenue_Amount =>0
,X_Revenue_Distributed_Flag =>'N'
,X_Bill_Hold_Flag =>p_event_in_rec.P_bill_hold_flag
,X_Completion_date =>p_event_in_rec.P_completion_date
,X_Rev_Dist_Rejection_Code =>NULL
,X_Attribute_Category =>p_event_in_rec.P_attribute_category
,X_Attribute1 =>p_event_in_rec.P_attribute1
,X_Attribute2 =>p_event_in_rec.P_attribute2
,X_Attribute3 =>p_event_in_rec.P_attribute3
,X_Attribute4 =>p_event_in_rec.P_attribute4
,X_Attribute5 =>p_event_in_rec.P_attribute5
,X_Attribute6 =>p_event_in_rec.P_attribute6
,X_Attribute7 =>p_event_in_rec.P_attribute7
,X_Attribute8 =>p_event_in_rec.P_attribute8
,X_Attribute9 =>p_event_in_rec.P_attribute9
,X_Attribute10 =>p_event_in_rec.P_attribute10
,X_Project_Id =>P_project_id
,X_Organization_Id =>P_Organization_Id
,X_Billing_Assignment_Id =>NULL
,X_Event_Num_Reversed =>NULL
,X_Calling_Place =>NULL
,X_Calling_Process =>NULL
,X_Bill_Trans_Currency_Code =>p_event_in_rec.P_bill_trans_currency_code
,X_Bill_Trans_Bill_Amount =>l_Bill_Trans_Bill_Amt
,X_Bill_Trans_rev_Amount =>l_Bill_Trans_rev_Amt
,X_Project_Currency_Code =>l_project_currency_code
,X_Project_Rate_Type =>p_event_in_rec.P_project_rate_type
,X_Project_Rate_Date =>p_event_in_rec.P_project_rate_date
,X_Project_Exchange_Rate =>p_event_in_rec.P_project_exchange_rate
,X_Project_Inv_Rate_Date =>l_ProjFunc_Inv_Rate_date
,X_Project_Inv_Exchange_Rate =>l_Project_Inv_Exchange_Rate
,X_Project_Bill_Amount =>l_Project_Bill_Amount
,X_Project_Rev_Rate_date =>l_Project_Rev_Rate_date
,X_Project_Rev_Exchange_Rate =>l_Project_Rev_Exchange_Rate
,X_Project_Revenue_Amount =>l_Project_Revenue_Amount
,X_ProjFunc_Currency_Code =>l_ProjFunc_Currency_Code
,X_ProjFunc_Rate_Type =>p_event_in_rec.P_projfunc_rate_type
,X_ProjFunc_Rate_date =>p_event_in_rec.P_projfunc_rate_date
,X_ProjFunc_Exchange_Rate =>p_event_in_rec.P_projfunc_exchange_rate
,X_ProjFunc_Inv_Rate_date =>l_ProjFunc_Inv_Rate_date
,X_ProjFunc_Inv_Exchange_Rate =>l_ProjFunc_Inv_Exchange_Rate
,X_ProjFunc_Bill_Amount =>l_ProjFunc_Bill_Amount
,X_ProjFunc_Rev_Rate_date =>l_ProjFunc_Rev_Rate_date
,X_Projfunc_Rev_Exchange_Rate =>l_Projfunc_Rev_Exchange_Rate
,X_ProjFunc_Revenue_Amount =>l_ProjFunc_Revenue_Amount
,X_Funding_Rate_Type =>p_event_in_rec.P_funding_rate_type
,X_Funding_Rate_date =>p_event_in_rec.P_funding_rate_date
,X_Funding_Exchange_Rate =>p_event_in_rec.P_funding_exchange_rate
,X_Invproc_Currency_Code =>l_Invproc_Currency_Code
,X_Invproc_Rate_Type =>l_Invproc_Rate_Type
,X_Invproc_Rate_date =>l_Invproc_Rate_date
,X_Invproc_Exchange_Rate =>l_Invproc_Exchange_Rate
,X_Revproc_Currency_Code =>l_Revproc_Currency_Code
,X_Revproc_Rate_Type =>l_Revproc_Rate_Type
,X_Revproc_Rate_date =>l_Revproc_Rate_date
,X_Revproc_Exchange_Rate =>l_revproc_exchange_rate
,X_Inv_Gen_Rejection_Code =>l_Inv_Gen_Rejection_Code
,X_Adjusting_Revenue_Flag =>p_event_in_rec.P_adjusting_revenue_flag
,X_inventory_org_id =>p_inv_org_id
,X_inventory_item_id =>p_event_in_rec.P_inventory_item_id
,X_quantity_billed =>p_event_in_rec.P_quantity_billed
,X_uom_code =>p_event_in_rec.P_uom_code
,X_unit_price =>p_event_in_rec.P_unit_price
,X_reference1 =>p_event_in_rec.P_reference1
,X_reference2 =>p_event_in_rec.P_reference2
,X_reference3 =>p_event_in_rec.P_reference3
,X_reference4 =>p_event_in_rec.P_reference4
,X_reference5 =>p_event_in_rec.P_reference5
,X_reference6 =>p_event_in_rec.P_reference6
,X_reference7 =>p_event_in_rec.P_reference7
,X_reference8 =>p_event_in_rec.P_reference8
,X_reference9 =>p_event_in_rec.P_reference9
,X_reference10 =>p_event_in_rec.P_reference10
,X_agreement_id =>P_agreement_id );
SELECT ev.Task_Id
,ev.Event_Num
,ev.Event_Type
,ev.Bill_Amount
,ev.Revenue_Amount
,ev.Revenue_Distributed_Flag
,ev.Completion_date
,Rev_Dist_Rejection_Code
,ev.Attribute_Category
,ev.Attribute1
,ev.Attribute2
,ev.Attribute3
,ev.Attribute4
,ev.Attribute5
,ev.Attribute6
,ev.Attribute7
,ev.Attribute8
,ev.Attribute9
,ev.Attribute10
,ev.Project_Id
,ev.Organization_Id
,ev.Billing_Assignment_Id
,ev.Event_Num_Reversed
,ev.Calling_Place
,ev.Calling_Process
,ev.Bill_Trans_Currency_Code
,ev.Bill_Trans_rev_Amount
,ev.Project_Currency_Code
,ev.Project_Rate_Type
,ev.Project_Rate_Date
,ev.Project_Exchange_Rate
,ev.Project_Inv_Rate_Date
,ev.Project_Inv_Exchange_Rate
,ev.Project_Bill_Amount
,ev.Project_Rev_Rate_date
,ev.Project_Rev_Exchange_Rate
,ev.Project_Revenue_Amount
,ev.ProjFunc_Currency_Code
,ev.ProjFunc_Rate_Type
,ev.ProjFunc_Rate_date
,ev.ProjFunc_Exchange_Rate
,ev.ProjFunc_Inv_Rate_date
,ev.ProjFunc_Inv_Exchange_Rate
,ev.ProjFunc_Bill_Amount
,ev.ProjFunc_Rev_Rate_date
,ev.Projfunc_Rev_Exchange_Rate
,ev.ProjFunc_Revenue_Amount
,ev.Funding_Rate_Type
,ev.Funding_Rate_date
,ev.Funding_Exchange_Rate
,ev.Invproc_Currency_Code
,ev.Invproc_Rate_Type
,ev.Invproc_Rate_date
,ev.Invproc_Exchange_Rate
,ev.Revproc_Currency_Code
,ev.Revproc_Rate_Type
,ev.Revproc_Rate_date
,ev.Revproc_Exchange_Rate
,ev.Inv_Gen_Rejection_Code
,ev.Adjusting_Revenue_Flag
,ev.inventory_org_id
,ev.inventory_item_id
,ev.quantity_billed
,ev.uom_code
,ev.unit_price
,ev.reference1
,ev.reference2
,ev.reference3
,ev.reference4
,ev.reference5
,ev.reference6
,ev.reference7
,ev.reference8
,ev.reference9
,ev.reference10
,ev.agreement_id
INTO p_task_id
,p_event_in_rec.p_event_number
,p_event_in_rec.P_event_type
,l_bill_amount
,l_revenue_amount
,l_revenue_distributed_flag
,p_event_in_rec.P_completion_date
,l_rev_dist_rejection_code
,p_event_in_rec.P_attribute_category
,p_event_in_rec.P_attribute1
,p_event_in_rec.P_attribute2
,p_event_in_rec.P_attribute3
,p_event_in_rec.P_attribute4
,p_event_in_rec.P_attribute5
,p_event_in_rec.P_attribute6
,p_event_in_rec.P_attribute7
,p_event_in_rec.P_attribute8
,p_event_in_rec.P_attribute9
,p_event_in_rec.P_attribute10
,P_project_id
,P_Organization_Id
,l_Billing_Assignment_Id
,l_Event_Num_Reversed
,l_Calling_Place
,l_Calling_Process
,p_event_in_rec.P_bill_trans_currency_code
,l_Bill_Trans_rev_Amt
,l_project_currency_code
,p_event_in_rec.P_project_rate_type
,p_event_in_rec.P_project_rate_date
,p_event_in_rec.P_project_exchange_rate
,l_ProjFunc_Inv_Rate_date
,l_Project_Inv_Exchange_Rate
,l_Project_Bill_Amount
,l_Project_Rev_Rate_date
,l_Project_Rev_Exchange_Rate
,l_Project_Revenue_Amount
,l_ProjFunc_Currency_Code
,p_event_in_rec.P_projfunc_rate_type
,p_event_in_rec.P_projfunc_rate_date
,p_event_in_rec.P_projfunc_exchange_rate
,l_ProjFunc_Inv_Rate_date
,l_ProjFunc_Inv_Exchange_Rate
,l_ProjFunc_Bill_Amount
,l_ProjFunc_Rev_Rate_date
,l_Projfunc_Rev_Exchange_Rate
,l_ProjFunc_Revenue_Amount
,p_event_in_rec.P_funding_rate_type
,p_event_in_rec.P_funding_rate_date
,p_event_in_rec.P_funding_exchange_rate
,l_Invproc_Currency_Code
,l_Invproc_Rate_Type
,l_Invproc_Rate_date
,l_Invproc_Exchange_Rate
,l_Revproc_Currency_Code
,l_Revproc_Rate_Type
,l_Revproc_Rate_date
,l_revproc_exchange_rate
,l_Inv_Gen_Rejection_Code
,p_event_in_rec.P_adjusting_revenue_flag
,p_inv_org_id
,p_event_in_rec.P_inventory_item_id
,p_event_in_rec.P_quantity_billed
,p_event_in_rec.P_uom_code
,p_event_in_rec.P_unit_price
,p_event_in_rec.P_reference1
,p_event_in_rec.P_reference2
,p_event_in_rec.P_reference3
,p_event_in_rec.P_reference4
,p_event_in_rec.P_reference5
,p_event_in_rec.P_reference6
,p_event_in_rec.P_reference7
,p_event_in_rec.P_reference8
,p_event_in_rec.P_reference9
,p_event_in_rec.P_reference10
,P_agreement_id
FROM pa_events ev
WHERE event_id = p_event_in_rec.p_event_id;
PA_EVENTS_PKG.Update_Row
(X_Rowid =>Rowid
,X_Event_Id =>p_event_in_rec.P_event_id
,X_Task_Id =>p_task_id
,X_Event_Num =>p_event_in_rec.p_event_number
,X_Last_Update_Date =>SYSDATE
,X_Last_Updated_By =>G_USER_ID
,X_Last_Update_Login =>G_LOGIN_ID
,X_Event_Type =>p_event_in_rec.P_event_type
,X_Description =>p_event_in_rec.P_description
,X_Bill_Amount =>0
,X_Revenue_Amount =>0
,X_Revenue_Distributed_Flag =>'N'
,X_Bill_Hold_Flag =>p_event_in_rec.P_bill_hold_flag
,X_Completion_date =>p_event_in_rec.P_completion_date
,X_Rev_Dist_Rejection_Code =>NULL
,X_Attribute_Category =>p_event_in_rec.P_attribute_category
,X_Attribute1 =>p_event_in_rec.P_attribute1
,X_Attribute2 =>p_event_in_rec.P_attribute2
,X_Attribute3 =>p_event_in_rec.P_attribute3
,X_Attribute4 =>p_event_in_rec.P_attribute4
,X_Attribute5 =>p_event_in_rec.P_attribute5
,X_Attribute6 =>p_event_in_rec.P_attribute6
,X_Attribute7 =>p_event_in_rec.P_attribute7
,X_Attribute8 =>p_event_in_rec.P_attribute8
,X_Attribute9 =>p_event_in_rec.P_attribute9
,X_Attribute10 =>p_event_in_rec.P_attribute10
,X_Project_Id =>P_project_id
,X_Organization_Id =>P_Organization_Id
,X_Billing_Assignment_Id =>NULL
,X_Event_Num_Reversed =>NULL
,X_Calling_Place =>NULL
,X_Calling_Process =>NULL
,X_Bill_Trans_Currency_Code =>p_event_in_rec.P_bill_trans_currency_code
,X_Bill_Trans_Bill_Amount =>l_Bill_Trans_Bill_Amt
,X_Bill_Trans_rev_Amount =>l_Bill_Trans_rev_Amt
,X_Project_Currency_Code =>l_project_currency_code
,X_Project_Rate_Type =>p_event_in_rec.P_project_rate_type
,X_Project_Rate_Date =>p_event_in_rec.P_project_rate_date
,X_Project_Exchange_Rate =>p_event_in_rec.P_project_exchange_rate
,X_Project_Inv_Rate_Date =>l_ProjFunc_Inv_Rate_date
,X_Project_Inv_Exchange_Rate =>l_Project_Inv_Exchange_Rate
,X_Project_Bill_Amount =>l_Project_Bill_Amount
,X_Project_Rev_Rate_date =>l_Project_Rev_Rate_date
,X_Project_Rev_Exchange_Rate =>l_Project_Rev_Exchange_Rate
,X_Project_Revenue_Amount =>l_Project_Revenue_Amount
,X_ProjFunc_Currency_Code =>l_ProjFunc_Currency_Code
,X_ProjFunc_Rate_Type =>p_event_in_rec.P_projfunc_rate_type
,X_ProjFunc_Rate_date =>p_event_in_rec.P_projfunc_rate_date
,X_ProjFunc_Exchange_Rate =>p_event_in_rec.P_projfunc_exchange_rate
,X_ProjFunc_Inv_Rate_date =>l_ProjFunc_Inv_Rate_date
,X_ProjFunc_Inv_Exchange_Rate =>l_ProjFunc_Inv_Exchange_Rate
,X_ProjFunc_Bill_Amount =>l_ProjFunc_Bill_Amount
,X_ProjFunc_Rev_Rate_date =>l_ProjFunc_Rev_Rate_date
,X_Projfunc_Rev_Exchange_Rate =>l_Projfunc_Rev_Exchange_Rate
,X_ProjFunc_Revenue_Amount =>l_ProjFunc_Revenue_Amount
,X_Funding_Rate_Type =>p_event_in_rec.P_funding_rate_type
,X_Funding_Rate_date =>p_event_in_rec.P_funding_rate_date
,X_Funding_Exchange_Rate =>p_event_in_rec.P_funding_exchange_rate
,X_Invproc_Currency_Code =>l_Invproc_Currency_Code
,X_Invproc_Rate_Type =>l_Invproc_Rate_Type
,X_Invproc_Rate_date =>l_Invproc_Rate_date
,X_Invproc_Exchange_Rate =>l_Invproc_Exchange_Rate
,X_Revproc_Currency_Code =>l_Revproc_Currency_Code
,X_Revproc_Rate_Type =>l_Revproc_Rate_Type
,X_Revproc_Rate_date =>l_Revproc_Rate_date
,X_Revproc_Exchange_Rate =>l_revproc_exchange_rate
,X_Inv_Gen_Rejection_Code =>l_Inv_Gen_Rejection_Code
,X_Adjusting_Revenue_Flag =>p_event_in_rec.P_adjusting_revenue_flag
,X_inventory_org_id =>p_inv_org_id
,X_inventory_item_id =>p_event_in_rec.P_inventory_item_id
,X_quantity_billed =>p_event_in_rec.P_quantity_billed
,X_uom_code =>p_event_in_rec.P_uom_code
,X_unit_price =>p_event_in_rec.P_unit_price
,X_reference1 =>p_event_in_rec.P_reference1
,X_reference2 =>p_event_in_rec.P_reference2
,X_reference3 =>p_event_in_rec.P_reference3
,X_reference4 =>p_event_in_rec.P_reference4
,X_reference5 =>p_event_in_rec.P_reference5
,X_reference6 =>p_event_in_rec.P_reference6
,X_reference7 =>p_event_in_rec.P_reference7
,X_reference8 =>p_event_in_rec.P_reference8
,X_reference9 =>p_event_in_rec.P_reference9
,X_reference10 =>p_event_in_rec.P_reference10
,X_agreement_id =>P_agreement_id );
PA_EVENTS_PKG.Update_Row
(X_Rowid =>Rowid
,X_Event_Id =>p_event_in_rec.P_event_id
,X_Task_Id =>p_task_id
,X_Event_Num =>p_event_in_rec.p_event_number
,X_Last_Update_Date =>SYSDATE
,X_Last_Updated_By =>G_USER_ID
,X_Last_Update_Login =>G_LOGIN_ID
,X_Event_Type =>p_event_in_rec.P_event_type
,X_Description =>p_event_in_rec.P_description
,X_Bill_Amount =>0
,X_Revenue_Amount =>0
,X_Revenue_Distributed_Flag =>'N'
,X_Bill_Hold_Flag =>p_event_in_rec.P_bill_hold_flag
,X_Completion_date =>p_event_in_rec.P_completion_date
,X_Rev_Dist_Rejection_Code =>NULL
,X_Attribute_Category =>p_event_in_rec.P_attribute_category
,X_Attribute1 =>p_event_in_rec.P_attribute1
,X_Attribute2 =>p_event_in_rec.P_attribute2
,X_Attribute3 =>p_event_in_rec.P_attribute3
,X_Attribute4 =>p_event_in_rec.P_attribute4
,X_Attribute5 =>p_event_in_rec.P_attribute5
,X_Attribute6 =>p_event_in_rec.P_attribute6
,X_Attribute7 =>p_event_in_rec.P_attribute7
,X_Attribute8 =>p_event_in_rec.P_attribute8
,X_Attribute9 =>p_event_in_rec.P_attribute9
,X_Attribute10 =>p_event_in_rec.P_attribute10
,X_Project_Id =>P_project_id
,X_Organization_Id =>P_Organization_Id
,X_Billing_Assignment_Id =>NULL
,X_Event_Num_Reversed =>NULL
,X_Calling_Place =>NULL
,X_Calling_Process =>NULL
,X_Bill_Trans_Currency_Code =>p_event_in_rec.P_bill_trans_currency_code
,X_Bill_Trans_Bill_Amount =>l_Bill_Trans_Bill_Amt
,X_Bill_Trans_rev_Amount =>l_Bill_Trans_rev_Amt
,X_Project_Currency_Code =>l_project_currency_code
,X_Project_Rate_Type =>p_event_in_rec.P_project_rate_type
,X_Project_Rate_Date =>p_event_in_rec.P_project_rate_date
,X_Project_Exchange_Rate =>p_event_in_rec.P_project_exchange_rate
,X_Project_Inv_Rate_Date =>l_ProjFunc_Inv_Rate_date
,X_Project_Inv_Exchange_Rate =>l_Project_Inv_Exchange_Rate
,X_Project_Bill_Amount =>l_Project_Bill_Amount
,X_Project_Rev_Rate_date =>l_Project_Rev_Rate_date
,X_Project_Rev_Exchange_Rate =>l_Project_Rev_Exchange_Rate
,X_Project_Revenue_Amount =>l_Project_Revenue_Amount
,X_ProjFunc_Currency_Code =>l_ProjFunc_Currency_Code
,X_ProjFunc_Rate_Type =>p_event_in_rec.P_projfunc_rate_type
,X_ProjFunc_Rate_date =>p_event_in_rec.P_projfunc_rate_date
,X_ProjFunc_Exchange_Rate =>p_event_in_rec.P_projfunc_exchange_rate
,X_ProjFunc_Inv_Rate_date =>l_ProjFunc_Inv_Rate_date
,X_ProjFunc_Inv_Exchange_Rate =>l_ProjFunc_Inv_Exchange_Rate
,X_ProjFunc_Bill_Amount =>l_ProjFunc_Bill_Amount
,X_ProjFunc_Rev_Rate_date =>l_ProjFunc_Rev_Rate_date
,X_Projfunc_Rev_Exchange_Rate =>l_Projfunc_Rev_Exchange_Rate
,X_ProjFunc_Revenue_Amount =>l_ProjFunc_Revenue_Amount
,X_Funding_Rate_Type =>p_event_in_rec.P_funding_rate_type
,X_Funding_Rate_date =>p_event_in_rec.P_funding_rate_date
,X_Funding_Exchange_Rate =>p_event_in_rec.P_funding_exchange_rate
,X_Invproc_Currency_Code =>l_Invproc_Currency_Code
,X_Invproc_Rate_Type =>l_Invproc_Rate_Type
,X_Invproc_Rate_date =>l_Invproc_Rate_date
,X_Invproc_Exchange_Rate =>l_Invproc_Exchange_Rate
,X_Revproc_Currency_Code =>l_Revproc_Currency_Code
,X_Revproc_Rate_Type =>l_Revproc_Rate_Type
,X_Revproc_Rate_date =>l_Revproc_Rate_date
,X_Revproc_Exchange_Rate =>l_revproc_exchange_rate
,X_Inv_Gen_Rejection_Code =>l_Inv_Gen_Rejection_Code
,X_Adjusting_Revenue_Flag =>p_event_in_rec.P_adjusting_revenue_flag
,X_inventory_org_id =>p_inv_org_id
,X_inventory_item_id =>p_event_in_rec.P_inventory_item_id
,X_quantity_billed =>p_event_in_rec.P_quantity_billed
,X_uom_code =>p_event_in_rec.P_uom_code
,X_unit_price =>p_event_in_rec.P_unit_price
,X_reference1 =>p_event_in_rec.P_reference1
,X_reference2 =>p_event_in_rec.P_reference2
,X_reference3 =>p_event_in_rec.P_reference3
,X_reference4 =>p_event_in_rec.P_reference4
,X_reference5 =>p_event_in_rec.P_reference5
,X_reference6 =>p_event_in_rec.P_reference6
,X_reference7 =>p_event_in_rec.P_reference7
,X_reference8 =>p_event_in_rec.P_reference8
,X_reference9 =>p_event_in_rec.P_reference9
,X_reference10 =>p_event_in_rec.P_reference10
,X_agreement_id =>P_agreement_id ); -- Federal Uptake
ROLLBACK TO Update_event;
ROLLBACK TO Update_event;
ROLLBACK TO Update_event;
PA_EVENT_PUB.PROCEDURE_NAME:=PA_EVENT_PUB.PROCEDURE_NAME||'UPDATE_EVENT';
ROLLBACK TO Update_event;
PA_EVENT_PUB.PROCEDURE_NAME:=PA_EVENT_PUB.PROCEDURE_NAME||substr(sqlerrm,1,80)||'UPDATE_EVENT';
PA_EVENT_PUB.PROCEDURE_NAME:=PA_EVENT_PUB.PROCEDURE_NAME||'UPDATE_EVENT';
PA_EVENT_PUB.PROCEDURE_NAME:=PA_EVENT_PUB.PROCEDURE_NAME||substr(sqlerrm,1,80)||'UPDATE_EVENT';
END UPDATE_EVENT;
PROCEDURE DELETE_EVENT
(p_api_version_number IN NUMBER
,p_commit IN VARCHAR2
,p_init_msg_list IN VARCHAR2
,p_pm_product_code IN VARCHAR2
,p_pm_event_reference IN VARCHAR2
,p_event_id IN NUMBER
,p_msg_count OUT NOCOPY NUMBER --File.Sql.39 bug 4440895
,p_msg_data OUT NOCOPY VARCHAR2 --File.Sql.39 bug 4440895
,p_return_status OUT NOCOPY VARCHAR2) --File.Sql.39 bug 4440895
AS
p_api_name VARCHAR2(100):='DELETE_EVENT';
pa_debug.set_err_stack('PA_EVENT_PUB.DELETE_EVENT');
pa_debug.write_log (x_module => 'pa.plsql.PA_EVENT_PUB.DELETE_EVENT.begin'
,x_msg => 'Beginning of Delete Event'
,x_log_level => 5);
Savepoint delete_event;
pa_debug.write_log (x_module => 'pa.plsql.PA_EVENT_PUB.DELETE_EVENT.begin'
,x_msg => 'Calling mandatory input parameters-1'
,x_log_level => 5);
,p_function_name =>'PA_EV_DELETE_EVENT'
,x_return_status =>p_return_status
,x_msg_count =>p_msg_count
,x_msg_data =>p_msg_data );
pa_debug.write_log (x_module => 'pa.plsql.PA_EVENT_PUB.DELETE_EVENT.begin'
,x_msg => ' Calling mandatory input parameters-2'
,x_log_level => 5);
,p_calling_place => 'DELETE_EVENT'
,x_return_status => p_return_status );
pa_debug.write_log (x_module => 'pa.plsql.PA_EVENT_PUB.DELETE_EVENT.begin'
,x_msg => 'Calling conv_event_ref_to_id'
,x_log_level => 5);
pa_debug.write_log (x_module => 'pa.plsql.PA_EVENT_PUB.DELETE_EVENT.begin'
,x_msg => 'Calling check_delete_event_ok'
,x_log_level => 5);
If PA_EVENT_PVT.CHECK_DELETE_EVENT_OK
(P_pm_event_reference =>l_pm_event_reference
,P_event_id =>l_event_id_out) ='N'
Then
IF FND_MSG_PUB.check_msg_level(FND_MSG_PUB.G_MSG_LVL_ERROR)
THEN
pa_interface_utils_pub.map_new_amg_msg
( p_old_message_code => 'PA_TK_EVENT_IN_USE'
,p_msg_attribute => 'CHANGE'
,p_resize_flag => 'N'
,p_msg_context => 'EVENT'
,p_attribute1 => l_pm_event_reference
,p_attribute2 => ''
,p_attribute3 => ''
,p_attribute4 => ''
,p_attribute5 => '');
Select Rowid
Into p_rowid
From pa_events
Where event_id=l_event_id_out;
pa_debug.write_log (x_module => 'pa.plsql.PA_EVENT_PUB.DELETE_EVENT.begin'
,x_msg => 'Calling table handler to delete event'
,x_log_level => 5);
PA_EVENTS_PKG.Delete_Row(X_Rowid => P_rowid);
ROLLBACK to delete_event;
ROLLBACK to delete_event;
ROLLBACK to delete_event;
PA_EVENT_PUB.PROCEDURE_NAME:=PA_EVENT_PUB.PROCEDURE_NAME||'DELETE_EVENT';
ROLLBACK to delete_event;
PA_EVENT_PUB.PROCEDURE_NAME:=PA_EVENT_PUB.PROCEDURE_NAME||substr(sqlerrm,1,80)||'DELETE_EVENT';
END DELETE_EVENT;
G_event_in_tbl.delete;
G_event_out_tbl.delete;
PROCEDURE EXECUTE_UPDATE_EVENT
(p_api_version_number IN NUMBER
,p_commit IN VARCHAR2
,p_init_msg_list IN VARCHAR2
,p_pm_product_code IN VARCHAR2
,p_msg_count OUT NOCOPY NUMBER --File.Sql.39 bug 4440895
,p_msg_data OUT NOCOPY VARCHAR2 --File.Sql.39 bug 4440895
,p_return_status OUT NOCOPY VARCHAR2) --File.Sql.39 bug 4440895
AS
p_api_name VARCHAR2(100):='EXECUTE_UPDATE_EVENT';
pa_debug.set_err_stack('PA_EVENT_PUB.EXECUTE_UPDATE_EVENT');
pa_debug.write_log (x_module => 'pa.plsql.PA_EVENT_PUB.EXECUTE_UPDATE_EVENT.begin'
,x_msg => 'Beginning of Execute_Update_Event'
,x_log_level => 5);
pa_debug.write_log (x_module => 'pa.plsql.PA_EVENT_PUB.EXECUTE_UPDATE_EVENT.begin'
,x_msg => 'Beginning of api compatibility check '
,x_log_level => 5);
pa_debug.write_log (x_module => 'pa.plsql.PA_EVENT_PUB.EXECUTE_UPDATE_EVENT.begin'
,x_msg => 'Calling Update_event '
,x_log_level => 5);
UPDATE_EVENT
(P_api_version_number =>p_api_version_number
,P_commit =>p_commit
,P_init_msg_list =>p_init_msg_list
,P_msg_count =>p_msg_count
,P_msg_data =>p_msg_data
,P_return_status =>p_return_status
,P_pm_product_code =>p_pm_product_code
,P_event_in_tbl =>G_event_in_tbl
,P_event_out_tbl =>G_event_out_tbl);
PA_EVENT_PUB.PROCEDURE_NAME:=PA_EVENT_PUB.PROCEDURE_NAME||substr(sqlerrm,1,80)||'EXECUTE_UPDATE_EVENT';
END EXECUTE_UPDATE_EVENT;
PROCEDURE CHECK_DELETE_EVENT_OK
(P_api_version_number IN NUMBER
,P_commit IN VARCHAR2
,P_init_msg_list IN VARCHAR2
,P_pm_product_code IN VARCHAR2
,P_pm_event_reference IN VARCHAR2
,P_event_id IN NUMBER
,P_del_event_ok_flag OUT NOCOPY VARCHAR2 --File.Sql.39 bug 4440895
,P_msg_count OUT NOCOPY NUMBER --File.Sql.39 bug 4440895
,P_msg_data OUT NOCOPY VARCHAR2 --File.Sql.39 bug 4440895
,P_return_status OUT NOCOPY VARCHAR2) --File.Sql.39 bug 4440895
AS
p_api_name VARCHAR2(100):='CHECK_DELETE_EVENT_OK';
pa_debug.set_err_stack('PA_EVENT_PUB.CHECK_DELETE_EVENT_OK');
pa_debug.write_log (x_module => 'pa.plsql.PA_EVENT_PUB.CHECK_DELETE_EVENT_OK.begin'
,x_msg => 'Beginning of Check_Delete_Event_Ok'
,x_log_level => 5);
Savepoint check_delete_event_ok;
pa_debug.write_log (x_module => 'pa.plsql.PA_EVENT_PUB.CHECK_DELETE_EVENT_OK.begin'
,x_msg => 'Calling mandatory input parameters-1'
,x_log_level => 5);
pa_debug.write_log (x_module => 'pa.plsql.PA_EVENT_PUB.CHECK_DELETE_EVENT_OK.begin'
,x_msg => 'Calling conv_event_ref_to_id'
,x_log_level => 5);
pa_debug.write_log (x_module => 'pa.plsql.PA_EVENT_PUB.CHECK_DELETE_EVENT_OK.begin'
,x_msg => 'Calling Check_Event_Processed'
,x_log_level => 5);
ROLLBACK to check_delete_event_ok;
ROLLBACK to check_delete_event_ok;
ROLLBACK to check_delete_event_ok;
PA_EVENT_PUB.PROCEDURE_NAME:=PA_EVENT_PUB.PROCEDURE_NAME||substr(sqlerrm,1,80)||'CHECK_DELETE_EVENT_OK';
END CHECK_DELETE_EVENT_OK;