16: l_Get_plan_actual_Rates EXCEPTION; /* Added to handel when others in Get_plan_actual_Rates proc. */
17:
18: g_success CONSTANT VARCHAR2(1) := FND_API.G_RET_STS_SUCCESS;
19: g_error CONSTANT VARCHAR2(1) := FND_API.G_RET_STS_ERROR;
20: g1_debug_mode varchar2(1) := NVL(FND_PROFILE.value('PA_DEBUG_MODE'), 'N');
21: g_module_name VARCHAR2(100) := 'pa.plsql.PA_PLAN_REVENUE';
22: g_expenditure_type_tbl SYSTEM.PA_VARCHAR2_30_TBL_TYPE := SYSTEM.PA_VARCHAR2_30_TBL_TYPE();
23: g_uom_tbl SYSTEM.PA_VARCHAR2_30_TBL_TYPE := SYSTEM.PA_VARCHAR2_30_TBL_TYPE();
24: g_count_init NUMBER:=0;
85: BEGIN
86: /*Checking all the mandatory Parameters */
87:
88: IF g1_debug_mode = 'Y' THEN
89: pa_debug.g_err_stage := 'p_res_class_rate_sch_id:'||p_res_class_rate_sch_id||'p_res_class_org_id :'||p_res_class_org_id||'p_org_id:'||p_org_id ;
90: pa_debug.write('PA_PLAN_REVENUE.Get_Res_Class_Hierarchy_Rate: ' || g_module_name,pa_debug.g_err_stage,3);
91: END IF;
92: IF g1_debug_mode = 'Y' THEN
93: pa_debug.g_err_stage := 'p_resource_class_code:'||p_resource_class_code||'p_item_date :'||p_item_date ;
86: /*Checking all the mandatory Parameters */
87:
88: IF g1_debug_mode = 'Y' THEN
89: pa_debug.g_err_stage := 'p_res_class_rate_sch_id:'||p_res_class_rate_sch_id||'p_res_class_org_id :'||p_res_class_org_id||'p_org_id:'||p_org_id ;
90: pa_debug.write('PA_PLAN_REVENUE.Get_Res_Class_Hierarchy_Rate: ' || g_module_name,pa_debug.g_err_stage,3);
91: END IF;
92: IF g1_debug_mode = 'Y' THEN
93: pa_debug.g_err_stage := 'p_resource_class_code:'||p_resource_class_code||'p_item_date :'||p_item_date ;
94: pa_debug.write('PA_PLAN_REVENUE.Get_Res_Class_Hierarchy_Rate: ' || g_module_name,pa_debug.g_err_stage,3);
89: pa_debug.g_err_stage := 'p_res_class_rate_sch_id:'||p_res_class_rate_sch_id||'p_res_class_org_id :'||p_res_class_org_id||'p_org_id:'||p_org_id ;
90: pa_debug.write('PA_PLAN_REVENUE.Get_Res_Class_Hierarchy_Rate: ' || g_module_name,pa_debug.g_err_stage,3);
91: END IF;
92: IF g1_debug_mode = 'Y' THEN
93: pa_debug.g_err_stage := 'p_resource_class_code:'||p_resource_class_code||'p_item_date :'||p_item_date ;
94: pa_debug.write('PA_PLAN_REVENUE.Get_Res_Class_Hierarchy_Rate: ' || g_module_name,pa_debug.g_err_stage,3);
95: END IF;
96:
97: IF p_res_class_rate_sch_id IS NULL OR p_item_date IS NULL
90: pa_debug.write('PA_PLAN_REVENUE.Get_Res_Class_Hierarchy_Rate: ' || g_module_name,pa_debug.g_err_stage,3);
91: END IF;
92: IF g1_debug_mode = 'Y' THEN
93: pa_debug.g_err_stage := 'p_resource_class_code:'||p_resource_class_code||'p_item_date :'||p_item_date ;
94: pa_debug.write('PA_PLAN_REVENUE.Get_Res_Class_Hierarchy_Rate: ' || g_module_name,pa_debug.g_err_stage,3);
95: END IF;
96:
97: IF p_res_class_rate_sch_id IS NULL OR p_item_date IS NULL
98: OR p_resource_class_code IS NULL THEN
184:
185: g_count_init:= g_count_init+1;
186:
187: IF g1_debug_mode = 'Y' THEN
188: pa_debug.g_err_stage:='Before count of g_count_init'|| g_count_init||'g_expenditure_type_tbl.COUNT'||g_expenditure_type_tbl.COUNT;
189: pa_debug.write('Get_exp_type_uom: ' || g_module_name,pa_debug.g_err_stage,2);
190: END IF;
191: END;
192:
185: g_count_init:= g_count_init+1;
186:
187: IF g1_debug_mode = 'Y' THEN
188: pa_debug.g_err_stage:='Before count of g_count_init'|| g_count_init||'g_expenditure_type_tbl.COUNT'||g_expenditure_type_tbl.COUNT;
189: pa_debug.write('Get_exp_type_uom: ' || g_module_name,pa_debug.g_err_stage,2);
190: END IF;
191: END;
192:
193: -- This procedure will calculate the raw revenue and bill amount from one of the 12 criterias on the basis
335:
336: -- Initializing return status with success so that if some unexpected error comes
337: -- , we change its status from succes to error so that we can take necessary step to rectify the problem
338: l_x_return_status := g_success;
339: PA_DEBUG.init_err_stack( 'PA_PLAN_REVENUE.Get_planning_rates');
340: IF g1_debug_mode = 'Y' THEN
341: pa_debug.g_err_stage:='Input parameters:-> p_project_id :'||p_project_id ||'p_task_id :'||p_task_id;
342: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
343: END IF;
337: -- , we change its status from succes to error so that we can take necessary step to rectify the problem
338: l_x_return_status := g_success;
339: PA_DEBUG.init_err_stack( 'PA_PLAN_REVENUE.Get_planning_rates');
340: IF g1_debug_mode = 'Y' THEN
341: pa_debug.g_err_stage:='Input parameters:-> p_project_id :'||p_project_id ||'p_task_id :'||p_task_id;
342: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
343: END IF;
344:
345: IF g1_debug_mode = 'Y' THEN
338: l_x_return_status := g_success;
339: PA_DEBUG.init_err_stack( 'PA_PLAN_REVENUE.Get_planning_rates');
340: IF g1_debug_mode = 'Y' THEN
341: pa_debug.g_err_stage:='Input parameters:-> p_project_id :'||p_project_id ||'p_task_id :'||p_task_id;
342: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
343: END IF;
344:
345: IF g1_debug_mode = 'Y' THEN
346: pa_debug.g_err_stage:='Input parameters:-> p_person_id :'||p_person_id||'p_job_id :'||p_job_id;
342: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
343: END IF;
344:
345: IF g1_debug_mode = 'Y' THEN
346: pa_debug.g_err_stage:='Input parameters:-> p_person_id :'||p_person_id||'p_job_id :'||p_job_id;
347: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
348: END IF;
349: IF g1_debug_mode = 'Y' THEN
350: pa_debug.g_err_stage:='Input parameters:-> p_resource_class :'||p_resource_class ||'p_use_planning_rates_flag :'||p_use_planning_rates_flag;
343: END IF;
344:
345: IF g1_debug_mode = 'Y' THEN
346: pa_debug.g_err_stage:='Input parameters:-> p_person_id :'||p_person_id||'p_job_id :'||p_job_id;
347: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
348: END IF;
349: IF g1_debug_mode = 'Y' THEN
350: pa_debug.g_err_stage:='Input parameters:-> p_resource_class :'||p_resource_class ||'p_use_planning_rates_flag :'||p_use_planning_rates_flag;
351: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
346: pa_debug.g_err_stage:='Input parameters:-> p_person_id :'||p_person_id||'p_job_id :'||p_job_id;
347: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
348: END IF;
349: IF g1_debug_mode = 'Y' THEN
350: pa_debug.g_err_stage:='Input parameters:-> p_resource_class :'||p_resource_class ||'p_use_planning_rates_flag :'||p_use_planning_rates_flag;
351: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
352: END IF;
353: IF g1_debug_mode = 'Y' THEN
354: pa_debug.g_err_stage:='Input parameters:-> p_rate_based_flag:'||p_rate_based_flag||'p_uom :'||p_uom;
347: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
348: END IF;
349: IF g1_debug_mode = 'Y' THEN
350: pa_debug.g_err_stage:='Input parameters:-> p_resource_class :'||p_resource_class ||'p_use_planning_rates_flag :'||p_use_planning_rates_flag;
351: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
352: END IF;
353: IF g1_debug_mode = 'Y' THEN
354: pa_debug.g_err_stage:='Input parameters:-> p_rate_based_flag:'||p_rate_based_flag||'p_uom :'||p_uom;
355: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
350: pa_debug.g_err_stage:='Input parameters:-> p_resource_class :'||p_resource_class ||'p_use_planning_rates_flag :'||p_use_planning_rates_flag;
351: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
352: END IF;
353: IF g1_debug_mode = 'Y' THEN
354: pa_debug.g_err_stage:='Input parameters:-> p_rate_based_flag:'||p_rate_based_flag||'p_uom :'||p_uom;
355: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
356: END IF;
357:
358: IF g1_debug_mode = 'Y' THEN
351: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
352: END IF;
353: IF g1_debug_mode = 'Y' THEN
354: pa_debug.g_err_stage:='Input parameters:-> p_rate_based_flag:'||p_rate_based_flag||'p_uom :'||p_uom;
355: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
356: END IF;
357:
358: IF g1_debug_mode = 'Y' THEN
359: pa_debug.g_err_stage:='Input parameters:-> p_rev_res_class_rate_sch_id :'||p_rev_res_class_rate_sch_id ||'p_cost_res_class_rate_sch_id :'||p_cost_res_class_rate_sch_id;
355: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
356: END IF;
357:
358: IF g1_debug_mode = 'Y' THEN
359: pa_debug.g_err_stage:='Input parameters:-> p_rev_res_class_rate_sch_id :'||p_rev_res_class_rate_sch_id ||'p_cost_res_class_rate_sch_id :'||p_cost_res_class_rate_sch_id;
360: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
361: END IF;
362:
363: IF g1_debug_mode = 'Y' THEN
356: END IF;
357:
358: IF g1_debug_mode = 'Y' THEN
359: pa_debug.g_err_stage:='Input parameters:-> p_rev_res_class_rate_sch_id :'||p_rev_res_class_rate_sch_id ||'p_cost_res_class_rate_sch_id :'||p_cost_res_class_rate_sch_id;
360: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
361: END IF;
362:
363: IF g1_debug_mode = 'Y' THEN
364: pa_debug.g_err_stage:='Input parameters:-> p_rev_task_nl_rate_sch_id :'||p_rev_task_nl_rate_sch_id||'p_rev_proj_nl_rate_sch_id :'||p_rev_proj_nl_rate_sch_id;
360: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
361: END IF;
362:
363: IF g1_debug_mode = 'Y' THEN
364: pa_debug.g_err_stage:='Input parameters:-> p_rev_task_nl_rate_sch_id :'||p_rev_task_nl_rate_sch_id||'p_rev_proj_nl_rate_sch_id :'||p_rev_proj_nl_rate_sch_id;
365: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
366: END IF;
367:
368: IF g1_debug_mode = 'Y' THEN
361: END IF;
362:
363: IF g1_debug_mode = 'Y' THEN
364: pa_debug.g_err_stage:='Input parameters:-> p_rev_task_nl_rate_sch_id :'||p_rev_task_nl_rate_sch_id||'p_rev_proj_nl_rate_sch_id :'||p_rev_proj_nl_rate_sch_id;
365: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
366: END IF;
367:
368: IF g1_debug_mode = 'Y' THEN
369: pa_debug.g_err_stage:='Input parameters:-> p_rev_job_rate_sch_id :'||p_rev_job_rate_sch_id ||'p_rev_emp_rate_sch_id :'||p_rev_emp_rate_sch_id;
365: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
366: END IF;
367:
368: IF g1_debug_mode = 'Y' THEN
369: pa_debug.g_err_stage:='Input parameters:-> p_rev_job_rate_sch_id :'||p_rev_job_rate_sch_id ||'p_rev_emp_rate_sch_id :'||p_rev_emp_rate_sch_id;
370: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
371: END IF;
372:
373: IF g1_debug_mode = 'Y' THEN
366: END IF;
367:
368: IF g1_debug_mode = 'Y' THEN
369: pa_debug.g_err_stage:='Input parameters:-> p_rev_job_rate_sch_id :'||p_rev_job_rate_sch_id ||'p_rev_emp_rate_sch_id :'||p_rev_emp_rate_sch_id;
370: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
371: END IF;
372:
373: IF g1_debug_mode = 'Y' THEN
374: pa_debug.g_err_stage:='Input parameters:-> p_plan_rev_job_rate_sch_id :'||p_plan_rev_job_rate_sch_id||'p_plan_cost_job_rate_sch_id :'||p_plan_cost_job_rate_sch_id;
370: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
371: END IF;
372:
373: IF g1_debug_mode = 'Y' THEN
374: pa_debug.g_err_stage:='Input parameters:-> p_plan_rev_job_rate_sch_id :'||p_plan_rev_job_rate_sch_id||'p_plan_cost_job_rate_sch_id :'||p_plan_cost_job_rate_sch_id;
375: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
376: END IF;
377:
378: IF g1_debug_mode = 'Y' THEN
371: END IF;
372:
373: IF g1_debug_mode = 'Y' THEN
374: pa_debug.g_err_stage:='Input parameters:-> p_plan_rev_job_rate_sch_id :'||p_plan_rev_job_rate_sch_id||'p_plan_cost_job_rate_sch_id :'||p_plan_cost_job_rate_sch_id;
375: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
376: END IF;
377:
378: IF g1_debug_mode = 'Y' THEN
379: pa_debug.g_err_stage:='Input parameters:-> p_plan_rev_nlr_rate_sch_id :'||p_plan_rev_nlr_rate_sch_id ||'p_plan_cost_nlr_rate_sch_id :'||p_plan_cost_nlr_rate_sch_id;
375: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
376: END IF;
377:
378: IF g1_debug_mode = 'Y' THEN
379: pa_debug.g_err_stage:='Input parameters:-> p_plan_rev_nlr_rate_sch_id :'||p_plan_rev_nlr_rate_sch_id ||'p_plan_cost_nlr_rate_sch_id :'||p_plan_cost_nlr_rate_sch_id;
380: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
381: END IF;
382:
383: IF g1_debug_mode = 'Y' THEN
376: END IF;
377:
378: IF g1_debug_mode = 'Y' THEN
379: pa_debug.g_err_stage:='Input parameters:-> p_plan_rev_nlr_rate_sch_id :'||p_plan_rev_nlr_rate_sch_id ||'p_plan_cost_nlr_rate_sch_id :'||p_plan_cost_nlr_rate_sch_id;
380: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
381: END IF;
382:
383: IF g1_debug_mode = 'Y' THEN
384: pa_debug.g_err_stage:='Input parameters:-> p_plan_burden_cost_sch_id :'||p_plan_burden_cost_sch_id ||'p_calculate_mode :'||p_calculate_mode;
380: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
381: END IF;
382:
383: IF g1_debug_mode = 'Y' THEN
384: pa_debug.g_err_stage:='Input parameters:-> p_plan_burden_cost_sch_id :'||p_plan_burden_cost_sch_id ||'p_calculate_mode :'||p_calculate_mode;
385: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
386: END IF;
387:
388: IF g1_debug_mode = 'Y' THEN
381: END IF;
382:
383: IF g1_debug_mode = 'Y' THEN
384: pa_debug.g_err_stage:='Input parameters:-> p_plan_burden_cost_sch_id :'||p_plan_burden_cost_sch_id ||'p_calculate_mode :'||p_calculate_mode;
385: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
386: END IF;
387:
388: IF g1_debug_mode = 'Y' THEN
389: pa_debug.g_err_stage:='Input parameters:-> p_quantity :'||p_quantity ||'p_labor_sch_type :'||p_labor_sch_type;
385: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
386: END IF;
387:
388: IF g1_debug_mode = 'Y' THEN
389: pa_debug.g_err_stage:='Input parameters:-> p_quantity :'||p_quantity ||'p_labor_sch_type :'||p_labor_sch_type;
390: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
391: END IF;
392:
393: IF g1_debug_mode = 'Y' THEN
386: END IF;
387:
388: IF g1_debug_mode = 'Y' THEN
389: pa_debug.g_err_stage:='Input parameters:-> p_quantity :'||p_quantity ||'p_labor_sch_type :'||p_labor_sch_type;
390: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
391: END IF;
392:
393: IF g1_debug_mode = 'Y' THEN
394: pa_debug.g_err_stage:='Input parameters:-> p_non_labor_sch_type :'||p_non_labor_sch_type ||'p_expenditure_type :'||p_expenditure_type;
390: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
391: END IF;
392:
393: IF g1_debug_mode = 'Y' THEN
394: pa_debug.g_err_stage:='Input parameters:-> p_non_labor_sch_type :'||p_non_labor_sch_type ||'p_expenditure_type :'||p_expenditure_type;
395: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
396: END IF;
397:
398:
391: END IF;
392:
393: IF g1_debug_mode = 'Y' THEN
394: pa_debug.g_err_stage:='Input parameters:-> p_non_labor_sch_type :'||p_non_labor_sch_type ||'p_expenditure_type :'||p_expenditure_type;
395: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
396: END IF;
397:
398:
399: IF g1_debug_mode = 'Y' THEN
396: END IF;
397:
398:
399: IF g1_debug_mode = 'Y' THEN
400: pa_debug.g_err_stage:='Input parameters:-> p_cost_override_rate :'||p_cost_override_rate ||'p_raw_cost :'||p_raw_cost;
401: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
402: END IF;
403:
404: IF g1_debug_mode = 'Y' THEN
397:
398:
399: IF g1_debug_mode = 'Y' THEN
400: pa_debug.g_err_stage:='Input parameters:-> p_cost_override_rate :'||p_cost_override_rate ||'p_raw_cost :'||p_raw_cost;
401: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
402: END IF;
403:
404: IF g1_debug_mode = 'Y' THEN
405: pa_debug.g_err_stage:='Input parameters:-> p_revenue_override_rate :'||p_revenue_override_rate ||'p_override_currency_code :'||p_override_currency_code;
401: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
402: END IF;
403:
404: IF g1_debug_mode = 'Y' THEN
405: pa_debug.g_err_stage:='Input parameters:-> p_revenue_override_rate :'||p_revenue_override_rate ||'p_override_currency_code :'||p_override_currency_code;
406: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
407: END IF;
408:
409: IF g1_debug_mode = 'Y' THEN
402: END IF;
403:
404: IF g1_debug_mode = 'Y' THEN
405: pa_debug.g_err_stage:='Input parameters:-> p_revenue_override_rate :'||p_revenue_override_rate ||'p_override_currency_code :'||p_override_currency_code;
406: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
407: END IF;
408:
409: IF g1_debug_mode = 'Y' THEN
410: pa_debug.g_err_stage:='Input parameters:-> p_burden_cost :'||p_burden_cost ||'p_raw_revenue :'||p_raw_revenue ;
406: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
407: END IF;
408:
409: IF g1_debug_mode = 'Y' THEN
410: pa_debug.g_err_stage:='Input parameters:-> p_burden_cost :'||p_burden_cost ||'p_raw_revenue :'||p_raw_revenue ;
411: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
412: END IF;
413:
414:
407: END IF;
408:
409: IF g1_debug_mode = 'Y' THEN
410: pa_debug.g_err_stage:='Input parameters:-> p_burden_cost :'||p_burden_cost ||'p_raw_revenue :'||p_raw_revenue ;
411: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
412: END IF;
413:
414:
415: IF g1_debug_mode = 'Y' THEN
412: END IF;
413:
414:
415: IF g1_debug_mode = 'Y' THEN
416: pa_debug.g_err_stage:='Validating input parameters';
417: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
418: END IF;
419:
420:
413:
414:
415: IF g1_debug_mode = 'Y' THEN
416: pa_debug.g_err_stage:='Validating input parameters';
417: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
418: END IF;
419:
420:
421: /* Change to honour billability flag */
433: the API should pass the same value as it is without any further calculation */
434: IF p_raw_cost IS NOT NULL AND p_burden_cost IS NOT NULL AND p_raw_revenue IS NOT NULL THEN
435: IF p_override_currency_code IS NULL THEN
436: IF g1_debug_mode = 'Y' THEN
437: pa_debug.g_err_stage:='Validating Get_planning_rates :pass p_override_currency_code for Override amounts';
438: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
439: END IF;
440: RAISE l_invalid_currency ;
441: ELSE
434: IF p_raw_cost IS NOT NULL AND p_burden_cost IS NOT NULL AND p_raw_revenue IS NOT NULL THEN
435: IF p_override_currency_code IS NULL THEN
436: IF g1_debug_mode = 'Y' THEN
437: pa_debug.g_err_stage:='Validating Get_planning_rates :pass p_override_currency_code for Override amounts';
438: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
439: END IF;
440: RAISE l_invalid_currency ;
441: ELSE
442: l_txn_raw_cost :=p_raw_cost;
465: IF ((p_raw_cost IS NOT NULL OR p_raw_revenue IS NOT NULL)
466: OR (p_cost_override_rate IS NOT NULL OR p_revenue_override_rate IS NOT NULL)) THEN
467: IF p_override_currency_code IS NULL THEN
468: IF g1_debug_mode = 'Y' THEN
469: pa_debug.g_err_stage:='Validating Get_planning_rates :p_override_currency_code cannot be null,if p_raw_cost,p_raw_revenue,p_cost_override_rate,p_revenue_override_rate is passed';
470: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
471: END IF;
472: RAISE l_invalid_currency;
473: END IF;
466: OR (p_cost_override_rate IS NOT NULL OR p_revenue_override_rate IS NOT NULL)) THEN
467: IF p_override_currency_code IS NULL THEN
468: IF g1_debug_mode = 'Y' THEN
469: pa_debug.g_err_stage:='Validating Get_planning_rates :p_override_currency_code cannot be null,if p_raw_cost,p_raw_revenue,p_cost_override_rate,p_revenue_override_rate is passed';
470: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
471: END IF;
472: RAISE l_invalid_currency;
473: END IF;
474: END IF;
475:
476: /* Check for using Actual Calculation Flow for Planning Transactions */
477: IF p_use_planning_rates_flag = 'N' THEN
478: IF g1_debug_mode = 'Y' THEN
479: pa_debug.g_err_stage:='Calling the Get_plan_actual_Rates ';
480: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
481: END IF;
482: BEGIN
483: /* Calling the internal Api to get the actual Rates , this API is one to one mapped with the main API for Actuals*/
476: /* Check for using Actual Calculation Flow for Planning Transactions */
477: IF p_use_planning_rates_flag = 'N' THEN
478: IF g1_debug_mode = 'Y' THEN
479: pa_debug.g_err_stage:='Calling the Get_plan_actual_Rates ';
480: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
481: END IF;
482: BEGIN
483: /* Calling the internal Api to get the actual Rates , this API is one to one mapped with the main API for Actuals*/
484:
564:
565:
566:
567: IF g1_debug_mode = 'Y' THEN
568: pa_debug.g_err_stage:='Called the Get_plan_actual_Rates:l_return_status'||l_x_return_status||'x_msg_data'||l_x_msg_data||'x_cost_rej_code'||l_raw_cost_rejection_code;
569: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
570: END IF;
571: IF g1_debug_mode = 'Y' THEN
572: pa_debug.g_err_stage:='Called the Get_plan_actual_Rates:l_burd_cost_rate'||l_txn_burden_cost_rate||'l_raw_cost'||l_raw_cost||'l_cost_rate'||l_txn_cost_rate||'l_cost_curr_code'||l_cost_txn_curr_code ;
565:
566:
567: IF g1_debug_mode = 'Y' THEN
568: pa_debug.g_err_stage:='Called the Get_plan_actual_Rates:l_return_status'||l_x_return_status||'x_msg_data'||l_x_msg_data||'x_cost_rej_code'||l_raw_cost_rejection_code;
569: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
570: END IF;
571: IF g1_debug_mode = 'Y' THEN
572: pa_debug.g_err_stage:='Called the Get_plan_actual_Rates:l_burd_cost_rate'||l_txn_burden_cost_rate||'l_raw_cost'||l_raw_cost||'l_cost_rate'||l_txn_cost_rate||'l_cost_curr_code'||l_cost_txn_curr_code ;
573: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
568: pa_debug.g_err_stage:='Called the Get_plan_actual_Rates:l_return_status'||l_x_return_status||'x_msg_data'||l_x_msg_data||'x_cost_rej_code'||l_raw_cost_rejection_code;
569: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
570: END IF;
571: IF g1_debug_mode = 'Y' THEN
572: pa_debug.g_err_stage:='Called the Get_plan_actual_Rates:l_burd_cost_rate'||l_txn_burden_cost_rate||'l_raw_cost'||l_raw_cost||'l_cost_rate'||l_txn_cost_rate||'l_cost_curr_code'||l_cost_txn_curr_code ;
573: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
574: END IF;
575: IF g1_debug_mode = 'Y' THEN
576: pa_debug.g_err_stage:='Called the Get_plan_actual_Rates:l_txn_bill_rate'||l_txn_bill_rate||'l_bill_markup'||l_bill_markup ;
569: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
570: END IF;
571: IF g1_debug_mode = 'Y' THEN
572: pa_debug.g_err_stage:='Called the Get_plan_actual_Rates:l_burd_cost_rate'||l_txn_burden_cost_rate||'l_raw_cost'||l_raw_cost||'l_cost_rate'||l_txn_cost_rate||'l_cost_curr_code'||l_cost_txn_curr_code ;
573: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
574: END IF;
575: IF g1_debug_mode = 'Y' THEN
576: pa_debug.g_err_stage:='Called the Get_plan_actual_Rates:l_txn_bill_rate'||l_txn_bill_rate||'l_bill_markup'||l_bill_markup ;
577: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
572: pa_debug.g_err_stage:='Called the Get_plan_actual_Rates:l_burd_cost_rate'||l_txn_burden_cost_rate||'l_raw_cost'||l_raw_cost||'l_cost_rate'||l_txn_cost_rate||'l_cost_curr_code'||l_cost_txn_curr_code ;
573: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
574: END IF;
575: IF g1_debug_mode = 'Y' THEN
576: pa_debug.g_err_stage:='Called the Get_plan_actual_Rates:l_txn_bill_rate'||l_txn_bill_rate||'l_bill_markup'||l_bill_markup ;
577: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
578: END IF;
579: IF g1_debug_mode = 'Y' THEN
580: pa_debug.g_err_stage:='Called the Get_plan_actual_Rates:l_txn_bill_rate'||l_txn_bill_rate||'l_raw_revenue'||l_raw_revenue ||'rev_rej_code'||l_revenue_rejection_code||'curr_code'||l_rev_txn_curr_code ;
573: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
574: END IF;
575: IF g1_debug_mode = 'Y' THEN
576: pa_debug.g_err_stage:='Called the Get_plan_actual_Rates:l_txn_bill_rate'||l_txn_bill_rate||'l_bill_markup'||l_bill_markup ;
577: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
578: END IF;
579: IF g1_debug_mode = 'Y' THEN
580: pa_debug.g_err_stage:='Called the Get_plan_actual_Rates:l_txn_bill_rate'||l_txn_bill_rate||'l_raw_revenue'||l_raw_revenue ||'rev_rej_code'||l_revenue_rejection_code||'curr_code'||l_rev_txn_curr_code ;
581: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
576: pa_debug.g_err_stage:='Called the Get_plan_actual_Rates:l_txn_bill_rate'||l_txn_bill_rate||'l_bill_markup'||l_bill_markup ;
577: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
578: END IF;
579: IF g1_debug_mode = 'Y' THEN
580: pa_debug.g_err_stage:='Called the Get_plan_actual_Rates:l_txn_bill_rate'||l_txn_bill_rate||'l_raw_revenue'||l_raw_revenue ||'rev_rej_code'||l_revenue_rejection_code||'curr_code'||l_rev_txn_curr_code ;
581: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
582: END IF;
583:
584: EXCEPTION
577: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
578: END IF;
579: IF g1_debug_mode = 'Y' THEN
580: pa_debug.g_err_stage:='Called the Get_plan_actual_Rates:l_txn_bill_rate'||l_txn_bill_rate||'l_raw_revenue'||l_raw_revenue ||'rev_rej_code'||l_revenue_rejection_code||'curr_code'||l_rev_txn_curr_code ;
581: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
582: END IF;
583:
584: EXCEPTION
585: WHEN OTHERS THEN
593: l_raw_cost_rejection_code := SUBSTR(SQLERRM,1,30);
594: l_burden_cost_rejection_code := SUBSTR(SQLERRM,1,30);
595: l_revenue_rejection_code := SUBSTR(SQLERRM,1,30);
596: IF g1_debug_mode = 'Y' THEN
597: pa_debug.g_err_stage:=' Get_plan_actual_Rates_api is throwing When Others';
598: pa_debug.write('Get_planning_Rates : ' || g_module_name,pa_debug.g_err_stage,3);
599: END IF;
600: RAISE l_Get_planning_Rates_api;
601: END;
594: l_burden_cost_rejection_code := SUBSTR(SQLERRM,1,30);
595: l_revenue_rejection_code := SUBSTR(SQLERRM,1,30);
596: IF g1_debug_mode = 'Y' THEN
597: pa_debug.g_err_stage:=' Get_plan_actual_Rates_api is throwing When Others';
598: pa_debug.write('Get_planning_Rates : ' || g_module_name,pa_debug.g_err_stage,3);
599: END IF;
600: RAISE l_Get_planning_Rates_api;
601: END;
602: ELSE
603:
604: -- Call pa_plan_revenue.Get_plan_plan_rates (parameters);
605:
606: IF g1_debug_mode = 'Y' THEN
607: pa_debug.g_err_stage:='Before Calling the Get_plan_plan_Rates:p_use_planning_rates_flag '||p_use_planning_rates_flag ;
608: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
609: END IF;
610: BEGIN
611: Get_plan_plan_Rates (
604: -- Call pa_plan_revenue.Get_plan_plan_rates (parameters);
605:
606: IF g1_debug_mode = 'Y' THEN
607: pa_debug.g_err_stage:='Before Calling the Get_plan_plan_Rates:p_use_planning_rates_flag '||p_use_planning_rates_flag ;
608: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
609: END IF;
610: BEGIN
611: Get_plan_plan_Rates (
612: p_project_id =>p_project_id ,
674: x_msg_count =>l_x_msg_count
675: );
676:
677: IF g1_debug_mode = 'Y' THEN
678: pa_debug.g_err_stage:='Called the Get_plan_plan_Rates:l_return_status'||l_x_return_status||'x_msg_data'||l_x_msg_data;
679: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
680: END IF;
681: IF g1_debug_mode = 'Y' THEN
682: pa_debug.g_err_stage:='Called the Get_plan_plan_Rates:x_cost_rej_code'||l_raw_cost_rejection_code||'l_burden_cost_rate'||l_txn_burden_cost_rate;
675: );
676:
677: IF g1_debug_mode = 'Y' THEN
678: pa_debug.g_err_stage:='Called the Get_plan_plan_Rates:l_return_status'||l_x_return_status||'x_msg_data'||l_x_msg_data;
679: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
680: END IF;
681: IF g1_debug_mode = 'Y' THEN
682: pa_debug.g_err_stage:='Called the Get_plan_plan_Rates:x_cost_rej_code'||l_raw_cost_rejection_code||'l_burden_cost_rate'||l_txn_burden_cost_rate;
683: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
678: pa_debug.g_err_stage:='Called the Get_plan_plan_Rates:l_return_status'||l_x_return_status||'x_msg_data'||l_x_msg_data;
679: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
680: END IF;
681: IF g1_debug_mode = 'Y' THEN
682: pa_debug.g_err_stage:='Called the Get_plan_plan_Rates:x_cost_rej_code'||l_raw_cost_rejection_code||'l_burden_cost_rate'||l_txn_burden_cost_rate;
683: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
684: END IF;
685: IF g1_debug_mode = 'Y' THEN
686: pa_debug.g_err_stage:='Called the Get_plan_plan_Rates:l_raw_cost'||l_raw_cost||'l_cost_rate'||l_txn_cost_rate||'l_cost_curr_code'||l_cost_txn_curr_code;
679: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
680: END IF;
681: IF g1_debug_mode = 'Y' THEN
682: pa_debug.g_err_stage:='Called the Get_plan_plan_Rates:x_cost_rej_code'||l_raw_cost_rejection_code||'l_burden_cost_rate'||l_txn_burden_cost_rate;
683: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
684: END IF;
685: IF g1_debug_mode = 'Y' THEN
686: pa_debug.g_err_stage:='Called the Get_plan_plan_Rates:l_raw_cost'||l_raw_cost||'l_cost_rate'||l_txn_cost_rate||'l_cost_curr_code'||l_cost_txn_curr_code;
687: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
682: pa_debug.g_err_stage:='Called the Get_plan_plan_Rates:x_cost_rej_code'||l_raw_cost_rejection_code||'l_burden_cost_rate'||l_txn_burden_cost_rate;
683: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
684: END IF;
685: IF g1_debug_mode = 'Y' THEN
686: pa_debug.g_err_stage:='Called the Get_plan_plan_Rates:l_raw_cost'||l_raw_cost||'l_cost_rate'||l_txn_cost_rate||'l_cost_curr_code'||l_cost_txn_curr_code;
687: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
688: END IF;
689: IF g1_debug_mode = 'Y' THEN
690: pa_debug.g_err_stage:='Called the Get_plan_plan_Rates:l_txn_bill_rate'||l_txn_bill_rate||'l_bill_markup'||l_bill_markup||'l_txn_bill_rate'||l_txn_bill_rate;
683: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
684: END IF;
685: IF g1_debug_mode = 'Y' THEN
686: pa_debug.g_err_stage:='Called the Get_plan_plan_Rates:l_raw_cost'||l_raw_cost||'l_cost_rate'||l_txn_cost_rate||'l_cost_curr_code'||l_cost_txn_curr_code;
687: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
688: END IF;
689: IF g1_debug_mode = 'Y' THEN
690: pa_debug.g_err_stage:='Called the Get_plan_plan_Rates:l_txn_bill_rate'||l_txn_bill_rate||'l_bill_markup'||l_bill_markup||'l_txn_bill_rate'||l_txn_bill_rate;
691: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
686: pa_debug.g_err_stage:='Called the Get_plan_plan_Rates:l_raw_cost'||l_raw_cost||'l_cost_rate'||l_txn_cost_rate||'l_cost_curr_code'||l_cost_txn_curr_code;
687: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
688: END IF;
689: IF g1_debug_mode = 'Y' THEN
690: pa_debug.g_err_stage:='Called the Get_plan_plan_Rates:l_txn_bill_rate'||l_txn_bill_rate||'l_bill_markup'||l_bill_markup||'l_txn_bill_rate'||l_txn_bill_rate;
691: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
692: END IF;
693: IF g1_debug_mode = 'Y' THEN
694: pa_debug.g_err_stage:='Called the Get_plan_plan_Rates:l_raw_revenue'||l_raw_revenue ||'rev_rej_code'||l_revenue_rejection_code||'revcurr_code'||l_rev_txn_curr_code;
687: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
688: END IF;
689: IF g1_debug_mode = 'Y' THEN
690: pa_debug.g_err_stage:='Called the Get_plan_plan_Rates:l_txn_bill_rate'||l_txn_bill_rate||'l_bill_markup'||l_bill_markup||'l_txn_bill_rate'||l_txn_bill_rate;
691: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
692: END IF;
693: IF g1_debug_mode = 'Y' THEN
694: pa_debug.g_err_stage:='Called the Get_plan_plan_Rates:l_raw_revenue'||l_raw_revenue ||'rev_rej_code'||l_revenue_rejection_code||'revcurr_code'||l_rev_txn_curr_code;
695: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
690: pa_debug.g_err_stage:='Called the Get_plan_plan_Rates:l_txn_bill_rate'||l_txn_bill_rate||'l_bill_markup'||l_bill_markup||'l_txn_bill_rate'||l_txn_bill_rate;
691: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
692: END IF;
693: IF g1_debug_mode = 'Y' THEN
694: pa_debug.g_err_stage:='Called the Get_plan_plan_Rates:l_raw_revenue'||l_raw_revenue ||'rev_rej_code'||l_revenue_rejection_code||'revcurr_code'||l_rev_txn_curr_code;
695: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
696: END IF;
697:
698:
691: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
692: END IF;
693: IF g1_debug_mode = 'Y' THEN
694: pa_debug.g_err_stage:='Called the Get_plan_plan_Rates:l_raw_revenue'||l_raw_revenue ||'rev_rej_code'||l_revenue_rejection_code||'revcurr_code'||l_rev_txn_curr_code;
695: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
696: END IF;
697:
698:
699: EXCEPTION
706: l_raw_cost_rejection_code := SUBSTR(SQLERRM,1,30);
707: l_burden_cost_rejection_code := SUBSTR(SQLERRM,1,30);
708: l_revenue_rejection_code := SUBSTR(SQLERRM,1,30);
709: IF g1_debug_mode = 'Y' THEN
710: pa_debug.g_err_stage:=' Get_plan_plan_Rates_api is throwing When Others';
711: pa_debug.write('Get_planning_Rates : ' || g_module_name,pa_debug.g_err_stage,1);
712: END IF;
713: RAISE l_Get_planning_Rates_api;
714: END;
707: l_burden_cost_rejection_code := SUBSTR(SQLERRM,1,30);
708: l_revenue_rejection_code := SUBSTR(SQLERRM,1,30);
709: IF g1_debug_mode = 'Y' THEN
710: pa_debug.g_err_stage:=' Get_plan_plan_Rates_api is throwing When Others';
711: pa_debug.write('Get_planning_Rates : ' || g_module_name,pa_debug.g_err_stage,1);
712: END IF;
713: RAISE l_Get_planning_Rates_api;
714: END;
715:
715:
716: END IF;/* End of check for calling for Actual or Planning rates Flow */
717:
718: IF g1_debug_mode = 'Y' THEN
719: pa_debug.g_err_stage:='validating for Calling the Get_plan_res_class_rates ';
720: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
721: END IF;
722: /* Calling the Resource Class Schedule if Rate is not computed based on the Actual Enginee */
723: /* here the l_schedule type is set based on l_raw_cost IS NULL OR l_raw_revenue IS NULL and also based
716: END IF;/* End of check for calling for Actual or Planning rates Flow */
717:
718: IF g1_debug_mode = 'Y' THEN
719: pa_debug.g_err_stage:='validating for Calling the Get_plan_res_class_rates ';
720: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
721: END IF;
722: /* Calling the Resource Class Schedule if Rate is not computed based on the Actual Enginee */
723: /* here the l_schedule type is set based on l_raw_cost IS NULL OR l_raw_revenue IS NULL and also based
724: on the p_calculate_mode also its decided whether to call the ressource class code to get the cost and revenue */
743: l_schedule_type:='COST';
744: END IF;
745: END IF;
746: IF g1_debug_mode = 'Y' THEN
747: pa_debug.g_err_stage:='Before Calling the Get_plan_res_class_rates:->l_schedule_type'||l_schedule_type||' l_raw_revenue'|| l_raw_revenue||'l_raw_cost'||l_raw_cost;
748: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
749: END IF;
750:
751: /* don't remove the NVLs, the idea is to pass the override rate or any derive rates to the output of the main api call */
744: END IF;
745: END IF;
746: IF g1_debug_mode = 'Y' THEN
747: pa_debug.g_err_stage:='Before Calling the Get_plan_res_class_rates:->l_schedule_type'||l_schedule_type||' l_raw_revenue'|| l_raw_revenue||'l_raw_cost'||l_raw_cost;
748: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
749: END IF;
750:
751: /* don't remove the NVLs, the idea is to pass the override rate or any derive rates to the output of the main api call */
752: /* The overrides should be otherway round, If the overrides present use the overrides else rates present
833: l_raw_cost_rejection_code := SUBSTR(SQLERRM,1,30);
834: l_burden_cost_rejection_code := SUBSTR(SQLERRM,1,30);
835: l_revenue_rejection_code := SUBSTR(SQLERRM,1,30);
836: IF g1_debug_mode = 'Y' THEN
837: pa_debug.g_err_stage:=' Get_plan_res_class_rates_api is throwing When Others';
838: pa_debug.write('Get_planing_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
839: END IF;
840: RAISE l_Get_planning_Rates_api;
841: END;
834: l_burden_cost_rejection_code := SUBSTR(SQLERRM,1,30);
835: l_revenue_rejection_code := SUBSTR(SQLERRM,1,30);
836: IF g1_debug_mode = 'Y' THEN
837: pa_debug.g_err_stage:=' Get_plan_res_class_rates_api is throwing When Others';
838: pa_debug.write('Get_planing_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
839: END IF;
840: RAISE l_Get_planning_Rates_api;
841: END;
842: ELSE
849: IF ( (l_schedule_type='COST' and l_raw_cost IS NULL )
850: OR (l_schedule_type='REVENUE' and l_raw_revenue IS NULL )
851: OR l_schedule_type IS NULL ) THEN
852: IF g1_debug_mode = 'Y' THEN
853: pa_debug.g_err_stage:='Now Calling the Get_plan_res_class_rates:->l_schedule_type'||l_schedule_type||' l_raw_revenue'|| l_raw_revenue||'l_raw_cost'||l_raw_cost;
854: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
855: END IF;
856: BEGIN
857: Get_plan_res_class_rates (
850: OR (l_schedule_type='REVENUE' and l_raw_revenue IS NULL )
851: OR l_schedule_type IS NULL ) THEN
852: IF g1_debug_mode = 'Y' THEN
853: pa_debug.g_err_stage:='Now Calling the Get_plan_res_class_rates:->l_schedule_type'||l_schedule_type||' l_raw_revenue'|| l_raw_revenue||'l_raw_cost'||l_raw_cost;
854: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
855: END IF;
856: BEGIN
857: Get_plan_res_class_rates (
858: p_project_type =>p_project_type
914: l_raw_cost_rejection_code := SUBSTR(SQLERRM,1,30);
915: l_burden_cost_rejection_code := SUBSTR(SQLERRM,1,30);
916: l_revenue_rejection_code := SUBSTR(SQLERRM,1,30);
917: IF g1_debug_mode = 'Y' THEN
918: pa_debug.g_err_stage:=' Get_plan_res_class_rates_api is throwing When Others';
919: pa_debug.write('Get_planing_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
920: END IF;
921: RAISE l_Get_planning_Rates_api;
922: END;
915: l_burden_cost_rejection_code := SUBSTR(SQLERRM,1,30);
916: l_revenue_rejection_code := SUBSTR(SQLERRM,1,30);
917: IF g1_debug_mode = 'Y' THEN
918: pa_debug.g_err_stage:=' Get_plan_res_class_rates_api is throwing When Others';
919: pa_debug.write('Get_planing_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
920: END IF;
921: RAISE l_Get_planning_Rates_api;
922: END;
923: /*++++++++++++++++++++++++++++++++++++++++++++++++++*/
921: RAISE l_Get_planning_Rates_api;
922: END;
923: /*++++++++++++++++++++++++++++++++++++++++++++++++++*/
924: IF g1_debug_mode = 'Y' THEN
925: pa_debug.g_err_stage:='after Get_plan_res_class_rates :return_status'||l_x_return_status||'msgdata'||l_x_msg_data||'rawcost_rej_code'||l_raw_cost_rejection_code;
926: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
927: END IF;
928: IF g1_debug_mode = 'Y' THEN
929: pa_debug.g_err_stage:='after Get_plan_res_class_rates :x_revenue_rejection_code'||l_revenue_rejection_code||'l_txn_raw_cost'||l_txn_raw_cost;
922: END;
923: /*++++++++++++++++++++++++++++++++++++++++++++++++++*/
924: IF g1_debug_mode = 'Y' THEN
925: pa_debug.g_err_stage:='after Get_plan_res_class_rates :return_status'||l_x_return_status||'msgdata'||l_x_msg_data||'rawcost_rej_code'||l_raw_cost_rejection_code;
926: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
927: END IF;
928: IF g1_debug_mode = 'Y' THEN
929: pa_debug.g_err_stage:='after Get_plan_res_class_rates :x_revenue_rejection_code'||l_revenue_rejection_code||'l_txn_raw_cost'||l_txn_raw_cost;
930: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
925: pa_debug.g_err_stage:='after Get_plan_res_class_rates :return_status'||l_x_return_status||'msgdata'||l_x_msg_data||'rawcost_rej_code'||l_raw_cost_rejection_code;
926: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
927: END IF;
928: IF g1_debug_mode = 'Y' THEN
929: pa_debug.g_err_stage:='after Get_plan_res_class_rates :x_revenue_rejection_code'||l_revenue_rejection_code||'l_txn_raw_cost'||l_txn_raw_cost;
930: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
931: END IF;
932: IF g1_debug_mode = 'Y' THEN
933: pa_debug.g_err_stage:='after Get_plan_res_class_rates :l_txn_burden_cost'||l_txn_burden_cost||'l_txn_raw_revenue'||l_txn_raw_revenue;
926: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
927: END IF;
928: IF g1_debug_mode = 'Y' THEN
929: pa_debug.g_err_stage:='after Get_plan_res_class_rates :x_revenue_rejection_code'||l_revenue_rejection_code||'l_txn_raw_cost'||l_txn_raw_cost;
930: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
931: END IF;
932: IF g1_debug_mode = 'Y' THEN
933: pa_debug.g_err_stage:='after Get_plan_res_class_rates :l_txn_burden_cost'||l_txn_burden_cost||'l_txn_raw_revenue'||l_txn_raw_revenue;
934: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
929: pa_debug.g_err_stage:='after Get_plan_res_class_rates :x_revenue_rejection_code'||l_revenue_rejection_code||'l_txn_raw_cost'||l_txn_raw_cost;
930: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
931: END IF;
932: IF g1_debug_mode = 'Y' THEN
933: pa_debug.g_err_stage:='after Get_plan_res_class_rates :l_txn_burden_cost'||l_txn_burden_cost||'l_txn_raw_revenue'||l_txn_raw_revenue;
934: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
935: END IF;
936: ELSE
937: l_txn_raw_cost := l_raw_cost;
930: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
931: END IF;
932: IF g1_debug_mode = 'Y' THEN
933: pa_debug.g_err_stage:='after Get_plan_res_class_rates :l_txn_burden_cost'||l_txn_burden_cost||'l_txn_raw_revenue'||l_txn_raw_revenue;
934: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
935: END IF;
936: ELSE
937: l_txn_raw_cost := l_raw_cost;
938: l_txn_burden_cost := l_burden_cost ;
952: END IF;/* IF p_raw_cost IS NOT NULL AND p_burden_cost IS NOT NULL AND p_raw_revenue IS NOT NULL THEN */
953: /* Assigning All the out parameters for the procedure */
954:
955: IF g1_debug_mode = 'Y' THEN
956: pa_debug.g_err_stage:='Setting all the out parameters for thr procedure';
957: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
958: END IF;
959:
960: x_bill_rate :=NVL(l_i_txn_bill_rate,l_txn_bill_rate);--4108291
953: /* Assigning All the out parameters for the procedure */
954:
955: IF g1_debug_mode = 'Y' THEN
956: pa_debug.g_err_stage:='Setting all the out parameters for thr procedure';
957: pa_debug.write('Get_planning_rates: ' || g_module_name,pa_debug.g_err_stage,3);
958: END IF;
959:
960: x_bill_rate :=NVL(l_i_txn_bill_rate,l_txn_bill_rate);--4108291
961: x_cost_rate :=NVL(l_i_txn_cost_rate,l_txn_cost_rate) ;--4108291
977: x_cost_ind_compiled_set_id :=l_cost_ind_compiled_set_id ;
978: x_return_status :=l_x_return_status;
979: x_msg_data :=l_x_msg_data;
980: x_msg_count :=l_x_msg_count;
981: PA_DEBUG.reset_err_stack;
982: EXCEPTION
983: WHEN l_rate_based_no_quantity THEN
984: IF g1_debug_mode = 'Y' THEN
985: pa_debug.g_err_stage:='Quantity is required for a rate based transaction ';
981: PA_DEBUG.reset_err_stack;
982: EXCEPTION
983: WHEN l_rate_based_no_quantity THEN
984: IF g1_debug_mode = 'Y' THEN
985: pa_debug.g_err_stage:='Quantity is required for a rate based transaction ';
986: pa_debug.write('Get_planning_Rates : ' || g_module_name,pa_debug.g_err_stage,1);
987: END IF;
988: x_return_status := g_ERROR;
989: x_msg_count := 1;
982: EXCEPTION
983: WHEN l_rate_based_no_quantity THEN
984: IF g1_debug_mode = 'Y' THEN
985: pa_debug.g_err_stage:='Quantity is required for a rate based transaction ';
986: pa_debug.write('Get_planning_Rates : ' || g_module_name,pa_debug.g_err_stage,1);
987: END IF;
988: x_return_status := g_ERROR;
989: x_msg_count := 1;
990: x_msg_data := 'PA_EX_QTY_EXIST';
996: x_cost_rate := NULL;
997: x_cost_txn_curr_code := NULL ;
998: x_rev_txn_curr_code := NULL ;
999:
1000: PA_DEBUG.reset_err_stack;
1001: WHEN l_invalid_currency THEN
1002: IF g1_debug_mode = 'Y' THEN
1003: pa_debug.g_err_stage:='Currecny Override is not entered for the ammounts entered';
1004: pa_debug.write('Get_planning_Rates : ' || g_module_name,pa_debug.g_err_stage,1);
999:
1000: PA_DEBUG.reset_err_stack;
1001: WHEN l_invalid_currency THEN
1002: IF g1_debug_mode = 'Y' THEN
1003: pa_debug.g_err_stage:='Currecny Override is not entered for the ammounts entered';
1004: pa_debug.write('Get_planning_Rates : ' || g_module_name,pa_debug.g_err_stage,1);
1005: END IF;
1006: x_return_status := g_ERROR;
1007: x_msg_count := 1;
1000: PA_DEBUG.reset_err_stack;
1001: WHEN l_invalid_currency THEN
1002: IF g1_debug_mode = 'Y' THEN
1003: pa_debug.g_err_stage:='Currecny Override is not entered for the ammounts entered';
1004: pa_debug.write('Get_planning_Rates : ' || g_module_name,pa_debug.g_err_stage,1);
1005: END IF;
1006: x_return_status := g_ERROR;
1007: x_msg_count := 1;
1008: x_msg_data := 'PA_INVALID_DENOM_CURRENCY';
1014: x_cost_rate := NULL ;
1015: x_cost_txn_curr_code := NULL ;
1016: x_rev_txn_curr_code := NULL ;
1017:
1018: PA_DEBUG.reset_err_stack;
1019: WHEN l_Get_planning_Rates_api THEN
1020: IF g1_debug_mode = 'Y' THEN
1021: pa_debug.g_err_stage:='plan_actual_Rates r Plan_plan_rates r res_class_rates throwing When Others:p_project_id'||p_project_id||'p_task_id'||p_task_id;
1022: pa_debug.write('Get_planning_Rates : ' || g_module_name,pa_debug.g_err_stage,1);
1017:
1018: PA_DEBUG.reset_err_stack;
1019: WHEN l_Get_planning_Rates_api THEN
1020: IF g1_debug_mode = 'Y' THEN
1021: pa_debug.g_err_stage:='plan_actual_Rates r Plan_plan_rates r res_class_rates throwing When Others:p_project_id'||p_project_id||'p_task_id'||p_task_id;
1022: pa_debug.write('Get_planning_Rates : ' || g_module_name,pa_debug.g_err_stage,1);
1023: END IF;
1024: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1025: x_msg_count := 1;
1018: PA_DEBUG.reset_err_stack;
1019: WHEN l_Get_planning_Rates_api THEN
1020: IF g1_debug_mode = 'Y' THEN
1021: pa_debug.g_err_stage:='plan_actual_Rates r Plan_plan_rates r res_class_rates throwing When Others:p_project_id'||p_project_id||'p_task_id'||p_task_id;
1022: pa_debug.write('Get_planning_Rates : ' || g_module_name,pa_debug.g_err_stage,1);
1023: END IF;
1024: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1025: x_msg_count := 1;
1026: x_msg_data := l_x_msg_data ;
1034: x_cost_txn_curr_code := NULL;
1035: x_rev_txn_curr_code := NULL;
1036: x_bill_markup_percentage := NULL;
1037:
1038: PA_DEBUG.reset_err_stack;
1039:
1040: WHEN OTHERS THEN
1041: IF g1_debug_mode = 'Y' THEN
1042: pa_debug.g_err_stage:='In the when others of Get_Planning_Rates:p_project_id'||p_project_id||'p_task_id'||p_task_id;
1038: PA_DEBUG.reset_err_stack;
1039:
1040: WHEN OTHERS THEN
1041: IF g1_debug_mode = 'Y' THEN
1042: pa_debug.g_err_stage:='In the when others of Get_Planning_Rates:p_project_id'||p_project_id||'p_task_id'||p_task_id;
1043: pa_debug.write('Get_planing_Rates : ' || g_module_name,pa_debug.g_err_stage,1);
1044: END IF;
1045: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1046: x_msg_count := 1;
1039:
1040: WHEN OTHERS THEN
1041: IF g1_debug_mode = 'Y' THEN
1042: pa_debug.g_err_stage:='In the when others of Get_Planning_Rates:p_project_id'||p_project_id||'p_task_id'||p_task_id;
1043: pa_debug.write('Get_planing_Rates : ' || g_module_name,pa_debug.g_err_stage,1);
1044: END IF;
1045: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1046: x_msg_count := 1;
1047: x_msg_data := 'Get_Planning_Rates'||SUBSTR(SQLERRM,1,250);
1055: x_cost_txn_curr_code := NULL;
1056: x_rev_txn_curr_code := NULL;
1057: x_bill_markup_percentage := NULL;
1058:
1059: PA_DEBUG.reset_err_stack;
1060:
1061: END Get_Planning_Rates;
1062:
1063:
1205: END IF;
1206: IF ((p_raw_cost IS NULL OR p_burden_cost IS NULL)
1207: AND p_calculate_mode IN ('COST','COST_REVENUE')) THEN
1208: IF g1_debug_mode = 'Y' THEN
1209: pa_debug.g_err_stage:='Before Calling PA_COST1.Get_Plan_Actual_Cost_Rates';
1210: pa_debug.write('Get_plan_actual_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1211: END IF;
1212:
1213: BEGIN
1206: IF ((p_raw_cost IS NULL OR p_burden_cost IS NULL)
1207: AND p_calculate_mode IN ('COST','COST_REVENUE')) THEN
1208: IF g1_debug_mode = 'Y' THEN
1209: pa_debug.g_err_stage:='Before Calling PA_COST1.Get_Plan_Actual_Cost_Rates';
1210: pa_debug.write('Get_plan_actual_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1211: END IF;
1212:
1213: BEGIN
1214: PA_COST1.Get_Plan_Actual_Cost_Rates
1256: ,x_return_status =>l_x_return_status
1257: ,x_error_msg_code =>l_cost_msg_data ) ;
1258:
1259: IF g1_debug_mode = 'Y' THEN
1260: pa_debug.g_err_stage:='Called PA_COST1.Get_Plan_Actual_Cost_Rates:l_x_return_status'||l_x_return_status||'l_msg_data'||l_cost_msg_data||'x_cost_rej_code'||l_raw_cost_rejection_code;
1261: pa_debug.write('Get_plan_actual_Rates : ' || g_module_name,pa_debug.g_err_stage,3);
1262: END IF;
1263: IF g1_debug_mode = 'Y' THEN
1264: pa_debug.g_err_stage:='Called PA_COST1.Get_Plan_Actual_Cost_Rates:x_burden_rej_code'||l_burden_cost_rejection_code||'l_txn_raw_cost'||l_txn_raw_cost;
1257: ,x_error_msg_code =>l_cost_msg_data ) ;
1258:
1259: IF g1_debug_mode = 'Y' THEN
1260: pa_debug.g_err_stage:='Called PA_COST1.Get_Plan_Actual_Cost_Rates:l_x_return_status'||l_x_return_status||'l_msg_data'||l_cost_msg_data||'x_cost_rej_code'||l_raw_cost_rejection_code;
1261: pa_debug.write('Get_plan_actual_Rates : ' || g_module_name,pa_debug.g_err_stage,3);
1262: END IF;
1263: IF g1_debug_mode = 'Y' THEN
1264: pa_debug.g_err_stage:='Called PA_COST1.Get_Plan_Actual_Cost_Rates:x_burden_rej_code'||l_burden_cost_rejection_code||'l_txn_raw_cost'||l_txn_raw_cost;
1265: pa_debug.write('Get_plan_actual_Rates : ' || g_module_name,pa_debug.g_err_stage,3);
1260: pa_debug.g_err_stage:='Called PA_COST1.Get_Plan_Actual_Cost_Rates:l_x_return_status'||l_x_return_status||'l_msg_data'||l_cost_msg_data||'x_cost_rej_code'||l_raw_cost_rejection_code;
1261: pa_debug.write('Get_plan_actual_Rates : ' || g_module_name,pa_debug.g_err_stage,3);
1262: END IF;
1263: IF g1_debug_mode = 'Y' THEN
1264: pa_debug.g_err_stage:='Called PA_COST1.Get_Plan_Actual_Cost_Rates:x_burden_rej_code'||l_burden_cost_rejection_code||'l_txn_raw_cost'||l_txn_raw_cost;
1265: pa_debug.write('Get_plan_actual_Rates : ' || g_module_name,pa_debug.g_err_stage,3);
1266: END IF;
1267: IF g1_debug_mode = 'Y' THEN
1268: pa_debug.g_err_stage:='Called PA_COST1.Get_Plan_Actual_Cost_Rates:l_txn_cost_rate'||l_txn_cost_rate||'l_trxn_curr_code'||l_trxn_curr_code;
1261: pa_debug.write('Get_plan_actual_Rates : ' || g_module_name,pa_debug.g_err_stage,3);
1262: END IF;
1263: IF g1_debug_mode = 'Y' THEN
1264: pa_debug.g_err_stage:='Called PA_COST1.Get_Plan_Actual_Cost_Rates:x_burden_rej_code'||l_burden_cost_rejection_code||'l_txn_raw_cost'||l_txn_raw_cost;
1265: pa_debug.write('Get_plan_actual_Rates : ' || g_module_name,pa_debug.g_err_stage,3);
1266: END IF;
1267: IF g1_debug_mode = 'Y' THEN
1268: pa_debug.g_err_stage:='Called PA_COST1.Get_Plan_Actual_Cost_Rates:l_txn_cost_rate'||l_txn_cost_rate||'l_trxn_curr_code'||l_trxn_curr_code;
1269: pa_debug.write('Get_plan_actual_Rates : ' || g_module_name,pa_debug.g_err_stage,3);
1264: pa_debug.g_err_stage:='Called PA_COST1.Get_Plan_Actual_Cost_Rates:x_burden_rej_code'||l_burden_cost_rejection_code||'l_txn_raw_cost'||l_txn_raw_cost;
1265: pa_debug.write('Get_plan_actual_Rates : ' || g_module_name,pa_debug.g_err_stage,3);
1266: END IF;
1267: IF g1_debug_mode = 'Y' THEN
1268: pa_debug.g_err_stage:='Called PA_COST1.Get_Plan_Actual_Cost_Rates:l_txn_cost_rate'||l_txn_cost_rate||'l_trxn_curr_code'||l_trxn_curr_code;
1269: pa_debug.write('Get_plan_actual_Rates : ' || g_module_name,pa_debug.g_err_stage,3);
1270: END IF;
1271: EXCEPTION
1272: WHEN OTHERS THEN
1265: pa_debug.write('Get_plan_actual_Rates : ' || g_module_name,pa_debug.g_err_stage,3);
1266: END IF;
1267: IF g1_debug_mode = 'Y' THEN
1268: pa_debug.g_err_stage:='Called PA_COST1.Get_Plan_Actual_Cost_Rates:l_txn_cost_rate'||l_txn_cost_rate||'l_trxn_curr_code'||l_trxn_curr_code;
1269: pa_debug.write('Get_plan_actual_Rates : ' || g_module_name,pa_debug.g_err_stage,3);
1270: END IF;
1271: EXCEPTION
1272: WHEN OTHERS THEN
1273: x_msg_data := 'PA_COST1.Get_Plan_Actual_Cost_Rates:' || SUBSTR(SQLERRM,1,250);
1275: x_burden_cost_rejection_code := SUBSTR(SQLERRM,1,30);
1276: x_return_status:=FND_API.G_RET_STS_UNEXP_ERROR;
1277:
1278: IF g1_debug_mode = 'Y' THEN
1279: pa_debug.g_err_stage:=' PA_COST1.Get_Plan_Actual_Cost_Rates is throwing When Others';
1280: pa_debug.write('Get_plan_actual_Rates : ' || g_module_name,pa_debug.g_err_stage,1);
1281: END IF;
1282: RAISE;
1283: -- RAISE l_Get_plan_actual_Rates; /* Added to handle exception return by costing api */
1276: x_return_status:=FND_API.G_RET_STS_UNEXP_ERROR;
1277:
1278: IF g1_debug_mode = 'Y' THEN
1279: pa_debug.g_err_stage:=' PA_COST1.Get_Plan_Actual_Cost_Rates is throwing When Others';
1280: pa_debug.write('Get_plan_actual_Rates : ' || g_module_name,pa_debug.g_err_stage,1);
1281: END IF;
1282: RAISE;
1283: -- RAISE l_Get_plan_actual_Rates; /* Added to handle exception return by costing api */
1284: END;
1336: END IF;
1337: END IF;
1338:
1339: IF g1_debug_mode = 'Y' THEN
1340: pa_debug.g_err_stage:='Calling Get_Plan_Actual_Rev_Rates';
1341: pa_debug.write('Get_plan_actual_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1342: END IF;
1343:
1344: Get_Plan_Actual_Rev_Rates (
1337: END IF;
1338:
1339: IF g1_debug_mode = 'Y' THEN
1340: pa_debug.g_err_stage:='Calling Get_Plan_Actual_Rev_Rates';
1341: pa_debug.write('Get_plan_actual_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1342: END IF;
1343:
1344: Get_Plan_Actual_Rev_Rates (
1345: p_project_id => p_project_id ,
1398: x_msg_data => l_bill_msg_data,
1399: x_msg_count => l_bill_msg_count
1400: );
1401: IF g1_debug_mode = 'Y' THEN
1402: pa_debug.g_err_stage:='OUT of Get_Plan_Actual_Rev_Rates:l_x_return_status'||l_x_return_status||'l_bill_msg_data'||l_bill_msg_data||'l_txn_raw_revenue'||l_txn_raw_revenue;
1403: pa_debug.write('Get_plan_actual_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1404: END IF;
1405:
1406: /* Raising the Billing Exception to pass the error values to the Main Api */
1399: x_msg_count => l_bill_msg_count
1400: );
1401: IF g1_debug_mode = 'Y' THEN
1402: pa_debug.g_err_stage:='OUT of Get_Plan_Actual_Rev_Rates:l_x_return_status'||l_x_return_status||'l_bill_msg_data'||l_bill_msg_data||'l_txn_raw_revenue'||l_txn_raw_revenue;
1403: pa_debug.write('Get_plan_actual_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1404: END IF;
1405:
1406: /* Raising the Billing Exception to pass the error values to the Main Api */
1407: IF l_x_return_status <> g_success THEN
1431: EXCEPTION
1432: WHEN l_invalid_currency THEN
1433:
1434: IF g1_debug_mode = 'Y' THEN
1435: pa_debug.g_err_stage:='Currecny Override is not entered for the ammounts entered:p_project_id'||p_project_id||'p_task_id'||p_task_id;
1436: pa_debug.write('Get_plan_actual_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1437: END IF;
1438: x_return_status := g_ERROR;
1439: x_msg_count := 1;
1432: WHEN l_invalid_currency THEN
1433:
1434: IF g1_debug_mode = 'Y' THEN
1435: pa_debug.g_err_stage:='Currecny Override is not entered for the ammounts entered:p_project_id'||p_project_id||'p_task_id'||p_task_id;
1436: pa_debug.write('Get_plan_actual_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1437: END IF;
1438: x_return_status := g_ERROR;
1439: x_msg_count := 1;
1440: x_msg_data := 'PA_INVALID_DENOM_CURRENCY';
1456: x_msg_count := 1;
1457:
1458:
1459: IF g1_debug_mode = 'Y' THEN
1460: pa_debug.g_err_stage:='No Cost exist for the tranascation:p_project_id'||p_project_id||'p_task_id'||p_task_id;
1461: pa_debug.write('Get_plan_actual_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1462: END IF;
1463: WHEN l_bill_api THEN
1464: x_raw_revenue := NULL;
1457:
1458:
1459: IF g1_debug_mode = 'Y' THEN
1460: pa_debug.g_err_stage:='No Cost exist for the tranascation:p_project_id'||p_project_id||'p_task_id'||p_task_id;
1461: pa_debug.write('Get_plan_actual_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1462: END IF;
1463: WHEN l_bill_api THEN
1464: x_raw_revenue := NULL;
1465: x_bill_rate := NULL;
1470: x_msg_data := l_bill_msg_data;
1471: x_msg_count := l_bill_msg_count;
1472:
1473: IF g1_debug_mode = 'Y' THEN
1474: pa_debug.g_err_stage:='Billing api is throwing error';
1475: pa_debug.write('Get_plan_actual_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1476: END IF;
1477:
1478:
1471: x_msg_count := l_bill_msg_count;
1472:
1473: IF g1_debug_mode = 'Y' THEN
1474: pa_debug.g_err_stage:='Billing api is throwing error';
1475: pa_debug.write('Get_plan_actual_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1476: END IF;
1477:
1478:
1479: END Get_plan_actual_Rates;
1576: l_quantity NUMBER:=NULL; --bug#4284806
1577:
1578: BEGIN
1579: IF g1_debug_mode = 'Y' THEN
1580: pa_debug.g_err_stage:='Validating all the input parameters';
1581: pa_debug.write('Get_plan_actual_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1582: END IF;
1583:
1584:
1577:
1578: BEGIN
1579: IF g1_debug_mode = 'Y' THEN
1580: pa_debug.g_err_stage:='Validating all the input parameters';
1581: pa_debug.write('Get_plan_actual_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1582: END IF;
1583:
1584:
1585: IF p_system_linkage='BTC' THEN
1591: END IF;
1592:
1593: IF p_revenue_override_rate IS NOT NULL AND p_override_currency_code IS NULL THEN
1594: IF g1_debug_mode = 'Y' THEN
1595: pa_debug.g_err_stage:='Validating Get_plan_actual_rev_Rates:p_override_currency_code is required if passing any overrides';
1596: pa_debug.write('Get_plan_actual_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1597: END IF;
1598: RAISE l_invalid_currency;
1599: END IF;
1592:
1593: IF p_revenue_override_rate IS NOT NULL AND p_override_currency_code IS NULL THEN
1594: IF g1_debug_mode = 'Y' THEN
1595: pa_debug.g_err_stage:='Validating Get_plan_actual_rev_Rates:p_override_currency_code is required if passing any overrides';
1596: pa_debug.write('Get_plan_actual_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1597: END IF;
1598: RAISE l_invalid_currency;
1599: END IF;
1600: IF p_rate_based_flag ='Y' AND p_quantity IS NULL
1599: END IF;
1600: IF p_rate_based_flag ='Y' AND p_quantity IS NULL
1601: AND NVL(l_override_cost,0)=0 THEN
1602: IF g1_debug_mode = 'Y' THEN
1603: pa_debug.g_err_stage:='Validating Get_plan_actual_rev_Rates:p_quantity is required for rate based';
1604: pa_debug.write('Get_plan_actual_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1605: END IF;
1606: RAISE l_rate_based_no_quantity;
1607: END IF;
1600: IF p_rate_based_flag ='Y' AND p_quantity IS NULL
1601: AND NVL(l_override_cost,0)=0 THEN
1602: IF g1_debug_mode = 'Y' THEN
1603: pa_debug.g_err_stage:='Validating Get_plan_actual_rev_Rates:p_quantity is required for rate based';
1604: pa_debug.write('Get_plan_actual_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1605: END IF;
1606: RAISE l_rate_based_no_quantity;
1607: END IF;
1608: /* If revenue Override rate is not null compute the raw_revenue based on the override rate and the p_quantity or rawCost */
1639:
1640: /* Going to Call the Core Billing API for Revenue Calculation based on the Resource Class */
1641: IF p_resource_class='PEOPLE' THEN
1642: IF g1_debug_mode = 'Y' THEN
1643: pa_debug.g_err_stage:='Calling PA_REVENUE.Assignment_Rev_Amt';
1644: pa_debug.write('Get_plan_actual_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1645: END IF;
1646:
1647: PA_REVENUE.Assignment_Rev_Amt(
1640: /* Going to Call the Core Billing API for Revenue Calculation based on the Resource Class */
1641: IF p_resource_class='PEOPLE' THEN
1642: IF g1_debug_mode = 'Y' THEN
1643: pa_debug.g_err_stage:='Calling PA_REVENUE.Assignment_Rev_Amt';
1644: pa_debug.write('Get_plan_actual_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1645: END IF;
1646:
1647: PA_REVENUE.Assignment_Rev_Amt(
1648: p_project_id => p_project_id ,
1690: x_return_status => l_x_return_status ,
1691: x_msg_count => l_msg_count ,
1692: x_msg_data => l_msg_data );
1693: IF g1_debug_mode = 'Y' THEN
1694: pa_debug.g_err_stage:='assignment_Rev_amount :l_return_status'||l_x_return_status||'l_msg_data'||l_msg_data||'l_raw_revenue'||l_txn_raw_revenue||'l_bill_rate'||l_txn_bill_rate||'l_bill_markup'||l_txn_bill_markup;
1695: pa_debug.write('Get_plan_actual_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1696: END IF;
1697:
1698:
1691: x_msg_count => l_msg_count ,
1692: x_msg_data => l_msg_data );
1693: IF g1_debug_mode = 'Y' THEN
1694: pa_debug.g_err_stage:='assignment_Rev_amount :l_return_status'||l_x_return_status||'l_msg_data'||l_msg_data||'l_raw_revenue'||l_txn_raw_revenue||'l_bill_rate'||l_txn_bill_rate||'l_bill_markup'||l_txn_bill_markup;
1695: pa_debug.write('Get_plan_actual_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1696: END IF;
1697:
1698:
1699: if NVL(p_rate_based_flag,'N') = 'N' then
1708: ELSE
1709:
1710: /* Expenditure Type is checked for UOM determination and to calculate p_uom_flag */
1711: IF g1_debug_mode = 'Y' THEN
1712: pa_debug.g_err_stage:='========g_expenditure_type_tbl.COUNT'||g_expenditure_type_tbl.COUNT;
1713: pa_debug.write('Get_plan_actual_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1714: END IF;
1715:
1716: FOR i IN g_expenditure_type_tbl.FIRST .. g_expenditure_type_tbl.LAST LOOP
1709:
1710: /* Expenditure Type is checked for UOM determination and to calculate p_uom_flag */
1711: IF g1_debug_mode = 'Y' THEN
1712: pa_debug.g_err_stage:='========g_expenditure_type_tbl.COUNT'||g_expenditure_type_tbl.COUNT;
1713: pa_debug.write('Get_plan_actual_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1714: END IF;
1715:
1716: FOR i IN g_expenditure_type_tbl.FIRST .. g_expenditure_type_tbl.LAST LOOP
1717: IF p_expenditure_type =g_expenditure_type_tbl(i) THEN
1715:
1716: FOR i IN g_expenditure_type_tbl.FIRST .. g_expenditure_type_tbl.LAST LOOP
1717: IF p_expenditure_type =g_expenditure_type_tbl(i) THEN
1718: IF g1_debug_mode = 'Y' THEN
1719: pa_debug.g_err_stage:='expendirure Type is::::'|| g_expenditure_type_tbl(i) ;
1720: pa_debug.write('Get_plan_actual_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1721: END IF;
1722: IF g_uom_tbl.EXISTS(i) THEN
1723: l_uom := g_uom_tbl(i);
1716: FOR i IN g_expenditure_type_tbl.FIRST .. g_expenditure_type_tbl.LAST LOOP
1717: IF p_expenditure_type =g_expenditure_type_tbl(i) THEN
1718: IF g1_debug_mode = 'Y' THEN
1719: pa_debug.g_err_stage:='expendirure Type is::::'|| g_expenditure_type_tbl(i) ;
1720: pa_debug.write('Get_plan_actual_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1721: END IF;
1722: IF g_uom_tbl.EXISTS(i) THEN
1723: l_uom := g_uom_tbl(i);
1724: END IF;
1731: ELSE
1732: l_uom_flag:=1 ;
1733: END IF;
1734: IF g1_debug_mode = 'Y' THEN
1735: pa_debug.g_err_stage:='l_uom is::::::'|| l_uom||'p_uom '||p_uom||'l_uom_flag'||l_uom_flag ;
1736: pa_debug.write('Get_plan_actual_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1737: END IF;
1738:
1739:
1732: l_uom_flag:=1 ;
1733: END IF;
1734: IF g1_debug_mode = 'Y' THEN
1735: pa_debug.g_err_stage:='l_uom is::::::'|| l_uom||'p_uom '||p_uom||'l_uom_flag'||l_uom_flag ;
1736: pa_debug.write('Get_plan_actual_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1737: END IF;
1738:
1739:
1740: IF g1_debug_mode = 'Y' THEN
1737: END IF;
1738:
1739:
1740: IF g1_debug_mode = 'Y' THEN
1741: pa_debug.g_err_stage:='Before Calling pa_revenue.Non_Labor_Rev_amount';
1742: pa_debug.write('Get_plan_actual_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1743: END IF;
1744:
1745: pa_revenue.Non_Labor_Rev_amount(
1738:
1739:
1740: IF g1_debug_mode = 'Y' THEN
1741: pa_debug.g_err_stage:='Before Calling pa_revenue.Non_Labor_Rev_amount';
1742: pa_debug.write('Get_plan_actual_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1743: END IF;
1744:
1745: pa_revenue.Non_Labor_Rev_amount(
1746: p_called_process =>l_called_process ,
1785: x_return_status => l_x_return_status,
1786: x_msg_count => l_msg_count,
1787: x_msg_data => l_msg_data);
1788: IF g1_debug_mode = 'Y' THEN
1789: pa_debug.g_err_stage:='Non_Labor_Rev_amount :l_return_status'||l_x_return_status||'l_msg_data'||l_msg_data||'l_raw_revenue'||l_txn_raw_revenue||'l_bill_rate'||l_txn_bill_rate||'l_bill_markup'||l_txn_bill_markup;
1790: pa_debug.write('Get_plan_actual_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1791: END IF;
1792: if NVL(p_rate_based_flag,'N') = 'N' then
1793: l_txn_bill_rate := NULL;
1786: x_msg_count => l_msg_count,
1787: x_msg_data => l_msg_data);
1788: IF g1_debug_mode = 'Y' THEN
1789: pa_debug.g_err_stage:='Non_Labor_Rev_amount :l_return_status'||l_x_return_status||'l_msg_data'||l_msg_data||'l_raw_revenue'||l_txn_raw_revenue||'l_bill_rate'||l_txn_bill_rate||'l_bill_markup'||l_txn_bill_markup;
1790: pa_debug.write('Get_plan_actual_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1791: END IF;
1792: if NVL(p_rate_based_flag,'N') = 'N' then
1793: l_txn_bill_rate := NULL;
1794: l_txn_adjusted_bill_rate:=NULL;
1801: END IF;/*IF p_resource_class='PEOPLE' THEN */
1802: END IF;/* End if of l_raw_revenue IS NULL THEN*/
1803:
1804: IF g1_debug_mode = 'Y' THEN
1805: pa_debug.g_err_stage:='Get_Plan_Actual_Rev_Rates :l_raw_revenue'||l_txn_raw_revenue||'l_bill_rate:'||l_txn_bill_rate||'l_bill_markup:'||l_txn_bill_markup||'l_txn_adjusted_bill_rate:'||l_txn_adjusted_bill_rate;
1806: pa_debug.write('Get_plan_actual_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1807: END IF;
1808: x_raw_revenue :=l_txn_raw_revenue;
1809: x_bill_rate :=NVL(l_txn_adjusted_bill_rate,l_txn_bill_rate) ;--4038485
1802: END IF;/* End if of l_raw_revenue IS NULL THEN*/
1803:
1804: IF g1_debug_mode = 'Y' THEN
1805: pa_debug.g_err_stage:='Get_Plan_Actual_Rev_Rates :l_raw_revenue'||l_txn_raw_revenue||'l_bill_rate:'||l_txn_bill_rate||'l_bill_markup:'||l_txn_bill_markup||'l_txn_adjusted_bill_rate:'||l_txn_adjusted_bill_rate;
1806: pa_debug.write('Get_plan_actual_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1807: END IF;
1808: x_raw_revenue :=l_txn_raw_revenue;
1809: x_bill_rate :=NVL(l_txn_adjusted_bill_rate,l_txn_bill_rate) ;--4038485
1810: x_bill_markup_percentage :=l_txn_bill_markup;
1821: x_msg_data := l_msg_data;
1822: x_msg_count := l_msg_count;
1823:
1824: IF g1_debug_mode = 'Y' THEN
1825: pa_debug.g_err_stage:='Billing api is throwing error :p_project_id'||p_project_id||'p_task_id'||p_task_id;
1826: pa_debug.write('Get_plan_actual_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1827: END IF;
1828:
1829: WHEN l_rate_based_no_quantity THEN
1822: x_msg_count := l_msg_count;
1823:
1824: IF g1_debug_mode = 'Y' THEN
1825: pa_debug.g_err_stage:='Billing api is throwing error :p_project_id'||p_project_id||'p_task_id'||p_task_id;
1826: pa_debug.write('Get_plan_actual_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1827: END IF;
1828:
1829: WHEN l_rate_based_no_quantity THEN
1830: x_raw_revenue :=NULL;
1835: x_msg_data := 'PA_EX_QTY_EXIST';
1836: x_msg_count := 1;
1837:
1838: IF g1_debug_mode = 'Y' THEN
1839: pa_debug.g_err_stage:='Quantity is not passed to a rate based tranaction to the Get_Plan_Actual_Rev_Rates call';
1840: pa_debug.write('Get_plan_actual_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1841: END IF;
1842: WHEN l_invalid_currency THEN
1843: x_raw_revenue :=NULL;
1836: x_msg_count := 1;
1837:
1838: IF g1_debug_mode = 'Y' THEN
1839: pa_debug.g_err_stage:='Quantity is not passed to a rate based tranaction to the Get_Plan_Actual_Rev_Rates call';
1840: pa_debug.write('Get_plan_actual_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1841: END IF;
1842: WHEN l_invalid_currency THEN
1843: x_raw_revenue :=NULL;
1844: x_bill_rate :=NULL;
1848: x_msg_data := 'PA_INVALID_DENOM_CURRENCY';
1849: x_msg_count := 1;
1850:
1851: IF g1_debug_mode = 'Y' THEN
1852: pa_debug.g_err_stage:='Override Currency is not passed to a rate based tranaction to the Get_Plan_Actual_Rev_Rates call';
1853: pa_debug.write('Get_plan_actual_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1854: END IF;
1855:
1856:
1849: x_msg_count := 1;
1850:
1851: IF g1_debug_mode = 'Y' THEN
1852: pa_debug.g_err_stage:='Override Currency is not passed to a rate based tranaction to the Get_Plan_Actual_Rev_Rates call';
1853: pa_debug.write('Get_plan_actual_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
1854: END IF;
1855:
1856:
1857: END Get_Plan_Actual_Rev_Rates;
1960: l_ovr_msg_data VARCHAR2(1000);
1961:
1962: BEGIN
1963:
1964: pa_debug.init_err_stack('PA_PLAN_REVENUE.Get_plan_res_class_rates');
1965:
1966: IF g1_debug_mode = 'Y' THEN
1967: pa_debug.g_err_stage:='Validating input parameters:->p_schedule_type'||p_schedule_type||'p_rate_based_flag'||p_rate_based_flag||'p_uom'||p_uom||'p_raw_cost'||p_raw_cost||'p_raw_revenue'||p_raw_revenue;
1968: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
1963:
1964: pa_debug.init_err_stack('PA_PLAN_REVENUE.Get_plan_res_class_rates');
1965:
1966: IF g1_debug_mode = 'Y' THEN
1967: pa_debug.g_err_stage:='Validating input parameters:->p_schedule_type'||p_schedule_type||'p_rate_based_flag'||p_rate_based_flag||'p_uom'||p_uom||'p_raw_cost'||p_raw_cost||'p_raw_revenue'||p_raw_revenue;
1968: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
1969: END IF;
1970: IF g1_debug_mode = 'Y' THEN
1971: pa_debug.g_err_stage:='Validating input parameters:->p_use_planning_rates_flag '||p_use_planning_rates_flag ||'p_plan_burden_cost_sch_id '||p_plan_burden_cost_sch_id ;
1964: pa_debug.init_err_stack('PA_PLAN_REVENUE.Get_plan_res_class_rates');
1965:
1966: IF g1_debug_mode = 'Y' THEN
1967: pa_debug.g_err_stage:='Validating input parameters:->p_schedule_type'||p_schedule_type||'p_rate_based_flag'||p_rate_based_flag||'p_uom'||p_uom||'p_raw_cost'||p_raw_cost||'p_raw_revenue'||p_raw_revenue;
1968: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
1969: END IF;
1970: IF g1_debug_mode = 'Y' THEN
1971: pa_debug.g_err_stage:='Validating input parameters:->p_use_planning_rates_flag '||p_use_planning_rates_flag ||'p_plan_burden_cost_sch_id '||p_plan_burden_cost_sch_id ;
1972: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
1967: pa_debug.g_err_stage:='Validating input parameters:->p_schedule_type'||p_schedule_type||'p_rate_based_flag'||p_rate_based_flag||'p_uom'||p_uom||'p_raw_cost'||p_raw_cost||'p_raw_revenue'||p_raw_revenue;
1968: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
1969: END IF;
1970: IF g1_debug_mode = 'Y' THEN
1971: pa_debug.g_err_stage:='Validating input parameters:->p_use_planning_rates_flag '||p_use_planning_rates_flag ||'p_plan_burden_cost_sch_id '||p_plan_burden_cost_sch_id ;
1972: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
1973: END IF;
1974: IF g1_debug_mode = 'Y' THEN
1975: pa_debug.g_err_stage:='Validating input parameters:->p_nlr_organization_id '||p_nlr_organization_id ||'p_expenditure_org_id '||p_expenditure_org_id ||'p_override_to_organz_id '||p_override_to_organz_id;
1968: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
1969: END IF;
1970: IF g1_debug_mode = 'Y' THEN
1971: pa_debug.g_err_stage:='Validating input parameters:->p_use_planning_rates_flag '||p_use_planning_rates_flag ||'p_plan_burden_cost_sch_id '||p_plan_burden_cost_sch_id ;
1972: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
1973: END IF;
1974: IF g1_debug_mode = 'Y' THEN
1975: pa_debug.g_err_stage:='Validating input parameters:->p_nlr_organization_id '||p_nlr_organization_id ||'p_expenditure_org_id '||p_expenditure_org_id ||'p_override_to_organz_id '||p_override_to_organz_id;
1976: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
1971: pa_debug.g_err_stage:='Validating input parameters:->p_use_planning_rates_flag '||p_use_planning_rates_flag ||'p_plan_burden_cost_sch_id '||p_plan_burden_cost_sch_id ;
1972: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
1973: END IF;
1974: IF g1_debug_mode = 'Y' THEN
1975: pa_debug.g_err_stage:='Validating input parameters:->p_nlr_organization_id '||p_nlr_organization_id ||'p_expenditure_org_id '||p_expenditure_org_id ||'p_override_to_organz_id '||p_override_to_organz_id;
1976: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
1977: END IF;
1978:
1979: IF g1_debug_mode = 'Y' THEN
1972: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
1973: END IF;
1974: IF g1_debug_mode = 'Y' THEN
1975: pa_debug.g_err_stage:='Validating input parameters:->p_nlr_organization_id '||p_nlr_organization_id ||'p_expenditure_org_id '||p_expenditure_org_id ||'p_override_to_organz_id '||p_override_to_organz_id;
1976: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
1977: END IF;
1978:
1979: IF g1_debug_mode = 'Y' THEN
1980: pa_debug.g_err_stage:='Validating input parameters:->p_rev_res_class_rate_sch_id '||p_rev_res_class_rate_sch_id ||'p_incurred_by_organz_id'||p_incurred_by_organz_id ;
1976: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
1977: END IF;
1978:
1979: IF g1_debug_mode = 'Y' THEN
1980: pa_debug.g_err_stage:='Validating input parameters:->p_rev_res_class_rate_sch_id '||p_rev_res_class_rate_sch_id ||'p_incurred_by_organz_id'||p_incurred_by_organz_id ;
1981: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
1982: END IF;
1983: /* Assigning the parameters to local variables */
1984: l_burden_cost :=p_burden_cost;
1977: END IF;
1978:
1979: IF g1_debug_mode = 'Y' THEN
1980: pa_debug.g_err_stage:='Validating input parameters:->p_rev_res_class_rate_sch_id '||p_rev_res_class_rate_sch_id ||'p_incurred_by_organz_id'||p_incurred_by_organz_id ;
1981: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
1982: END IF;
1983: /* Assigning the parameters to local variables */
1984: l_burden_cost :=p_burden_cost;
1985: l_raw_cost := p_raw_cost;
1997: /* Validating all the required Parameters */
1998: IF p_resource_class IS NULL OR p_item_date IS NULL
1999: OR p_uom IS NULL THEN
2000: IF g1_debug_mode = 'Y' THEN
2001: pa_debug.g_err_stage:='validating Get_plan_res_class_rates: either p_resource_class or p_item_date or p_uom is null ';
2002: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,5);
2003: END IF;
2004: RAISE l_insufficeient_param;
2005: ELSE
1998: IF p_resource_class IS NULL OR p_item_date IS NULL
1999: OR p_uom IS NULL THEN
2000: IF g1_debug_mode = 'Y' THEN
2001: pa_debug.g_err_stage:='validating Get_plan_res_class_rates: either p_resource_class or p_item_date or p_uom is null ';
2002: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,5);
2003: END IF;
2004: RAISE l_insufficeient_param;
2005: ELSE
2006: null;
2009: /* First computing the raw_cost if p_schedule_type is passed COST or NULL
2010: If COST is passed then it'll compute only Costing but if passed nll it'll
2011: compute both Costing as well as Revenue */
2012: IF g1_debug_mode = 'Y' THEN
2013: pa_debug.g_err_stage:='Calculating Costing data';
2014: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,5);
2015: END IF;
2016:
2017: IF l_override_organization_id is NULL and p_resource_class = 'PEOPLE' Then
2010: If COST is passed then it'll compute only Costing but if passed nll it'll
2011: compute both Costing as well as Revenue */
2012: IF g1_debug_mode = 'Y' THEN
2013: pa_debug.g_err_stage:='Calculating Costing data';
2014: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,5);
2015: END IF;
2016:
2017: IF l_override_organization_id is NULL and p_resource_class = 'PEOPLE' Then
2018: IF g1_debug_mode = 'Y' THEN
2015: END IF;
2016:
2017: IF l_override_organization_id is NULL and p_resource_class = 'PEOPLE' Then
2018: IF g1_debug_mode = 'Y' THEN
2019: pa_debug.g_err_stage:='Calling pa_cost.Override_exp_organization api';
2020: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,5);
2021: end if;
2022: BEGIN
2023: pa_cost.Override_exp_organization
2016:
2017: IF l_override_organization_id is NULL and p_resource_class = 'PEOPLE' Then
2018: IF g1_debug_mode = 'Y' THEN
2019: pa_debug.g_err_stage:='Calling pa_cost.Override_exp_organization api';
2020: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,5);
2021: end if;
2022: BEGIN
2023: pa_cost.Override_exp_organization
2024: (P_item_date => p_item_date
2033: );
2034: EXCEPTION
2035: WHEN OTHERS THEN
2036: IF g1_debug_mode = 'Y' THEN
2037: pa_debug.g_err_stage:='pa_cost.Override_exp_organization is throwing When Others'||SUBSTR(SQLERRM,1,250);
2038: pa_debug.write('Get_plan_res_class_Rates : ' || g_module_name,pa_debug.g_err_stage,1);
2039: END IF;
2040: END;
2041:
2034: EXCEPTION
2035: WHEN OTHERS THEN
2036: IF g1_debug_mode = 'Y' THEN
2037: pa_debug.g_err_stage:='pa_cost.Override_exp_organization is throwing When Others'||SUBSTR(SQLERRM,1,250);
2038: pa_debug.write('Get_plan_res_class_Rates : ' || g_module_name,pa_debug.g_err_stage,1);
2039: END IF;
2040: END;
2041:
2042: IF g1_debug_mode = 'Y' THEN
2039: END IF;
2040: END;
2041:
2042: IF g1_debug_mode = 'Y' THEN
2043: pa_debug.g_err_stage:='Return status of pa_cost.Override_exp_organization ['||l_ovr_return_status||
2044: ']msgData['||l_ovr_msg_data||']OverideOrg['||l_override_organization_id||']' ;
2045: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,5);
2046: end if;
2047:
2041:
2042: IF g1_debug_mode = 'Y' THEN
2043: pa_debug.g_err_stage:='Return status of pa_cost.Override_exp_organization ['||l_ovr_return_status||
2044: ']msgData['||l_ovr_msg_data||']OverideOrg['||l_override_organization_id||']' ;
2045: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,5);
2046: end if;
2047:
2048: End If;
2049:
2058: IF l_raw_cost IS NULL THEN
2059: IF p_rate_based_flag ='Y' THEN
2060: IF p_quantity IS NULL THEN
2061: IF g1_debug_mode = 'Y' THEN
2062: pa_debug.g_err_stage:='validating Get_plan_res_class_rates: p_quantity is required for rate based ';
2063: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,5);
2064: END IF;
2065: RAISE l_rate_based_no_quantity;
2066: END IF;
2059: IF p_rate_based_flag ='Y' THEN
2060: IF p_quantity IS NULL THEN
2061: IF g1_debug_mode = 'Y' THEN
2062: pa_debug.g_err_stage:='validating Get_plan_res_class_rates: p_quantity is required for rate based ';
2063: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,5);
2064: END IF;
2065: RAISE l_rate_based_no_quantity;
2066: END IF;
2067: END IF;
2077: l_item_date DATE := p_item_date;
2078: l_res_class_org_id NUMBER := NVL (l_override_organization_id ,NVL(p_incurred_by_organz_id,p_project_organz_id));
2079: BEGIN
2080: IF g1_debug_mode = 'Y' THEN
2081: pa_debug.g_err_stage:='Callling Get_Res_Class_Hierarchy_Rate:p_project_id'||p_project_id||'p_task_id'||p_task_id;
2082: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,5);
2083: END IF;
2084: Get_Res_Class_Hierarchy_Rate( p_res_class_rate_sch_id => p_cost_res_class_rate_sch_id,
2085: p_item_date => l_item_date,
2078: l_res_class_org_id NUMBER := NVL (l_override_organization_id ,NVL(p_incurred_by_organz_id,p_project_organz_id));
2079: BEGIN
2080: IF g1_debug_mode = 'Y' THEN
2081: pa_debug.g_err_stage:='Callling Get_Res_Class_Hierarchy_Rate:p_project_id'||p_project_id||'p_task_id'||p_task_id;
2082: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,5);
2083: END IF;
2084: Get_Res_Class_Hierarchy_Rate( p_res_class_rate_sch_id => p_cost_res_class_rate_sch_id,
2085: p_item_date => l_item_date,
2086: p_org_id => p_project_org_id ,
2116: FETCH C_std_res_class_sch_cost INTO l_cost_rate,l_raw_cost,l_txn_curr_code;
2117: CLOSE C_std_res_class_sch_cost ;
2118:
2119: IF g1_debug_mode = 'Y' THEN
2120: pa_debug.g_err_stage:='1002 cost rate : ' || l_cost_rate || 'Raw Cost : '
2121: || l_raw_cost || 'currency_code : ' || l_txn_curr_code;
2122: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,5);
2123: END IF;
2124: END;/*End of declare of cursor declaration for res_class_org_id*/
2118:
2119: IF g1_debug_mode = 'Y' THEN
2120: pa_debug.g_err_stage:='1002 cost rate : ' || l_cost_rate || 'Raw Cost : '
2121: || l_raw_cost || 'currency_code : ' || l_txn_curr_code;
2122: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,5);
2123: END IF;
2124: END;/*End of declare of cursor declaration for res_class_org_id*/
2125: END IF;/* End of Status check of Hierarcy Rate Procedure */
2126: END;/* End of proceduer call BEGIN */
2163: l_raw_cost := Rec_std_res_class_sch_cost.r_cost;
2164: l_txn_curr_code := Rec_std_res_class_sch_cost.rate_currency_code;
2165: END LOOP;
2166: IF g1_debug_mode = 'Y' THEN
2167: pa_debug.g_err_stage:='1002 cost rate : ' || l_cost_rate || 'Raw Cost : '
2168: || l_raw_cost || 'currency_code : ' || l_txn_curr_code;
2169: pa_debug.write('Get_Res_Class_Rates: ' || g_module_name,pa_debug.g_err_stage,5);
2170: END IF;
2171:
2165: END LOOP;
2166: IF g1_debug_mode = 'Y' THEN
2167: pa_debug.g_err_stage:='1002 cost rate : ' || l_cost_rate || 'Raw Cost : '
2168: || l_raw_cost || 'currency_code : ' || l_txn_curr_code;
2169: pa_debug.write('Get_Res_Class_Rates: ' || g_module_name,pa_debug.g_err_stage,5);
2170: END IF;
2171:
2172: EXCEPTION
2173: WHEN l_more_than_one_row_excep THEN
2176: x_msg_count := 1;
2177: x_msg_data := 'TOO_MANY_ROWS';
2178: x_raw_cost_rejection_code :='TOO_MANY_ROWS';
2179: IF g1_debug_mode = 'Y' THEN
2180: pa_debug.g_err_stage:='Unexpected Error'||SQLERRM;
2181: pa_debug.write('Get_Res_Class_Rates: ' || g_module_name,pa_debug.g_err_stage,5);
2182: END IF;
2183: RAISE;
2184: END;/*End of decalre cursor*/
2177: x_msg_data := 'TOO_MANY_ROWS';
2178: x_raw_cost_rejection_code :='TOO_MANY_ROWS';
2179: IF g1_debug_mode = 'Y' THEN
2180: pa_debug.g_err_stage:='Unexpected Error'||SQLERRM;
2181: pa_debug.write('Get_Res_Class_Rates: ' || g_module_name,pa_debug.g_err_stage,5);
2182: END IF;
2183: RAISE;
2184: END;/*End of decalre cursor*/
2185:
2187: RAISE l_no_cost;
2188: END IF;
2189:
2190: IF g1_debug_mode = 'Y' THEN
2191: pa_debug.g_err_stage:='9999 l_cost_rate: ' || l_cost_rate||
2192: 'raw_cost : ' ||l_raw_cost || 'currency_code : ' || l_txn_curr_code;
2193: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
2194: END IF;
2195:
2189:
2190: IF g1_debug_mode = 'Y' THEN
2191: pa_debug.g_err_stage:='9999 l_cost_rate: ' || l_cost_rate||
2192: 'raw_cost : ' ||l_raw_cost || 'currency_code : ' || l_txn_curr_code;
2193: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
2194: END IF;
2195:
2196: END IF;/* End of IF l_raw_cost */
2197:
2202: x_msg_data:= 'PA_FCST_NO_COST_RATE';
2203: x_raw_cost_rejection_code := 'PA_FCST_NO_COST_RATE';
2204: x_msg_count := 1;
2205: IF g1_debug_mode = 'Y' THEN
2206: pa_debug.g_err_stage:='No Cost Rate Exists:p_project_id'||p_project_id||'p_task_id'||p_task_id;
2207: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,5);
2208: END IF;
2209:
2210: WHEN OTHERS THEN
2203: x_raw_cost_rejection_code := 'PA_FCST_NO_COST_RATE';
2204: x_msg_count := 1;
2205: IF g1_debug_mode = 'Y' THEN
2206: pa_debug.g_err_stage:='No Cost Rate Exists:p_project_id'||p_project_id||'p_task_id'||p_task_id;
2207: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,5);
2208: END IF;
2209:
2210: WHEN OTHERS THEN
2211: x_raw_cost:= NULL;
2214: x_msg_data := SUBSTR(SQLERRM,1,30);
2215: x_raw_cost_rejection_code := SUBSTR(SQLERRM,1,30);
2216:
2217: IF g1_debug_mode = 'Y' THEN
2218: pa_debug.g_err_stage:='Unexpected Error'||SQLERRM;
2219: pa_debug.write('Get_Res_Class_Rates: ' || g_module_name,pa_debug.g_err_stage,5);
2220: END IF;
2221:
2222: RAISE;
2215: x_raw_cost_rejection_code := SUBSTR(SQLERRM,1,30);
2216:
2217: IF g1_debug_mode = 'Y' THEN
2218: pa_debug.g_err_stage:='Unexpected Error'||SQLERRM;
2219: pa_debug.write('Get_Res_Class_Rates: ' || g_module_name,pa_debug.g_err_stage,5);
2220: END IF;
2221:
2222: RAISE;
2223:
2240: IF l_burden_cost is NOT NULL Then
2241:
2242: --assigning override burden cost/or derived burden cost from Actual
2243: IF g1_debug_mode = 'Y' THEN
2244: pa_debug.g_err_stage := 'Assignging override burden cost values to out params';
2245: pa_debug.write('Get_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
2246: END IF;
2247: l_txn_burden_cost :=l_burden_cost;
2248: IF (p_quantity <> 0 ) THEN
2241:
2242: --assigning override burden cost/or derived burden cost from Actual
2243: IF g1_debug_mode = 'Y' THEN
2244: pa_debug.g_err_stage := 'Assignging override burden cost values to out params';
2245: pa_debug.write('Get_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
2246: END IF;
2247: l_txn_burden_cost :=l_burden_cost;
2248: IF (p_quantity <> 0 ) THEN
2249: l_txn_burden_cost_rate := l_burden_cost / NVL(p_quantity,1) ;
2256: and l_raw_cost is NOT NULL and l_cost_rate is NOT NULL
2257: and pa_cost1.check_proj_burdened(p_project_type,p_project_id) = 'Y' ) Then
2258: l_burd_organization_id := NVL(l_override_organization_id, NVl(p_incurred_by_organz_id ,p_nlr_organization_id));
2259: IF g1_debug_mode = 'Y' THEN
2260: pa_debug.g_err_stage := 'calling pa_cost1.Get_burden_sch_details fro burden cost';
2261: pa_debug.write('Get_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
2262: END IF;
2263:
2264: begin
2257: and pa_cost1.check_proj_burdened(p_project_type,p_project_id) = 'Y' ) Then
2258: l_burd_organization_id := NVL(l_override_organization_id, NVl(p_incurred_by_organz_id ,p_nlr_organization_id));
2259: IF g1_debug_mode = 'Y' THEN
2260: pa_debug.g_err_stage := 'calling pa_cost1.Get_burden_sch_details fro burden cost';
2261: pa_debug.write('Get_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
2262: END IF;
2263:
2264: begin
2265:
2294: l_cost_msg_data := 'GET_BURDEN_DETAILS: '||substr(sqlerrm,1,30);
2295: end;
2296: If ( l_cost_return_status <> g_success OR l_txn_burden_multiplier is NULL ) Then
2297: IF g1_debug_mode = 'Y' THEN
2298: pa_debug.g_err_stage := 'Error while Calculating burden costs';
2299: pa_debug.write('Get_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
2300: END IF;
2301: l_burden_cost_rejection_code := l_cost_msg_data;
2302:
2295: end;
2296: If ( l_cost_return_status <> g_success OR l_txn_burden_multiplier is NULL ) Then
2297: IF g1_debug_mode = 'Y' THEN
2298: pa_debug.g_err_stage := 'Error while Calculating burden costs';
2299: pa_debug.write('Get_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
2300: END IF;
2301: l_burden_cost_rejection_code := l_cost_msg_data;
2302:
2303: -------------------------------------------------------
2319: End if;
2320: end if;
2321: Elsif p_override_burden_cost_rate is NOT NULL and l_burden_cost is NULL Then
2322: IF g1_debug_mode = 'Y' THEN
2323: pa_debug.g_err_stage := 'Calculating burden cost based on override burden multiplier ';
2324: pa_debug.write('Get_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
2325: END IF;
2326:
2327: l_txn_burden_cost := p_quantity * p_override_burden_cost_rate;
2320: end if;
2321: Elsif p_override_burden_cost_rate is NOT NULL and l_burden_cost is NULL Then
2322: IF g1_debug_mode = 'Y' THEN
2323: pa_debug.g_err_stage := 'Calculating burden cost based on override burden multiplier ';
2324: pa_debug.write('Get_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
2325: END IF;
2326:
2327: l_txn_burden_cost := p_quantity * p_override_burden_cost_rate;
2328: l_txn_burden_cost_rate := p_override_burden_cost_rate;
2332:
2333: ElsIF l_raw_cost IS NOT NULL THEN
2334: --copy the raw cost to the burden costs
2335: IF g1_debug_mode = 'Y' THEN
2336: pa_debug.g_err_stage := 'Copying raw costs to burden costs';
2337: pa_debug.write('Get_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
2338: END IF;
2339: l_txn_burden_cost := l_raw_cost;
2340: l_txn_burden_cost_rate := l_cost_rate;
2333: ElsIF l_raw_cost IS NOT NULL THEN
2334: --copy the raw cost to the burden costs
2335: IF g1_debug_mode = 'Y' THEN
2336: pa_debug.g_err_stage := 'Copying raw costs to burden costs';
2337: pa_debug.write('Get_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
2338: END IF;
2339: l_txn_burden_cost := l_raw_cost;
2340: l_txn_burden_cost_rate := l_cost_rate;
2341: l_txn_burden_multiplier := 0;
2357: x_burden_cost_rejection_code:= l_burden_cost_rejection_code;
2358:
2359: /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
2360: IF g1_debug_mode = 'Y' THEN
2361: pa_debug.g_err_stage := 'Going to calculate revenue:->p_schedule_type'||p_schedule_type||'l_raw_revenue'||l_raw_revenue||'l_raw_cost'||l_raw_cost||'l_txn_burden_cost'||l_txn_burden_cost;
2362: pa_debug.write('Get_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
2363: END IF;
2364:
2365: IF NVL(p_schedule_type,'REVENUE')='REVENUE' THEN
2358:
2359: /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
2360: IF g1_debug_mode = 'Y' THEN
2361: pa_debug.g_err_stage := 'Going to calculate revenue:->p_schedule_type'||p_schedule_type||'l_raw_revenue'||l_raw_revenue||'l_raw_cost'||l_raw_cost||'l_txn_burden_cost'||l_txn_burden_cost;
2362: pa_debug.write('Get_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
2363: END IF;
2364:
2365: IF NVL(p_schedule_type,'REVENUE')='REVENUE' THEN
2366: IF p_system_linkage='BTC' THEN
2375: IF NVL(p_rate_based_flag,'N') ='N' THEN
2376: l_raw_cost:=p_quantity;
2377: END IF;
2378: IF g1_debug_mode = 'Y' THEN
2379: pa_debug.g_err_stage := 'p_quanity is directly getting converted to l_raw_cost for only REVENUE mode:l_raw_cost'||l_raw_cost;
2380: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
2381: END IF;
2382: END IF;
2383:
2376: l_raw_cost:=p_quantity;
2377: END IF;
2378: IF g1_debug_mode = 'Y' THEN
2379: pa_debug.g_err_stage := 'p_quanity is directly getting converted to l_raw_cost for only REVENUE mode:l_raw_cost'||l_raw_cost;
2380: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
2381: END IF;
2382: END IF;
2383:
2384: IF l_raw_revenue IS NULL THEN
2388: END IF;
2389: IF p_rate_based_flag ='Y' THEN
2390: IF p_quantity IS NULL THEN
2391: IF g1_debug_mode = 'Y' THEN
2392: pa_debug.g_err_stage:='validating Get_plan_res_class_rates: p_quantity is required for rate based ';
2393: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,5);
2394: END IF;
2395: RAISE l_rate_based_no_quantity;
2396: END IF;
2389: IF p_rate_based_flag ='Y' THEN
2390: IF p_quantity IS NULL THEN
2391: IF g1_debug_mode = 'Y' THEN
2392: pa_debug.g_err_stage:='validating Get_plan_res_class_rates: p_quantity is required for rate based ';
2393: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,5);
2394: END IF;
2395: RAISE l_rate_based_no_quantity;
2396: END IF;
2397: END IF;
2458: FETCH C_std_res_class_sch_rev INTO l_bill_rate ,l_raw_revenue ,l_bill_txn_curr_code,l_markup ;
2459: CLOSE C_std_res_class_sch_rev;
2460:
2461: IF g1_debug_mode = 'Y' THEN
2462: pa_debug.g_err_stage:='1002 bill rate : ' || l_bill_rate || 'Revenue : '
2463: || l_raw_revenue || 'currency_code : ' || l_bill_txn_curr_code;
2464: pa_debug.write('Get_plan_Res_Class_Rates: ' || g_module_name,pa_debug.g_err_stage,5);
2465: END IF;
2466:
2460:
2461: IF g1_debug_mode = 'Y' THEN
2462: pa_debug.g_err_stage:='1002 bill rate : ' || l_bill_rate || 'Revenue : '
2463: || l_raw_revenue || 'currency_code : ' || l_bill_txn_curr_code;
2464: pa_debug.write('Get_plan_Res_Class_Rates: ' || g_module_name,pa_debug.g_err_stage,5);
2465: END IF;
2466:
2467: END;/*End of declare of cursor declaration for C_std_res_class_sch_rev*/
2468:
2520:
2521: END LOOP;
2522:
2523: IF g1_debug_mode = 'Y' THEN
2524: pa_debug.g_err_stage:='l_bill_rate: ' || l_bill_rate ||
2525: 'Revenue : ' || l_raw_revenue || 'currency_code : ' || l_bill_txn_curr_code;
2526: pa_debug.write('Get_plan_res_class_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
2527: END IF;
2528: EXCEPTION
2522:
2523: IF g1_debug_mode = 'Y' THEN
2524: pa_debug.g_err_stage:='l_bill_rate: ' || l_bill_rate ||
2525: 'Revenue : ' || l_raw_revenue || 'currency_code : ' || l_bill_txn_curr_code;
2526: pa_debug.write('Get_plan_res_class_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
2527: END IF;
2528: EXCEPTION
2529: WHEN l_more_than_one_row_excep THEN
2530: x_raw_revenue:= NULL;
2533: x_msg_data := 'TOO_MANY_ROWS';
2534: x_revenue_rejection_code := 'TOO_MANY_ROWS';
2535:
2536: IF g1_debug_mode = 'Y' THEN
2537: pa_debug.g_err_stage:='Too many Rows';
2538: pa_debug.write('Get_plan_Res_Class_Rates: ' || g_module_name,pa_debug.g_err_stage,5);
2539: END IF;
2540:
2541: RAISE;
2534: x_revenue_rejection_code := 'TOO_MANY_ROWS';
2535:
2536: IF g1_debug_mode = 'Y' THEN
2537: pa_debug.g_err_stage:='Too many Rows';
2538: pa_debug.write('Get_plan_Res_Class_Rates: ' || g_module_name,pa_debug.g_err_stage,5);
2539: END IF;
2540:
2541: RAISE;
2542:
2556: x_rev_txn_curr_code := l_bill_txn_curr_code ;
2557: x_return_status := l_x_return_status;
2558:
2559: IF g1_debug_mode = 'Y' THEN
2560: pa_debug.g_err_stage:='l_bill_rate: ' || l_bill_rate ||
2561: 'Revenue : ' || l_raw_revenue || 'currency_code : ' || l_bill_txn_curr_code;
2562: pa_debug.write('Get_plan_res_class_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
2563: END IF;
2564:
2558:
2559: IF g1_debug_mode = 'Y' THEN
2560: pa_debug.g_err_stage:='l_bill_rate: ' || l_bill_rate ||
2561: 'Revenue : ' || l_raw_revenue || 'currency_code : ' || l_bill_txn_curr_code;
2562: pa_debug.write('Get_plan_res_class_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
2563: END IF;
2564:
2565: EXCEPTION
2566: WHEN l_no_revenue THEN
2583: x_bill_markup_percentage := l_markup ;
2584: x_rev_txn_curr_code := NVL(l_bill_txn_curr_code,p_override_txn_currency_code) ;
2585: x_return_status := l_x_return_status;
2586:
2587: pa_debug.reset_err_stack;
2588: EXCEPTION
2589: WHEN l_insufficeient_param THEN
2590: IF g1_debug_mode = 'Y' THEN
2591: pa_debug.g_err_stage:='All the Required parameters are not passes to Resource Schedule';
2587: pa_debug.reset_err_stack;
2588: EXCEPTION
2589: WHEN l_insufficeient_param THEN
2590: IF g1_debug_mode = 'Y' THEN
2591: pa_debug.g_err_stage:='All the Required parameters are not passes to Resource Schedule';
2592: pa_debug.write('Get_plan_res_class_Rates : ' || g_module_name,pa_debug.g_err_stage,3);
2593: END IF;
2594: x_return_status := g_ERROR;
2595: x_msg_count := 1;
2588: EXCEPTION
2589: WHEN l_insufficeient_param THEN
2590: IF g1_debug_mode = 'Y' THEN
2591: pa_debug.g_err_stage:='All the Required parameters are not passes to Resource Schedule';
2592: pa_debug.write('Get_plan_res_class_Rates : ' || g_module_name,pa_debug.g_err_stage,3);
2593: END IF;
2594: x_return_status := g_ERROR;
2595: x_msg_count := 1;
2596: x_msg_data := 'PA_FCST_INSUFFICIENT_PARA';
2601: x_raw_cost := NULL;
2602: x_bill_rate := NULL;
2603: x_cost_rate := NULL;
2604:
2605: pa_debug.reset_err_stack;
2606:
2607: WHEN l_rate_based_no_quantity THEN
2608: IF g1_debug_mode = 'Y' THEN
2609: pa_debug.g_err_stage:='Quantity is required for a rate based transaction';
2605: pa_debug.reset_err_stack;
2606:
2607: WHEN l_rate_based_no_quantity THEN
2608: IF g1_debug_mode = 'Y' THEN
2609: pa_debug.g_err_stage:='Quantity is required for a rate based transaction';
2610: pa_debug.write('Get_plan_res_class_Rates : ' || g_module_name,pa_debug.g_err_stage,3);
2611: END IF;
2612: x_return_status := g_ERROR;
2613: x_msg_count := 1;
2606:
2607: WHEN l_rate_based_no_quantity THEN
2608: IF g1_debug_mode = 'Y' THEN
2609: pa_debug.g_err_stage:='Quantity is required for a rate based transaction';
2610: pa_debug.write('Get_plan_res_class_Rates : ' || g_module_name,pa_debug.g_err_stage,3);
2611: END IF;
2612: x_return_status := g_ERROR;
2613: x_msg_count := 1;
2614: x_msg_data := 'PA_EX_QTY_EXIST';
2618: x_raw_cost := NULL;
2619: x_bill_rate := NULL;
2620: x_cost_rate := NULL;
2621:
2622: pa_debug.reset_err_stack;
2623: WHEN l_no_cost THEN
2624: x_raw_revenue := NULL;
2625: x_raw_cost := NULL;
2626: x_bill_rate := NULL;
2631: x_burden_cost_rejection_code := 'PA_FCST_NO_COST_RATE';
2632: x_revenue_rejection_code := 'PA_FCST_NO_COST_RATE';
2633: x_msg_count := 1;
2634: IF g1_debug_mode = 'Y' THEN
2635: pa_debug.g_err_stage:='No Cost Rate Exists:p_project_id'||p_project_id||'p_task_id'||p_task_id;
2636: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,5);
2637: END IF;
2638:
2639: pa_debug.reset_err_stack;
2632: x_revenue_rejection_code := 'PA_FCST_NO_COST_RATE';
2633: x_msg_count := 1;
2634: IF g1_debug_mode = 'Y' THEN
2635: pa_debug.g_err_stage:='No Cost Rate Exists:p_project_id'||p_project_id||'p_task_id'||p_task_id;
2636: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,5);
2637: END IF;
2638:
2639: pa_debug.reset_err_stack;
2640: WHEN l_no_revenue THEN
2635: pa_debug.g_err_stage:='No Cost Rate Exists:p_project_id'||p_project_id||'p_task_id'||p_task_id;
2636: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,5);
2637: END IF;
2638:
2639: pa_debug.reset_err_stack;
2640: WHEN l_no_revenue THEN
2641: x_raw_revenue := NULL;
2642: x_bill_rate := NULL;
2643: x_return_status := NVL(l_inter_return_status,g_ERROR);
2644: x_msg_data := 'PA_FCST_NO_BILL_RATE';
2645: x_revenue_rejection_code := 'PA_FCST_NO_BILL_RATE';
2646: x_msg_count := 1;
2647: IF g1_debug_mode = 'Y' THEN
2648: pa_debug.g_err_stage:='No Bill Rate Exists:p_project_id'||p_project_id||'p_task_id'||p_task_id;
2649: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,5);
2650: END IF;
2651:
2652: pa_debug.reset_err_stack;
2645: x_revenue_rejection_code := 'PA_FCST_NO_BILL_RATE';
2646: x_msg_count := 1;
2647: IF g1_debug_mode = 'Y' THEN
2648: pa_debug.g_err_stage:='No Bill Rate Exists:p_project_id'||p_project_id||'p_task_id'||p_task_id;
2649: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,5);
2650: END IF;
2651:
2652: pa_debug.reset_err_stack;
2653:
2648: pa_debug.g_err_stage:='No Bill Rate Exists:p_project_id'||p_project_id||'p_task_id'||p_task_id;
2649: pa_debug.write('Get_plan_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,5);
2650: END IF;
2651:
2652: pa_debug.reset_err_stack;
2653:
2654: WHEN OTHERS THEN
2655: x_raw_revenue := NULL;
2656: x_raw_cost := NULL;
2663: x_raw_cost_rejection_code := SUBSTR(SQLERRM,1,30);
2664: x_burden_cost_rejection_code := SUBSTR(SQLERRM,1,30);
2665:
2666: IF g1_debug_mode = 'Y' THEN
2667: pa_debug.g_err_stage:='SQLERROR ' || SQLCODE;
2668: pa_debug.write('Get_plan_res_class_Rates : ' || g_module_name,pa_debug.g_err_stage,5);
2669: END IF;
2670:
2671: pa_debug.reset_err_stack;
2664: x_burden_cost_rejection_code := SUBSTR(SQLERRM,1,30);
2665:
2666: IF g1_debug_mode = 'Y' THEN
2667: pa_debug.g_err_stage:='SQLERROR ' || SQLCODE;
2668: pa_debug.write('Get_plan_res_class_Rates : ' || g_module_name,pa_debug.g_err_stage,5);
2669: END IF;
2670:
2671: pa_debug.reset_err_stack;
2672: RAISE;
2667: pa_debug.g_err_stage:='SQLERROR ' || SQLCODE;
2668: pa_debug.write('Get_plan_res_class_Rates : ' || g_module_name,pa_debug.g_err_stage,5);
2669: END IF;
2670:
2671: pa_debug.reset_err_stack;
2672: RAISE;
2673:
2674:
2675:
2871:
2872:
2873: BEGIN
2874: IF g1_debug_mode = 'Y' THEN
2875: pa_debug.g_err_stage:='Validating all the input parameters';
2876: pa_debug.write('Get_plan_plan_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
2877: END IF;
2878:
2879: IF p_system_linkage='BTC' THEN
2872:
2873: BEGIN
2874: IF g1_debug_mode = 'Y' THEN
2875: pa_debug.g_err_stage:='Validating all the input parameters';
2876: pa_debug.write('Get_plan_plan_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
2877: END IF;
2878:
2879: IF p_system_linkage='BTC' THEN
2880: l_override_cost := p_burden_cost;
2885: l_raw_cost := p_raw_cost; -- Added for bug 5039918
2886:
2887: IF p_rate_based_flag ='Y' AND p_quantity IS NULL AND NVL(l_override_cost,0)=0 THEN
2888: IF g1_debug_mode = 'Y' THEN
2889: pa_debug.g_err_stage:='Validating Get_plan_plan_rev_Rates:p_quantity is required for rate based';
2890: pa_debug.write('Get_plan_plan_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
2891: END IF;
2892: RAISE l_rate_based_no_quantity;
2893: END IF;
2886:
2887: IF p_rate_based_flag ='Y' AND p_quantity IS NULL AND NVL(l_override_cost,0)=0 THEN
2888: IF g1_debug_mode = 'Y' THEN
2889: pa_debug.g_err_stage:='Validating Get_plan_plan_rev_Rates:p_quantity is required for rate based';
2890: pa_debug.write('Get_plan_plan_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
2891: END IF;
2892: RAISE l_rate_based_no_quantity;
2893: END IF;
2894: IF p_revenue_override_rate IS NOT NULL AND p_override_currency_code IS NULL THEN
2892: RAISE l_rate_based_no_quantity;
2893: END IF;
2894: IF p_revenue_override_rate IS NOT NULL AND p_override_currency_code IS NULL THEN
2895: IF g1_debug_mode = 'Y' THEN
2896: pa_debug.g_err_stage:='Validating Get_plan_plan_rev_Rates:p_override_currency_code is required if passing any overrides';
2897: pa_debug.write('Get_plan_plan_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
2898: END IF;
2899: RAISE l_invalid_currency;
2900: END IF;
2893: END IF;
2894: IF p_revenue_override_rate IS NOT NULL AND p_override_currency_code IS NULL THEN
2895: IF g1_debug_mode = 'Y' THEN
2896: pa_debug.g_err_stage:='Validating Get_plan_plan_rev_Rates:p_override_currency_code is required if passing any overrides';
2897: pa_debug.write('Get_plan_plan_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
2898: END IF;
2899: RAISE l_invalid_currency;
2900: END IF;
2901: /* If revenue Override rate is not null compute the raw_revenue based on the override rate and the p_quantity or rawCost */
2917: IF l_txn_raw_revenue IS NULL THEN
2918: /* Deriving Planning rates based on planning rate schedules for emp n job and non labor*/
2919: IF p_resource_class='PEOPLE' THEN
2920: IF g1_debug_mode = 'Y' THEN
2921: pa_debug.g_err_stage:='Deriving Planning rates based on planning rate schedules for emp and job';
2922: pa_debug.write('Get_plan_plan_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
2923: END IF;
2924: /* Checking for Employee based Rates*/
2925: BEGIN
2918: /* Deriving Planning rates based on planning rate schedules for emp n job and non labor*/
2919: IF p_resource_class='PEOPLE' THEN
2920: IF g1_debug_mode = 'Y' THEN
2921: pa_debug.g_err_stage:='Deriving Planning rates based on planning rate schedules for emp and job';
2922: pa_debug.write('Get_plan_plan_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
2923: END IF;
2924: /* Checking for Employee based Rates*/
2925: BEGIN
2926: /* bug8407306 */
2953: l_bill_txn_curr_code := l_r_curr_code;
2954: END IF;
2955:
2956: IF g1_debug_mode = 'Y' THEN
2957: pa_debug.g_err_stage:='l_bill_rate: ' || l_bill_rate ||
2958: 'Revenue : ' || l_raw_revenue || 'currency_code : ' || l_bill_txn_curr_code;
2959: pa_debug.write('Get_plan_plan_rev_Rates: ' || g_module_name,pa_debug.g_err_stage,2);
2960: END IF;
2961: EXCEPTION
2955:
2956: IF g1_debug_mode = 'Y' THEN
2957: pa_debug.g_err_stage:='l_bill_rate: ' || l_bill_rate ||
2958: 'Revenue : ' || l_raw_revenue || 'currency_code : ' || l_bill_txn_curr_code;
2959: pa_debug.write('Get_plan_plan_rev_Rates: ' || g_module_name,pa_debug.g_err_stage,2);
2960: END IF;
2961: EXCEPTION
2962: WHEN l_more_than_one_row_excep THEN
2963: x_raw_revenue:= NULL;
2966: x_msg_data := 'TOO_MANY_ROWS';
2967:
2968:
2969: IF g1_debug_mode = 'Y' THEN
2970: pa_debug.g_err_stage:='Too many Rows';
2971: pa_debug.write('Get_plan_plan_rev_Rates: ' || g_module_name,pa_debug.g_err_stage,5);
2972: END IF;
2973:
2974: RAISE;
2967:
2968:
2969: IF g1_debug_mode = 'Y' THEN
2970: pa_debug.g_err_stage:='Too many Rows';
2971: pa_debug.write('Get_plan_plan_rev_Rates: ' || g_module_name,pa_debug.g_err_stage,5);
2972: END IF;
2973:
2974: RAISE;
2975: END;/*End of decalre cursor*/
3033: l_bill_txn_curr_code := l_r_curr_code;
3034: END IF;
3035:
3036: IF g1_debug_mode = 'Y' THEN
3037: pa_debug.g_err_stage:='l_bill_rate: ' || l_bill_rate ||
3038: 'Revenue : ' || l_raw_revenue || 'currency_code : ' || l_bill_txn_curr_code;
3039: pa_debug.write('Get_plan_plan_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
3040: END IF;
3041: EXCEPTION
3035:
3036: IF g1_debug_mode = 'Y' THEN
3037: pa_debug.g_err_stage:='l_bill_rate: ' || l_bill_rate ||
3038: 'Revenue : ' || l_raw_revenue || 'currency_code : ' || l_bill_txn_curr_code;
3039: pa_debug.write('Get_plan_plan_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
3040: END IF;
3041: EXCEPTION
3042: WHEN l_more_than_one_row_excep THEN
3043: x_raw_revenue:= NULL;
3046: x_msg_data := 'TOO_MANY_ROWS';
3047:
3048:
3049: IF g1_debug_mode = 'Y' THEN
3050: pa_debug.g_err_stage:='Too many Rows';
3051: pa_debug.write('Get_plan_plan_rev_Rates: ' || g_module_name,pa_debug.g_err_stage,5);
3052: END IF;
3053:
3054: RAISE;
3047:
3048:
3049: IF g1_debug_mode = 'Y' THEN
3050: pa_debug.g_err_stage:='Too many Rows';
3051: pa_debug.write('Get_plan_plan_rev_Rates: ' || g_module_name,pa_debug.g_err_stage,5);
3052: END IF;
3053:
3054: RAISE;
3055: END;/*End of decalre cursor*/
3077: l_markup := Rec_std_nl_sch_rev.markup;
3078:
3079: END LOOP;
3080: IF g1_debug_mode = 'Y' THEN
3081: pa_debug.g_err_stage:='l_bill_rate: ' || l_bill_rate ||
3082: 'Revenue : ' || l_raw_revenue || 'currency_code : ' || l_bill_txn_curr_code;
3083: pa_debug.write('Get_plan_plan_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
3084: END IF;
3085: EXCEPTION
3079: END LOOP;
3080: IF g1_debug_mode = 'Y' THEN
3081: pa_debug.g_err_stage:='l_bill_rate: ' || l_bill_rate ||
3082: 'Revenue : ' || l_raw_revenue || 'currency_code : ' || l_bill_txn_curr_code;
3083: pa_debug.write('Get_plan_plan_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
3084: END IF;
3085: EXCEPTION
3086: WHEN l_more_than_one_row_excep THEN
3087: x_raw_revenue:= NULL;
3090: x_msg_data := 'TOO_MANY_ROWS';
3091:
3092:
3093: IF g1_debug_mode = 'Y' THEN
3094: pa_debug.g_err_stage:='Too many Rows in non labor based on Non Labor Resources';
3095: pa_debug.write('Get_plan_plan_rev_Rates: ' || g_module_name,pa_debug.g_err_stage,5);
3096: END IF;
3097:
3098: RAISE;
3091:
3092:
3093: IF g1_debug_mode = 'Y' THEN
3094: pa_debug.g_err_stage:='Too many Rows in non labor based on Non Labor Resources';
3095: pa_debug.write('Get_plan_plan_rev_Rates: ' || g_module_name,pa_debug.g_err_stage,5);
3096: END IF;
3097:
3098: RAISE;
3099: END;/*End of decalre cursor*/
3118: l_markup := Rec_std_nl_sch_rev.markup;
3119:
3120: END LOOP;
3121: IF g1_debug_mode = 'Y' THEN
3122: pa_debug.g_err_stage:='l_bill_rate: ' || l_bill_rate ||
3123: 'Revenue : ' || l_raw_revenue || 'currency_code : ' || l_bill_txn_curr_code;
3124: pa_debug.write('Get_plan_plan_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
3125: END IF;
3126: EXCEPTION
3120: END LOOP;
3121: IF g1_debug_mode = 'Y' THEN
3122: pa_debug.g_err_stage:='l_bill_rate: ' || l_bill_rate ||
3123: 'Revenue : ' || l_raw_revenue || 'currency_code : ' || l_bill_txn_curr_code;
3124: pa_debug.write('Get_plan_plan_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
3125: END IF;
3126: EXCEPTION
3127: WHEN l_more_than_one_row_excep THEN
3128: x_raw_revenue:= NULL;
3131: x_msg_data := 'TOO_MANY_ROWS';
3132:
3133:
3134: IF g1_debug_mode = 'Y' THEN
3135: pa_debug.g_err_stage:='Too many Rows in non labor based on expenditure Type';
3136: pa_debug.write('Get_plan_plan_rev_Rates: ' || g_module_name,pa_debug.g_err_stage,5);
3137: END IF;
3138:
3139: RAISE;
3132:
3133:
3134: IF g1_debug_mode = 'Y' THEN
3135: pa_debug.g_err_stage:='Too many Rows in non labor based on expenditure Type';
3136: pa_debug.write('Get_plan_plan_rev_Rates: ' || g_module_name,pa_debug.g_err_stage,5);
3137: END IF;
3138:
3139: RAISE;
3140: END;/*End of decalre cursor*/
3142: END IF;/* If l_raw_revenue IS NULL */
3143:
3144:
3145: IF g1_debug_mode = 'Y' THEN
3146: pa_debug.g_err_stage:='Deriving Planning rates based on planning rate schedules for Non Labor';
3147: pa_debug.write('Get_plan_plan_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
3148: END IF;
3149: END IF;
3150: END IF ;/* End of l_txn_raw_revenue IS NULL */
3143:
3144:
3145: IF g1_debug_mode = 'Y' THEN
3146: pa_debug.g_err_stage:='Deriving Planning rates based on planning rate schedules for Non Labor';
3147: pa_debug.write('Get_plan_plan_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
3148: END IF;
3149: END IF;
3150: END IF ;/* End of l_txn_raw_revenue IS NULL */
3151:
3167: x_msg_data := 'PA_INVALID_DENOM_CURRENCY';
3168: x_msg_count := 1;
3169:
3170: IF g1_debug_mode = 'Y' THEN
3171: pa_debug.g_err_stage:='Override Currency is not passed to a rate based tranaction to the Get_Plan_Actual_Rev_Rates call';
3172: pa_debug.write('Get_plan_plan_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
3173: END IF;
3174: WHEN l_rate_based_no_quantity THEN
3175: x_raw_revenue :=NULL;
3168: x_msg_count := 1;
3169:
3170: IF g1_debug_mode = 'Y' THEN
3171: pa_debug.g_err_stage:='Override Currency is not passed to a rate based tranaction to the Get_Plan_Actual_Rev_Rates call';
3172: pa_debug.write('Get_plan_plan_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
3173: END IF;
3174: WHEN l_rate_based_no_quantity THEN
3175: x_raw_revenue :=NULL;
3176: x_bill_rate :=NULL;
3180: x_msg_data := 'PA_EX_QTY_EXIST';
3181: x_msg_count := 1;
3182:
3183: IF g1_debug_mode = 'Y' THEN
3184: pa_debug.g_err_stage:='Quantity is not passed to a rate based tranaction to the Get_Plan_Actual_Rev_Rates call';
3185: pa_debug.write('Get_plan_plan_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
3186: END IF;
3187:
3188: END Get_Plan_plan_Rev_Rates;
3181: x_msg_count := 1;
3182:
3183: IF g1_debug_mode = 'Y' THEN
3184: pa_debug.g_err_stage:='Quantity is not passed to a rate based tranaction to the Get_Plan_Actual_Rev_Rates call';
3185: pa_debug.write('Get_plan_plan_rev_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
3186: END IF;
3187:
3188: END Get_Plan_plan_Rev_Rates;
3189:
3310: END IF;
3311: IF ((p_raw_cost IS NULL OR p_burden_cost IS NULL)
3312: AND p_calculate_mode IN ('COST','COST_REVENUE')) THEN
3313: IF g1_debug_mode = 'Y' THEN
3314: pa_debug.g_err_stage:='Before Calling PA_COST1.Get_Plan_actual_Cost_Rates in PLAN mode';
3315: pa_debug.write('Get_plan_plan_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
3316: END IF;
3317:
3318: BEGIN
3311: IF ((p_raw_cost IS NULL OR p_burden_cost IS NULL)
3312: AND p_calculate_mode IN ('COST','COST_REVENUE')) THEN
3313: IF g1_debug_mode = 'Y' THEN
3314: pa_debug.g_err_stage:='Before Calling PA_COST1.Get_Plan_actual_Cost_Rates in PLAN mode';
3315: pa_debug.write('Get_plan_plan_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
3316: END IF;
3317:
3318: BEGIN
3319: PA_COST1.Get_Plan_Actual_Cost_Rates
3360: ,x_return_status =>l_x_return_status
3361: ,x_error_msg_code =>l_cost_msg_data ) ;
3362:
3363: IF g1_debug_mode = 'Y' THEN
3364: pa_debug.g_err_stage:='Called PA_COST1.Get_Plan_Actual_Cost_Rates:x_raw_cost_rejection_code'||l_raw_cost_rejection_code||'x_burden_cost_rejection_code'||l_burden_cost_rejection_code;
3365: pa_debug.write('Get_plan_plan_Rates : ' || g_module_name,pa_debug.g_err_stage,3);
3366: END IF;
3367: EXCEPTION
3368: WHEN OTHERS THEN
3361: ,x_error_msg_code =>l_cost_msg_data ) ;
3362:
3363: IF g1_debug_mode = 'Y' THEN
3364: pa_debug.g_err_stage:='Called PA_COST1.Get_Plan_Actual_Cost_Rates:x_raw_cost_rejection_code'||l_raw_cost_rejection_code||'x_burden_cost_rejection_code'||l_burden_cost_rejection_code;
3365: pa_debug.write('Get_plan_plan_Rates : ' || g_module_name,pa_debug.g_err_stage,3);
3366: END IF;
3367: EXCEPTION
3368: WHEN OTHERS THEN
3369: x_msg_data := 'PA_COST1.Get_Plan_Actual_Cost_Rates:' || SUBSTR(SQLERRM,1,250);
3371: x_burden_cost_rejection_code := SUBSTR(SQLERRM,1,30);
3372: x_return_status:=FND_API.G_RET_STS_UNEXP_ERROR;
3373:
3374: IF g1_debug_mode = 'Y' THEN
3375: pa_debug.g_err_stage:=' PA_COST1.Get_Plan_Actual_Cost_Rates is throwing When Others';
3376: pa_debug.write('Get_plan_plan_Rates : ' || g_module_name,pa_debug.g_err_stage,1);
3377: END IF;
3378: RAISE;
3379:
3372: x_return_status:=FND_API.G_RET_STS_UNEXP_ERROR;
3373:
3374: IF g1_debug_mode = 'Y' THEN
3375: pa_debug.g_err_stage:=' PA_COST1.Get_Plan_Actual_Cost_Rates is throwing When Others';
3376: pa_debug.write('Get_plan_plan_Rates : ' || g_module_name,pa_debug.g_err_stage,1);
3377: END IF;
3378: RAISE;
3379:
3380: END;
3433: END IF;
3434: END IF;
3435: END IF;
3436: IF g1_debug_mode = 'Y' THEN
3437: pa_debug.g_err_stage:='Calling Get_Plan_plan_Rev_Rates';
3438: pa_debug.write('Get_plan_plan_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
3439: END IF;
3440:
3441: Get_Plan_plan_Rev_Rates (
3434: END IF;
3435: END IF;
3436: IF g1_debug_mode = 'Y' THEN
3437: pa_debug.g_err_stage:='Calling Get_Plan_plan_Rev_Rates';
3438: pa_debug.write('Get_plan_plan_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
3439: END IF;
3440:
3441: Get_Plan_plan_Rev_Rates (
3442: p_project_id => p_project_id ,
3505: x_rev_txn_curr_code :=l_rev_txn_curr_code;
3506: x_revenue_rejection_code :=NULL;
3507: x_return_status :=l_x_return_status;
3508: IF g1_debug_mode = 'Y' THEN
3509: pa_debug.g_err_stage:='OUT of Get_plan_plan_Rates:p_project_id'||p_project_id||'p_task_id'||p_task_id||'l_txn_raw_revenue'||l_txn_raw_revenue||'l_txn_bill_rate'||l_txn_bill_rate||'l_rev_txn_curr_code'||l_rev_txn_curr_code;
3510: pa_debug.write('Get_plan_plan_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
3511: END IF;
3512: EXCEPTION
3513:
3506: x_revenue_rejection_code :=NULL;
3507: x_return_status :=l_x_return_status;
3508: IF g1_debug_mode = 'Y' THEN
3509: pa_debug.g_err_stage:='OUT of Get_plan_plan_Rates:p_project_id'||p_project_id||'p_task_id'||p_task_id||'l_txn_raw_revenue'||l_txn_raw_revenue||'l_txn_bill_rate'||l_txn_bill_rate||'l_rev_txn_curr_code'||l_rev_txn_curr_code;
3510: pa_debug.write('Get_plan_plan_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
3511: END IF;
3512: EXCEPTION
3513:
3514: WHEN l_no_cost THEN
3522: x_msg_count := 1;
3523:
3524:
3525: IF g1_debug_mode = 'Y' THEN
3526: pa_debug.g_err_stage:='No Cost exist for the tranascation:p_project_id'||p_project_id||'p_task_id'||p_task_id;
3527: pa_debug.write('Get_plan_plan_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
3528: END IF;
3529: WHEN l_bill_api THEN
3530: x_raw_revenue := NULL;
3523:
3524:
3525: IF g1_debug_mode = 'Y' THEN
3526: pa_debug.g_err_stage:='No Cost exist for the tranascation:p_project_id'||p_project_id||'p_task_id'||p_task_id;
3527: pa_debug.write('Get_plan_plan_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
3528: END IF;
3529: WHEN l_bill_api THEN
3530: x_raw_revenue := NULL;
3531: x_bill_rate := NULL;
3536: x_msg_data := l_bill_msg_data;
3537: x_msg_count := l_bill_msg_count;
3538:
3539: IF g1_debug_mode = 'Y' THEN
3540: pa_debug.g_err_stage:='Billing api is throwing error';
3541: pa_debug.write('Get_plan_plan_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
3542: END IF;
3543:
3544:
3537: x_msg_count := l_bill_msg_count;
3538:
3539: IF g1_debug_mode = 'Y' THEN
3540: pa_debug.g_err_stage:='Billing api is throwing error';
3541: pa_debug.write('Get_plan_plan_Rates : ' || g_module_name,pa_debug.g_err_stage,2);
3542: END IF;
3543:
3544:
3545: END Get_plan_plan_Rates;
3633: l_ovr_return_status VARCHAR2(20):=g_success;
3634: l_ovr_msg_count NUMBER;
3635: l_ovr_msg_data VARCHAR2(1000);
3636: BEGIN
3637: pa_debug.init_err_stack('PA_PLAN_REVENUE.Get_plan_default_rates');
3638: IF g1_debug_mode = 'Y' THEN
3639: pa_debug.g_err_stage:='Validating input parameters:->p_schedule_type'||p_schedule_type||'p_rate_based_flag'||p_rate_based_flag||'p_raw_cost'||p_raw_cost||'p_raw_revenue'||p_raw_revenue;
3640: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,3);
3641: END IF;
3635: l_ovr_msg_data VARCHAR2(1000);
3636: BEGIN
3637: pa_debug.init_err_stack('PA_PLAN_REVENUE.Get_plan_default_rates');
3638: IF g1_debug_mode = 'Y' THEN
3639: pa_debug.g_err_stage:='Validating input parameters:->p_schedule_type'||p_schedule_type||'p_rate_based_flag'||p_rate_based_flag||'p_raw_cost'||p_raw_cost||'p_raw_revenue'||p_raw_revenue;
3640: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,3);
3641: END IF;
3642: IF g1_debug_mode = 'Y' THEN
3643: pa_debug.g_err_stage:='Validating input parameters:->p_use_planning_rates_flag '||p_use_planning_rates_flag ||'p_plan_burden_cost_sch_id '||p_plan_burden_cost_sch_id ;
3636: BEGIN
3637: pa_debug.init_err_stack('PA_PLAN_REVENUE.Get_plan_default_rates');
3638: IF g1_debug_mode = 'Y' THEN
3639: pa_debug.g_err_stage:='Validating input parameters:->p_schedule_type'||p_schedule_type||'p_rate_based_flag'||p_rate_based_flag||'p_raw_cost'||p_raw_cost||'p_raw_revenue'||p_raw_revenue;
3640: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,3);
3641: END IF;
3642: IF g1_debug_mode = 'Y' THEN
3643: pa_debug.g_err_stage:='Validating input parameters:->p_use_planning_rates_flag '||p_use_planning_rates_flag ||'p_plan_burden_cost_sch_id '||p_plan_burden_cost_sch_id ;
3644: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,3);
3639: pa_debug.g_err_stage:='Validating input parameters:->p_schedule_type'||p_schedule_type||'p_rate_based_flag'||p_rate_based_flag||'p_raw_cost'||p_raw_cost||'p_raw_revenue'||p_raw_revenue;
3640: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,3);
3641: END IF;
3642: IF g1_debug_mode = 'Y' THEN
3643: pa_debug.g_err_stage:='Validating input parameters:->p_use_planning_rates_flag '||p_use_planning_rates_flag ||'p_plan_burden_cost_sch_id '||p_plan_burden_cost_sch_id ;
3644: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,3);
3645: END IF;
3646: IF g1_debug_mode = 'Y' THEN
3647: pa_debug.g_err_stage:='Validating input parameters:->p_nlr_organization_id '||p_nlr_organization_id ||'p_expenditure_org_id '||p_expenditure_org_id ||'p_override_to_organz_id '||p_override_to_organz_id;
3640: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,3);
3641: END IF;
3642: IF g1_debug_mode = 'Y' THEN
3643: pa_debug.g_err_stage:='Validating input parameters:->p_use_planning_rates_flag '||p_use_planning_rates_flag ||'p_plan_burden_cost_sch_id '||p_plan_burden_cost_sch_id ;
3644: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,3);
3645: END IF;
3646: IF g1_debug_mode = 'Y' THEN
3647: pa_debug.g_err_stage:='Validating input parameters:->p_nlr_organization_id '||p_nlr_organization_id ||'p_expenditure_org_id '||p_expenditure_org_id ||'p_override_to_organz_id '||p_override_to_organz_id;
3648: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,3);
3643: pa_debug.g_err_stage:='Validating input parameters:->p_use_planning_rates_flag '||p_use_planning_rates_flag ||'p_plan_burden_cost_sch_id '||p_plan_burden_cost_sch_id ;
3644: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,3);
3645: END IF;
3646: IF g1_debug_mode = 'Y' THEN
3647: pa_debug.g_err_stage:='Validating input parameters:->p_nlr_organization_id '||p_nlr_organization_id ||'p_expenditure_org_id '||p_expenditure_org_id ||'p_override_to_organz_id '||p_override_to_organz_id;
3648: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,3);
3649: END IF;
3650: IF g1_debug_mode = 'Y' THEN
3651: pa_debug.g_err_stage:='Validating input parameters:->p_incurred_by_organz_id'||p_incurred_by_organz_id ;
3644: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,3);
3645: END IF;
3646: IF g1_debug_mode = 'Y' THEN
3647: pa_debug.g_err_stage:='Validating input parameters:->p_nlr_organization_id '||p_nlr_organization_id ||'p_expenditure_org_id '||p_expenditure_org_id ||'p_override_to_organz_id '||p_override_to_organz_id;
3648: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,3);
3649: END IF;
3650: IF g1_debug_mode = 'Y' THEN
3651: pa_debug.g_err_stage:='Validating input parameters:->p_incurred_by_organz_id'||p_incurred_by_organz_id ;
3652: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,3);
3647: pa_debug.g_err_stage:='Validating input parameters:->p_nlr_organization_id '||p_nlr_organization_id ||'p_expenditure_org_id '||p_expenditure_org_id ||'p_override_to_organz_id '||p_override_to_organz_id;
3648: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,3);
3649: END IF;
3650: IF g1_debug_mode = 'Y' THEN
3651: pa_debug.g_err_stage:='Validating input parameters:->p_incurred_by_organz_id'||p_incurred_by_organz_id ;
3652: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,3);
3653: END IF;
3654: /* Assigning the parameters to local variables */
3655: l_burden_cost := p_burden_cost;
3648: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,3);
3649: END IF;
3650: IF g1_debug_mode = 'Y' THEN
3651: pa_debug.g_err_stage:='Validating input parameters:->p_incurred_by_organz_id'||p_incurred_by_organz_id ;
3652: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,3);
3653: END IF;
3654: /* Assigning the parameters to local variables */
3655: l_burden_cost := p_burden_cost;
3656: l_raw_cost := p_raw_cost;
3667: /* First computing the raw_cost if p_schedule_type is passed COST or NULL
3668: If COST is passed then it'll compute only Costing but if passed nll it'll
3669: compute both Costing as well as Revenue */
3670: IF g1_debug_mode = 'Y' THEN
3671: pa_debug.g_err_stage:='Calculating Costing data';
3672: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,5);
3673: END IF;
3674: IF NVL(p_schedule_type,'COST')='COST' THEN
3675: --13.02
3668: If COST is passed then it'll compute only Costing but if passed nll it'll
3669: compute both Costing as well as Revenue */
3670: IF g1_debug_mode = 'Y' THEN
3671: pa_debug.g_err_stage:='Calculating Costing data';
3672: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,5);
3673: END IF;
3674: IF NVL(p_schedule_type,'COST')='COST' THEN
3675: --13.02
3676: IF l_cost_rate IS NULL THEN
3710: IF l_raw_cost IS NULL THEN
3711: IF p_rate_based_flag = 'Y' THEN
3712: IF p_quantity IS NULL THEN
3713: IF g1_debug_mode = 'Y' THEN
3714: pa_debug.g_err_stage:='validating Get_plan_default_rates: p_quantity is required for rate based ';
3715: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,5);
3716: END IF;
3717: RAISE l_rate_based_no_quantity;
3718: END IF;
3711: IF p_rate_based_flag = 'Y' THEN
3712: IF p_quantity IS NULL THEN
3713: IF g1_debug_mode = 'Y' THEN
3714: pa_debug.g_err_stage:='validating Get_plan_default_rates: p_quantity is required for rate based ';
3715: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,5);
3716: END IF;
3717: RAISE l_rate_based_no_quantity;
3718: END IF;
3719: END IF;
3721: IF ( l_raw_cost IS NULL) THEN
3722: RAISE l_no_cost;
3723: END IF;
3724: IF g1_debug_mode = 'Y' THEN
3725: pa_debug.g_err_stage:='9999 l_cost_rate: ' || l_cost_rate|| 'raw_cost : ' ||l_raw_cost || 'currency_code : ' || l_txn_curr_code;
3726: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,3);
3727: END IF;
3728: EXCEPTION
3729: WHEN l_no_cost THEN
3722: RAISE l_no_cost;
3723: END IF;
3724: IF g1_debug_mode = 'Y' THEN
3725: pa_debug.g_err_stage:='9999 l_cost_rate: ' || l_cost_rate|| 'raw_cost : ' ||l_raw_cost || 'currency_code : ' || l_txn_curr_code;
3726: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,3);
3727: END IF;
3728: EXCEPTION
3729: WHEN l_no_cost THEN
3730: x_raw_cost := NULL;
3732: x_msg_data := 'PA_FCST_NO_COST_RATE';
3733: x_raw_cost_rejection_code := 'PA_FCST_NO_COST_RATE';
3734: x_msg_count := 1;
3735: IF g1_debug_mode = 'Y' THEN
3736: pa_debug.g_err_stage :='No Cost Rate Exists:p_project_id'||p_project_id||'p_task_id'||p_task_id;
3737: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,5);
3738: END IF;
3739: WHEN OTHERS THEN
3740: x_raw_cost := NULL;
3733: x_raw_cost_rejection_code := 'PA_FCST_NO_COST_RATE';
3734: x_msg_count := 1;
3735: IF g1_debug_mode = 'Y' THEN
3736: pa_debug.g_err_stage :='No Cost Rate Exists:p_project_id'||p_project_id||'p_task_id'||p_task_id;
3737: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,5);
3738: END IF;
3739: WHEN OTHERS THEN
3740: x_raw_cost := NULL;
3741: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
3742: x_msg_count := 1;
3743: x_msg_data := SUBSTR(SQLERRM,1,30);
3744: x_raw_cost_rejection_code := SUBSTR(SQLERRM,1,30);
3745: IF g1_debug_mode = 'Y' THEN
3746: pa_debug.g_err_stage :='Unexpected Error'||SQLERRM;
3747: pa_debug.write('Get_Res_Class_Rates: ' || g_module_name,pa_debug.g_err_stage,5);
3748: END IF;
3749: RAISE;
3750: END;
3743: x_msg_data := SUBSTR(SQLERRM,1,30);
3744: x_raw_cost_rejection_code := SUBSTR(SQLERRM,1,30);
3745: IF g1_debug_mode = 'Y' THEN
3746: pa_debug.g_err_stage :='Unexpected Error'||SQLERRM;
3747: pa_debug.write('Get_Res_Class_Rates: ' || g_module_name,pa_debug.g_err_stage,5);
3748: END IF;
3749: RAISE;
3750: END;
3751: /* End of Begin for Revenue Scedule Type */
3764: then the folowing code will be executed */
3765: IF l_burden_cost IS NOT NULL THEN
3766: --assigning override burden cost/or derived burden cost from Actual
3767: IF g1_debug_mode = 'Y' THEN
3768: pa_debug.g_err_stage := 'Assignging override burden cost values to out params';
3769: pa_debug.write('Get_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
3770: END IF;
3771: l_txn_burden_cost :=l_burden_cost;
3772: IF (p_quantity <> 0 ) THEN
3765: IF l_burden_cost IS NOT NULL THEN
3766: --assigning override burden cost/or derived burden cost from Actual
3767: IF g1_debug_mode = 'Y' THEN
3768: pa_debug.g_err_stage := 'Assignging override burden cost values to out params';
3769: pa_debug.write('Get_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
3770: END IF;
3771: l_txn_burden_cost :=l_burden_cost;
3772: IF (p_quantity <> 0 ) THEN
3773: l_txn_burden_cost_rate := l_burden_cost / NVL(p_quantity,1) ;
3846: l_inter_return_status := NVL(l_inter_return_status,l_x_return_status);
3847: x_burden_cost_rejection_code:= l_burden_cost_rejection_code;
3848: /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
3849: IF g1_debug_mode = 'Y' THEN
3850: pa_debug.g_err_stage := 'Going to calculate revenue:->p_schedule_type'||p_schedule_type||'l_raw_revenue'||l_raw_revenue||'l_raw_cost'||l_raw_cost||'l_txn_burden_cost'||l_txn_burden_cost;
3851: pa_debug.write('Get_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
3852: END IF;
3853: IF NVL(p_schedule_type,'REVENUE')='REVENUE' THEN
3854: IF p_system_linkage ='BTC' THEN
3847: x_burden_cost_rejection_code:= l_burden_cost_rejection_code;
3848: /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
3849: IF g1_debug_mode = 'Y' THEN
3850: pa_debug.g_err_stage := 'Going to calculate revenue:->p_schedule_type'||p_schedule_type||'l_raw_revenue'||l_raw_revenue||'l_raw_cost'||l_raw_cost||'l_txn_burden_cost'||l_txn_burden_cost;
3851: pa_debug.write('Get_res_class_rates: ' || g_module_name,pa_debug.g_err_stage,3);
3852: END IF;
3853: IF NVL(p_schedule_type,'REVENUE')='REVENUE' THEN
3854: IF p_system_linkage ='BTC' THEN
3855: l_raw_cost := NVL(l_txn_burden_cost,p_burden_cost);
3896: IF NVL(p_rate_based_flag,'N') ='N' THEN
3897: l_raw_cost :=p_quantity;
3898: END IF;
3899: IF g1_debug_mode = 'Y' THEN
3900: pa_debug.g_err_stage := 'p_quanity is directly getting converted to l_raw_cost for only REVENUE mode:l_raw_cost'||l_raw_cost;
3901: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,3);
3902: END IF;
3903: END IF;
3904: IF l_raw_revenue IS NULL THEN
3897: l_raw_cost :=p_quantity;
3898: END IF;
3899: IF g1_debug_mode = 'Y' THEN
3900: pa_debug.g_err_stage := 'p_quanity is directly getting converted to l_raw_cost for only REVENUE mode:l_raw_cost'||l_raw_cost;
3901: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,3);
3902: END IF;
3903: END IF;
3904: IF l_raw_revenue IS NULL THEN
3905: l_true := FALSE;
3908: END IF;
3909: IF p_rate_based_flag ='Y' THEN
3910: IF p_quantity IS NULL THEN
3911: IF g1_debug_mode = 'Y' THEN
3912: pa_debug.g_err_stage:='validating Get_plan_default_rates: p_quantity is required for rate based ';
3913: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,5);
3914: END IF;
3915: RAISE l_rate_based_no_quantity;
3916: END IF;
3909: IF p_rate_based_flag ='Y' THEN
3910: IF p_quantity IS NULL THEN
3911: IF g1_debug_mode = 'Y' THEN
3912: pa_debug.g_err_stage:='validating Get_plan_default_rates: p_quantity is required for rate based ';
3913: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,5);
3914: END IF;
3915: RAISE l_rate_based_no_quantity;
3916: END IF;
3917: END IF;
3941: x_bill_markup_percentage := l_markup ;
3942: x_rev_txn_curr_code := l_bill_txn_curr_code ;
3943: x_return_status := l_x_return_status;
3944: IF g1_debug_mode = 'Y' THEN
3945: pa_debug.g_err_stage :='l_bill_rate: ' || l_bill_rate || 'Revenue : ' || l_raw_revenue || 'currency_code : ' || l_bill_txn_curr_code;
3946: pa_debug.write('Get_plan_default_rates : ' || g_module_name,pa_debug.g_err_stage,2);
3947: END IF;
3948: EXCEPTION
3949: WHEN l_no_revenue THEN
3942: x_rev_txn_curr_code := l_bill_txn_curr_code ;
3943: x_return_status := l_x_return_status;
3944: IF g1_debug_mode = 'Y' THEN
3945: pa_debug.g_err_stage :='l_bill_rate: ' || l_bill_rate || 'Revenue : ' || l_raw_revenue || 'currency_code : ' || l_bill_txn_curr_code;
3946: pa_debug.write('Get_plan_default_rates : ' || g_module_name,pa_debug.g_err_stage,2);
3947: END IF;
3948: EXCEPTION
3949: WHEN l_no_revenue THEN
3950: RAISE l_no_revenue;
3966: x_bill_rate := l_bill_rate ;
3967: x_bill_markup_percentage := l_markup ;
3968: x_rev_txn_curr_code := l_bill_txn_curr_code;
3969: x_return_status := l_x_return_status;
3970: pa_debug.reset_err_stack;
3971: EXCEPTION
3972: WHEN l_insufficeient_param THEN
3973: IF g1_debug_mode = 'Y' THEN
3974: pa_debug.g_err_stage:='All the Required parameters are not passes to Resource Schedule';
3970: pa_debug.reset_err_stack;
3971: EXCEPTION
3972: WHEN l_insufficeient_param THEN
3973: IF g1_debug_mode = 'Y' THEN
3974: pa_debug.g_err_stage:='All the Required parameters are not passes to Resource Schedule';
3975: pa_debug.write('Get_plan_default_rates : ' || g_module_name,pa_debug.g_err_stage,3);
3976: END IF;
3977: x_return_status := g_ERROR;
3978: x_msg_count := 1;
3971: EXCEPTION
3972: WHEN l_insufficeient_param THEN
3973: IF g1_debug_mode = 'Y' THEN
3974: pa_debug.g_err_stage:='All the Required parameters are not passes to Resource Schedule';
3975: pa_debug.write('Get_plan_default_rates : ' || g_module_name,pa_debug.g_err_stage,3);
3976: END IF;
3977: x_return_status := g_ERROR;
3978: x_msg_count := 1;
3979: x_msg_data := 'PA_FCST_INSUFFICIENT_PARA';
3983: x_raw_revenue := NULL;
3984: x_raw_cost := NULL;
3985: x_bill_rate := NULL;
3986: x_cost_rate := NULL;
3987: pa_debug.reset_err_stack;
3988: WHEN l_rate_based_no_quantity THEN
3989: IF g1_debug_mode = 'Y' THEN
3990: pa_debug.g_err_stage:='Quantity is required for a rate based transaction';
3991: pa_debug.write('Get_plan_default_rates : ' || g_module_name,pa_debug.g_err_stage,3);
3986: x_cost_rate := NULL;
3987: pa_debug.reset_err_stack;
3988: WHEN l_rate_based_no_quantity THEN
3989: IF g1_debug_mode = 'Y' THEN
3990: pa_debug.g_err_stage:='Quantity is required for a rate based transaction';
3991: pa_debug.write('Get_plan_default_rates : ' || g_module_name,pa_debug.g_err_stage,3);
3992: END IF;
3993: x_return_status := g_ERROR;
3994: x_msg_count := 1;
3987: pa_debug.reset_err_stack;
3988: WHEN l_rate_based_no_quantity THEN
3989: IF g1_debug_mode = 'Y' THEN
3990: pa_debug.g_err_stage:='Quantity is required for a rate based transaction';
3991: pa_debug.write('Get_plan_default_rates : ' || g_module_name,pa_debug.g_err_stage,3);
3992: END IF;
3993: x_return_status := g_ERROR;
3994: x_msg_count := 1;
3995: x_msg_data := 'PA_EX_QTY_EXIST';
3998: x_raw_revenue := NULL;
3999: x_raw_cost := NULL;
4000: x_bill_rate := NULL;
4001: x_cost_rate := NULL;
4002: pa_debug.reset_err_stack;
4003: WHEN l_no_cost THEN
4004: x_raw_revenue := NULL;
4005: x_raw_cost := NULL;
4006: x_bill_rate := NULL;
4011: x_burden_cost_rejection_code := 'PA_FCST_NO_COST_RATE';
4012: x_revenue_rejection_code := 'PA_FCST_NO_COST_RATE';
4013: x_msg_count := 1;
4014: IF g1_debug_mode = 'Y' THEN
4015: pa_debug.g_err_stage :='No Cost Rate Exists:p_project_id'||p_project_id||'p_task_id'||p_task_id;
4016: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,5);
4017: END IF;
4018: pa_debug.reset_err_stack;
4019: WHEN l_no_revenue THEN
4012: x_revenue_rejection_code := 'PA_FCST_NO_COST_RATE';
4013: x_msg_count := 1;
4014: IF g1_debug_mode = 'Y' THEN
4015: pa_debug.g_err_stage :='No Cost Rate Exists:p_project_id'||p_project_id||'p_task_id'||p_task_id;
4016: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,5);
4017: END IF;
4018: pa_debug.reset_err_stack;
4019: WHEN l_no_revenue THEN
4020: x_raw_revenue := NULL;
4014: IF g1_debug_mode = 'Y' THEN
4015: pa_debug.g_err_stage :='No Cost Rate Exists:p_project_id'||p_project_id||'p_task_id'||p_task_id;
4016: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,5);
4017: END IF;
4018: pa_debug.reset_err_stack;
4019: WHEN l_no_revenue THEN
4020: x_raw_revenue := NULL;
4021: x_bill_rate := NULL;
4022: x_return_status := NVL(l_inter_return_status,g_ERROR);
4023: x_msg_data := 'PA_FCST_NO_BILL_RATE';
4024: x_revenue_rejection_code := 'PA_FCST_NO_BILL_RATE';
4025: x_msg_count := 1;
4026: IF g1_debug_mode = 'Y' THEN
4027: pa_debug.g_err_stage :='No Bill Rate Exists:p_project_id'||p_project_id||'p_task_id'||p_task_id;
4028: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,5);
4029: END IF;
4030: pa_debug.reset_err_stack;
4031: WHEN OTHERS THEN
4024: x_revenue_rejection_code := 'PA_FCST_NO_BILL_RATE';
4025: x_msg_count := 1;
4026: IF g1_debug_mode = 'Y' THEN
4027: pa_debug.g_err_stage :='No Bill Rate Exists:p_project_id'||p_project_id||'p_task_id'||p_task_id;
4028: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,5);
4029: END IF;
4030: pa_debug.reset_err_stack;
4031: WHEN OTHERS THEN
4032: x_raw_revenue := NULL;
4026: IF g1_debug_mode = 'Y' THEN
4027: pa_debug.g_err_stage :='No Bill Rate Exists:p_project_id'||p_project_id||'p_task_id'||p_task_id;
4028: pa_debug.write('Get_plan_default_rates: ' || g_module_name,pa_debug.g_err_stage,5);
4029: END IF;
4030: pa_debug.reset_err_stack;
4031: WHEN OTHERS THEN
4032: x_raw_revenue := NULL;
4033: x_raw_cost := NULL;
4034: x_bill_rate := NULL;
4039: x_revenue_rejection_code := SUBSTR(SQLERRM,1,30);
4040: x_raw_cost_rejection_code := SUBSTR(SQLERRM,1,30);
4041: x_burden_cost_rejection_code := SUBSTR(SQLERRM,1,30);
4042: IF g1_debug_mode = 'Y' THEN
4043: pa_debug.g_err_stage :='SQLERROR ' || SQLCODE;
4044: pa_debug.write('Get_plan_default_rates : ' || g_module_name,pa_debug.g_err_stage,5);
4045: END IF;
4046: pa_debug.reset_err_stack;
4047: RAISE;
4040: x_raw_cost_rejection_code := SUBSTR(SQLERRM,1,30);
4041: x_burden_cost_rejection_code := SUBSTR(SQLERRM,1,30);
4042: IF g1_debug_mode = 'Y' THEN
4043: pa_debug.g_err_stage :='SQLERROR ' || SQLCODE;
4044: pa_debug.write('Get_plan_default_rates : ' || g_module_name,pa_debug.g_err_stage,5);
4045: END IF;
4046: pa_debug.reset_err_stack;
4047: RAISE;
4048: END Get_plan_default_rates ;
4042: IF g1_debug_mode = 'Y' THEN
4043: pa_debug.g_err_stage :='SQLERROR ' || SQLCODE;
4044: pa_debug.write('Get_plan_default_rates : ' || g_module_name,pa_debug.g_err_stage,5);
4045: END IF;
4046: pa_debug.reset_err_stack;
4047: RAISE;
4048: END Get_plan_default_rates ;
4049: /*End of CBS Changes*/
4050: BEGIN