The following lines contain the word 'select', 'insert', 'update' or 'delete':
/* Selecting currency from bill rate table in all the selects for MCB2 */
IF p_compute_flag(i) = 'Y' THEN
BEGIN
IF ( p_exp_sys_linkage(i) NOT IN ( 'ST','OT') ) THEN
/*Bug# 2036624:Commented for bug# 2036624.Now when non_labor_resource is null
it will be trapped in exception part and the bill rate will be calculated */
/* AND ( p_non_labor_resource(i) IS NOT NULL ) ) THEN Bug# 2036624 */
BEGIN
/* Non Labor Resource Based Bill Rate/Markup */
SELECT b.rate,
b.markup_percentage,
b.org_id,
b.rate_currency_code
INTO bill_rate,
markup,
bill_ous,
v_curr_code
FROM pa_bill_rates_all b
WHERE
b.bill_rate_sch_id = p_bill_rate_sch_id(i)
AND b.expenditure_type = p_expenditure_type(i)
AND b.non_labor_resource = p_non_labor_resource(i)
AND nvl(p_fixed_date(i), p_expenditure_item_date(i)) BETWEEN
b.start_date_active AND nvl(b.end_date_active,p_expenditure_item_date(i));
/* Bug#3019564 - The following select statement is raised a too may row exception.
Fix : Add the non_labor_resource is null for the following sql */
SELECT b.rate,
b.markup_percentage,
b.org_id,
b.rate_currency_code
INTO bill_rate,
markup,
bill_ous,
v_curr_code
FROM pa_bill_rates_all b
WHERE
b.bill_rate_sch_id = p_bill_rate_sch_id(i)
AND b.expenditure_type = p_expenditure_type(i)
AND b.non_labor_resource IS NULL
AND nvl(p_fixed_date(i), p_expenditure_item_date(i)) BETWEEN
b.start_date_active AND nvl(b.end_date_active,p_expenditure_item_date(i));
/* CBGA changes : select the column job_id */
SELECT b.rate,
b.markup_percentage,
b.org_id,
b.job_id,
b.rate_currency_code
INTO bill_rate,
markup,
bill_ous,
v_job_id,
v_curr_code
FROM pa_bill_rates_all b,
per_assignments_f pa,
pa_std_bill_rate_schedules_all brs
WHERE
pa.primary_flag = 'Y'
-- AND pa.assignment_type = 'E' /* bug 2911451 */
AND pa.assignment_type IN ('E','C') -- Modified for CWK impact
AND pa.person_id = p_incurred_by_person_id(i)
AND p_expenditure_item_date(i) BETWEEN
pa.effective_start_date AND
pa.effective_end_date /* Removed the nvl on end_date as part of Assignment Type Validation changes for bug 2911451 */
AND b.bill_rate_sch_id = p_bill_rate_sch_id(i)
AND b.bill_rate_sch_id = brs.bill_rate_sch_id
AND b.job_id = PA_cross_Business_Grp.IsMappedToJob(pa.job_id, brs.job_group_id)
AND nvl(p_fixed_date(i),p_expenditure_item_date(i)) BETWEEN
b.start_date_active AND nvl(b.end_date_active,p_expenditure_item_date(i));
SELECT b.rate,
b.markup_percentage,
b.org_id,
b.rate_currency_code
INTO bill_rate,
markup,
bill_ous,
v_curr_code
FROM pa_bill_rates_all b
WHERE
b.bill_rate_sch_id = p_bill_rate_sch_id(i)
AND b.person_id = p_incurred_by_person_id(i)
AND nvl(p_fixed_date(i),p_expenditure_item_date(i)) BETWEEN
b.start_date_active AND nvl(b.end_date_active,p_expenditure_item_date(i));
select pa_currency.round_trans_curr_amt(x_computed_markup(i)*p_base_amt(i)/100,
x_computed_currency(i))
into x_computed_amount(i)
from dual;
/* Added for MCB2 : Commented the below select because , now selecting rate currency can be diffrent from PFC */
/* select gsb.currency_code
into x_computed_currency(i)
from pa_implementations_all imp,
gl_sets_of_books gsb
where imp.org_id = bill_ous
and imp.set_of_books_id = gsb.set_of_books_id; */