1: package body PA_FUNDS_CONTROL_UTILS2 as
2: -- $Header: PAFUTL2B.pls 120.2 2006/07/14 06:14:44 anuagraw noship $
3:
4: PROCEDURE PRINT_MSG (p_debug_flag varchar2 default 'N'
5: ,p_msg varchar2) IS
26: from pa_implementations_all imp
27: where imp.org_id = nvl(p_proj_org_id,-99) ; /*5368274*/
28:
29: BEGIN
30: If pa_funds_control_utils2.g_cwk_implemented_flag is NULL Then
31: Open check_cwk_implemented;
32: Fetch check_cwk_implemented INTO l_check_cwk_implemented;
33: Close check_cwk_implemented;
34: pa_funds_control_utils2.g_cwk_implemented_flag := l_check_cwk_implemented;
30: If pa_funds_control_utils2.g_cwk_implemented_flag is NULL Then
31: Open check_cwk_implemented;
32: Fetch check_cwk_implemented INTO l_check_cwk_implemented;
33: Close check_cwk_implemented;
34: pa_funds_control_utils2.g_cwk_implemented_flag := l_check_cwk_implemented;
35: Else
36: l_check_cwk_implemented := pa_funds_control_utils2.g_cwk_implemented_flag ;
37: End If;
38:
32: Fetch check_cwk_implemented INTO l_check_cwk_implemented;
33: Close check_cwk_implemented;
34: pa_funds_control_utils2.g_cwk_implemented_flag := l_check_cwk_implemented;
35: Else
36: l_check_cwk_implemented := pa_funds_control_utils2.g_cwk_implemented_flag ;
37: End If;
38:
39: If l_check_cwk_implemented = 'Y' Then
40:
175: l_debug_mode varchar2(100) := 'N';
176:
177: BEGIN
178: --Initialize the error stack
179: PA_DEBUG.set_curr_function('PA_FUNDS_CONTROL_UTILS2.get_CWK_RLMI');
180:
181: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
182: l_debug_mode := NVL(l_debug_mode, 'N');
183:
351: AND NVL(pt.burden_amt_display_method,'N') = 'D';
352:
353: BEGIN
354:
355: PA_DEBUG.set_curr_function('PA_FUNDS_CONTROL_UTILS2.checkCWKbdCostCodes');
356:
357: fnd_profile.get('PA_DEBUG_MODE',l_debug_mode);
358: l_debug_mode := NVL(l_debug_mode, 'N');
359:
370: l_debug_stage := 'Inside checkCWKbdCostCodes api';
371: print_msg(l_debug_mode,l_debug_stage);
372:
373: -- Check the summary record burden components count
374: IF (p_project_id <> NVL(pa_funds_control_utils2.g_bd_cache_proj_id,0) OR
375: p_task_id <> nvl(pa_funds_control_utils2.g_bd_cache_task_id,0) OR
376: p_doc_line_id <> nvl(pa_funds_control_utils2.g_bd_cache_doc_line_id,0) OR
377: p_exp_type <> nvl(pa_funds_control_utils2.g_bd_cache_exp_type,'') OR
378: p_exp_item_date <> nvl(pa_funds_control_utils2.g_bd_cache_Ei_date,'') ) THEN
371: print_msg(l_debug_mode,l_debug_stage);
372:
373: -- Check the summary record burden components count
374: IF (p_project_id <> NVL(pa_funds_control_utils2.g_bd_cache_proj_id,0) OR
375: p_task_id <> nvl(pa_funds_control_utils2.g_bd_cache_task_id,0) OR
376: p_doc_line_id <> nvl(pa_funds_control_utils2.g_bd_cache_doc_line_id,0) OR
377: p_exp_type <> nvl(pa_funds_control_utils2.g_bd_cache_exp_type,'') OR
378: p_exp_item_date <> nvl(pa_funds_control_utils2.g_bd_cache_Ei_date,'') ) THEN
379: l_debug_stage := 'Excuting cursor to fetch the values';
372:
373: -- Check the summary record burden components count
374: IF (p_project_id <> NVL(pa_funds_control_utils2.g_bd_cache_proj_id,0) OR
375: p_task_id <> nvl(pa_funds_control_utils2.g_bd_cache_task_id,0) OR
376: p_doc_line_id <> nvl(pa_funds_control_utils2.g_bd_cache_doc_line_id,0) OR
377: p_exp_type <> nvl(pa_funds_control_utils2.g_bd_cache_exp_type,'') OR
378: p_exp_item_date <> nvl(pa_funds_control_utils2.g_bd_cache_Ei_date,'') ) THEN
379: l_debug_stage := 'Excuting cursor to fetch the values';
380: print_msg(l_debug_mode,l_debug_stage);
373: -- Check the summary record burden components count
374: IF (p_project_id <> NVL(pa_funds_control_utils2.g_bd_cache_proj_id,0) OR
375: p_task_id <> nvl(pa_funds_control_utils2.g_bd_cache_task_id,0) OR
376: p_doc_line_id <> nvl(pa_funds_control_utils2.g_bd_cache_doc_line_id,0) OR
377: p_exp_type <> nvl(pa_funds_control_utils2.g_bd_cache_exp_type,'') OR
378: p_exp_item_date <> nvl(pa_funds_control_utils2.g_bd_cache_Ei_date,'') ) THEN
379: l_debug_stage := 'Excuting cursor to fetch the values';
380: print_msg(l_debug_mode,l_debug_stage);
381: l_exp_string:= null;
374: IF (p_project_id <> NVL(pa_funds_control_utils2.g_bd_cache_proj_id,0) OR
375: p_task_id <> nvl(pa_funds_control_utils2.g_bd_cache_task_id,0) OR
376: p_doc_line_id <> nvl(pa_funds_control_utils2.g_bd_cache_doc_line_id,0) OR
377: p_exp_type <> nvl(pa_funds_control_utils2.g_bd_cache_exp_type,'') OR
378: p_exp_item_date <> nvl(pa_funds_control_utils2.g_bd_cache_Ei_date,'') ) THEN
379: l_debug_stage := 'Excuting cursor to fetch the values';
380: print_msg(l_debug_mode,l_debug_stage);
381: l_exp_string:= null;
382: l_expCostCodeCount := 0;
393: End If;
394: l_exp_string:= substr(l_exp_string,1,length(l_exp_string)-1);
395: l_debug_stage := 'Summary Record CostCodes['||l_exp_string||']CostCodeCount['||l_expCostCodeCount||']' ;
396: print_msg(l_debug_mode,l_debug_stage);
397: pa_funds_control_utils2.g_bd_cache_exp_string := l_exp_string;
398: pa_funds_control_utils2.g_bd_cache_proj_id := p_project_id;
399: pa_funds_control_utils2.g_bd_cache_task_id := p_task_id;
400: pa_funds_control_utils2.g_bd_cache_doc_line_id := p_doc_line_id;
401: pa_funds_control_utils2.g_bd_cache_exp_type := p_exp_type;
394: l_exp_string:= substr(l_exp_string,1,length(l_exp_string)-1);
395: l_debug_stage := 'Summary Record CostCodes['||l_exp_string||']CostCodeCount['||l_expCostCodeCount||']' ;
396: print_msg(l_debug_mode,l_debug_stage);
397: pa_funds_control_utils2.g_bd_cache_exp_string := l_exp_string;
398: pa_funds_control_utils2.g_bd_cache_proj_id := p_project_id;
399: pa_funds_control_utils2.g_bd_cache_task_id := p_task_id;
400: pa_funds_control_utils2.g_bd_cache_doc_line_id := p_doc_line_id;
401: pa_funds_control_utils2.g_bd_cache_exp_type := p_exp_type;
402: pa_funds_control_utils2.g_bd_cache_Ei_date := p_exp_item_date;
395: l_debug_stage := 'Summary Record CostCodes['||l_exp_string||']CostCodeCount['||l_expCostCodeCount||']' ;
396: print_msg(l_debug_mode,l_debug_stage);
397: pa_funds_control_utils2.g_bd_cache_exp_string := l_exp_string;
398: pa_funds_control_utils2.g_bd_cache_proj_id := p_project_id;
399: pa_funds_control_utils2.g_bd_cache_task_id := p_task_id;
400: pa_funds_control_utils2.g_bd_cache_doc_line_id := p_doc_line_id;
401: pa_funds_control_utils2.g_bd_cache_exp_type := p_exp_type;
402: pa_funds_control_utils2.g_bd_cache_Ei_date := p_exp_item_date;
403: If l_exp_string is NULL Then
396: print_msg(l_debug_mode,l_debug_stage);
397: pa_funds_control_utils2.g_bd_cache_exp_string := l_exp_string;
398: pa_funds_control_utils2.g_bd_cache_proj_id := p_project_id;
399: pa_funds_control_utils2.g_bd_cache_task_id := p_task_id;
400: pa_funds_control_utils2.g_bd_cache_doc_line_id := p_doc_line_id;
401: pa_funds_control_utils2.g_bd_cache_exp_type := p_exp_type;
402: pa_funds_control_utils2.g_bd_cache_Ei_date := p_exp_item_date;
403: If l_exp_string is NULL Then
404: l_error_flag := 'N';
397: pa_funds_control_utils2.g_bd_cache_exp_string := l_exp_string;
398: pa_funds_control_utils2.g_bd_cache_proj_id := p_project_id;
399: pa_funds_control_utils2.g_bd_cache_task_id := p_task_id;
400: pa_funds_control_utils2.g_bd_cache_doc_line_id := p_doc_line_id;
401: pa_funds_control_utils2.g_bd_cache_exp_type := p_exp_type;
402: pa_funds_control_utils2.g_bd_cache_Ei_date := p_exp_item_date;
403: If l_exp_string is NULL Then
404: l_error_flag := 'N';
405:
398: pa_funds_control_utils2.g_bd_cache_proj_id := p_project_id;
399: pa_funds_control_utils2.g_bd_cache_task_id := p_task_id;
400: pa_funds_control_utils2.g_bd_cache_doc_line_id := p_doc_line_id;
401: pa_funds_control_utils2.g_bd_cache_exp_type := p_exp_type;
402: pa_funds_control_utils2.g_bd_cache_Ei_date := p_exp_item_date;
403: If l_exp_string is NULL Then
404: l_error_flag := 'N';
405:
406: Elsif l_exp_string is NOT NULL Then
482: l_result_code := NULL;
483: l_status_code := 'P';
484: l_return_status := 'S';
485: End If;
486: pa_funds_control_utils2.g_bd_cache_result_code := l_result_code;
487: pa_funds_control_utils2.g_bd_cache_status_code := l_status_code;
488:
489: ELSE
490: l_exp_string := pa_funds_control_utils2.g_bd_cache_exp_string;
483: l_status_code := 'P';
484: l_return_status := 'S';
485: End If;
486: pa_funds_control_utils2.g_bd_cache_result_code := l_result_code;
487: pa_funds_control_utils2.g_bd_cache_status_code := l_status_code;
488:
489: ELSE
490: l_exp_string := pa_funds_control_utils2.g_bd_cache_exp_string;
491: l_status_code := pa_funds_control_utils2.g_bd_cache_status_code;
486: pa_funds_control_utils2.g_bd_cache_result_code := l_result_code;
487: pa_funds_control_utils2.g_bd_cache_status_code := l_status_code;
488:
489: ELSE
490: l_exp_string := pa_funds_control_utils2.g_bd_cache_exp_string;
491: l_status_code := pa_funds_control_utils2.g_bd_cache_status_code;
492: l_result_code := pa_funds_control_utils2.g_bd_cache_result_code;
493:
494: END If;
487: pa_funds_control_utils2.g_bd_cache_status_code := l_status_code;
488:
489: ELSE
490: l_exp_string := pa_funds_control_utils2.g_bd_cache_exp_string;
491: l_status_code := pa_funds_control_utils2.g_bd_cache_status_code;
492: l_result_code := pa_funds_control_utils2.g_bd_cache_result_code;
493:
494: END If;
495: l_debug_stage := 'End Of checkCWKbdCostCodes Statuscode['||l_status_code||']Rescode['||l_result_code||']';
488:
489: ELSE
490: l_exp_string := pa_funds_control_utils2.g_bd_cache_exp_string;
491: l_status_code := pa_funds_control_utils2.g_bd_cache_status_code;
492: l_result_code := pa_funds_control_utils2.g_bd_cache_result_code;
493:
494: END If;
495: l_debug_stage := 'End Of checkCWKbdCostCodes Statuscode['||l_status_code||']Rescode['||l_result_code||']';
496: print_msg(l_debug_mode,l_debug_stage);
517: when others then
518: x_return_status := 'U';
519: x_status_code := 'T';
520: x_result_code := 'F100';
521: pa_funds_control_utils2.g_bd_cache_status_code := NULL;
522: pa_funds_control_utils2.g_bd_cache_result_code := NULL;
523: pa_funds_control_utils2.g_bd_cache_exp_string := NULL;
524: pa_debug.reset_err_stack;
525: RAISE;
518: x_return_status := 'U';
519: x_status_code := 'T';
520: x_result_code := 'F100';
521: pa_funds_control_utils2.g_bd_cache_status_code := NULL;
522: pa_funds_control_utils2.g_bd_cache_result_code := NULL;
523: pa_funds_control_utils2.g_bd_cache_exp_string := NULL;
524: pa_debug.reset_err_stack;
525: RAISE;
526:
519: x_status_code := 'T';
520: x_result_code := 'F100';
521: pa_funds_control_utils2.g_bd_cache_status_code := NULL;
522: pa_funds_control_utils2.g_bd_cache_result_code := NULL;
523: pa_funds_control_utils2.g_bd_cache_exp_string := NULL;
524: pa_debug.reset_err_stack;
525: RAISE;
526:
527: END checkCWKbdCostCodes;