1: PACKAGE BODY GMS_SUMMARIZE_BUDGETS AS
2: -- $Header: gmsbusub.pls 120.6 2011/11/04 05:50:21 mokukuma ship $
3:
4: -- To check on, whether to print debug messages in log file or not
5: L_DEBUG varchar2(1) := NVL(FND_PROFILE.value('GMS_ENABLE_DEBUG_MODE'), 'N');
6: x_mixed_budgeting varchar2(1);
7:
8: -- Bug 2587078 : Modified parameter name from x_err_code to x_return_status
9: -- to bring the code in consistency with existing grants code
138: l_validate_profile := 'N' ;
139: L_res_categorized := 'N' ;
140:
141: IF l_bem_count >= 1 and l_res_list_count > 1 then
142: G_project_bem := fnd_profile.value('GMS_PROJECT_BEM_UNCATEGORIZED');
143: if G_project_bem IS NOT NULL then
144: l_res_categorized := 'N' ;
145: l_validate_profile := 'Y' ;
146: else
172:
173: end if;
174:
175: IF l_bem_count > 1 and l_res_list_count = 1 and l_res_list_name = 'None' then
176: G_project_bem := fnd_profile.value('GMS_PROJECT_BEM_UNCATEGORIZED');
177: l_res_categorized := 'N' ;
178: l_validate_profile := 'Y' ;
179: END IF ;
180:
178: l_validate_profile := 'Y' ;
179: END IF ;
180:
181: IF l_bem_count > 1 and l_res_list_count = 1 and l_res_list_name <> 'None' then
182: G_project_bem := fnd_profile.value('GMS_PROJECT_BEM_CATEGORIZED');
183: L_res_categorized := 'Y' ;
184: l_validate_profile := 'Y' ;
185: END IF ;
186:
198: where bv.budget_entry_method_code = bem.budget_entry_method_code
199: and bv.project_id = x_project_id ;
200:
201: IF l_time_phased_type_code = 'R' and l_res_list_name = 'None' then
202: G_project_bem := fnd_profile.value('GMS_PROJECT_BEM_UNCATEGORIZED');
203: l_res_categorized := 'N' ;
204: l_validate_profile := 'Y' ;
205: END IF ;
206:
208:
209: IF L_DEBUG = 'Y' THEN
210: gms_error_pkg.gms_debug('GMS_SUMMARIZE_BUDGETS.SUMMARIZE_BASELINED_VERSIONS - Setting CAT profile : ','C');
211: end if ;
212: G_project_bem := fnd_profile.value('GMS_PROJECT_BEM_CATEGORIZED');
213: l_res_categorized := 'Y' ;
214: l_validate_profile := 'Y' ;
215:
216: END IF ;
910: -- "PA: Cross Project User - View". These values are lost after calling set_global_info
911: -- which calls fnd_global.apps_initialize.
912:
913: /* bug 8214030 changes start*/
914: l_user_profile_value1 := fnd_profile.value_specific(
915: NAME => 'PA_SUPER_PROJECT',
916: USER_ID => fnd_global.user_id,
917: RESPONSIBILITY_ID => fnd_global.resp_id,
918: APPLICATION_ID => fnd_global.resp_appl_id);
921:
922: BEGIN
923: SELECT profile_option_value
924: INTO l_user_profile_value1
925: FROM fnd_profile_options p,
926: fnd_profile_option_values v
927: WHERE p.profile_option_name = 'PA_SUPER_PROJECT'
928: AND v.profile_option_id = p.profile_option_id
929: AND v.level_id = 10004
922: BEGIN
923: SELECT profile_option_value
924: INTO l_user_profile_value1
925: FROM fnd_profile_options p,
926: fnd_profile_option_values v
927: WHERE p.profile_option_name = 'PA_SUPER_PROJECT'
928: AND v.profile_option_id = p.profile_option_id
929: AND v.level_id = 10004
930: AND v.level_value = fnd_global.user_id;
933: l_user_profile_value1 := null;
934: WHEN others THEN
935: l_user_profile_value1 := null;
936: END;
937: l_set_profile_success1 := fnd_profile.save('PA_SUPER_PROJECT', 'Y', 'USER', fnd_global.user_id);
938: end if;
939:
940: l_user_profile_value2 := fnd_profile.value_specific(
941: NAME => 'PA_SUPER_PROJECT_VIEW',
936: END;
937: l_set_profile_success1 := fnd_profile.save('PA_SUPER_PROJECT', 'Y', 'USER', fnd_global.user_id);
938: end if;
939:
940: l_user_profile_value2 := fnd_profile.value_specific(
941: NAME => 'PA_SUPER_PROJECT_VIEW',
942: USER_ID => fnd_global.user_id,
943: RESPONSIBILITY_ID => fnd_global.resp_id,
944: APPLICATION_ID => fnd_global.resp_appl_id);
946: if ((l_user_profile_value2 = 'N') OR (l_user_profile_value2 is null)) then
947: BEGIN
948: SELECT profile_option_value
949: INTO l_user_profile_value2
950: FROM fnd_profile_options p,
951: fnd_profile_option_values v
952: WHERE p.profile_option_name = 'PA_SUPER_PROJECT_VIEW'
953: AND v.profile_option_id = p.profile_option_id
954: AND v.level_id = 10004
947: BEGIN
948: SELECT profile_option_value
949: INTO l_user_profile_value2
950: FROM fnd_profile_options p,
951: fnd_profile_option_values v
952: WHERE p.profile_option_name = 'PA_SUPER_PROJECT_VIEW'
953: AND v.profile_option_id = p.profile_option_id
954: AND v.level_id = 10004
955: AND v.level_value = fnd_global.user_id;
958: l_user_profile_value2 := null;
959: WHEN others THEN
960: l_user_profile_value2 := null;
961: END;
962: l_set_profile_success2 := fnd_profile.save('PA_SUPER_PROJECT_VIEW', 'Y', 'USER', fnd_global.user_id);
963: end if;
964:
965: /* bug 8214030 changes end*/
966: -- Bug 3770971 end. Values will be set back in gms_budget_pub after summarize_budgets is done.
1372: END IF;
1373:
1374: /* bug 8214030: resetting the profile values back */
1375: if (l_set_profile_success1 = TRUE) then
1376: l_set_profile_success1 := fnd_profile.save('PA_SUPER_PROJECT', l_user_profile_value1, 'USER', fnd_global.user_id);
1377: end if;
1378: if (l_set_profile_success2 = TRUE) then
1379: l_set_profile_success2 := fnd_profile.save('PA_SUPER_PROJECT_VIEW', l_user_profile_value2, 'USER', fnd_global.user_id);
1380: end if;
1375: if (l_set_profile_success1 = TRUE) then
1376: l_set_profile_success1 := fnd_profile.save('PA_SUPER_PROJECT', l_user_profile_value1, 'USER', fnd_global.user_id);
1377: end if;
1378: if (l_set_profile_success2 = TRUE) then
1379: l_set_profile_success2 := fnd_profile.save('PA_SUPER_PROJECT_VIEW', l_user_profile_value2, 'USER', fnd_global.user_id);
1380: end if;
1381:
1382: EXCEPTION
1383: WHEN FND_API.G_EXC_ERROR THEN
1388: gms_error_pkg.gms_debug('GMS_SUMMARIZE_BUDGETS.SUMMARIZE_BASELINED_VERSIONS - x_return_status ----- : '|| x_return_status,'C');
1389: ERRBUF := x_err_stage;
1390: /* bug 8214030: resetting the profile values back */
1391: if (l_set_profile_success1 = TRUE) then
1392: l_set_profile_success1 := fnd_profile.save('PA_SUPER_PROJECT', l_user_profile_value1, 'USER', fnd_global.user_id);
1393: end if;
1394: if (l_set_profile_success2 = TRUE) then
1395: l_set_profile_success2 := fnd_profile.save('PA_SUPER_PROJECT_VIEW', l_user_profile_value2, 'USER', fnd_global.user_id);
1396: end if;
1391: if (l_set_profile_success1 = TRUE) then
1392: l_set_profile_success1 := fnd_profile.save('PA_SUPER_PROJECT', l_user_profile_value1, 'USER', fnd_global.user_id);
1393: end if;
1394: if (l_set_profile_success2 = TRUE) then
1395: l_set_profile_success2 := fnd_profile.save('PA_SUPER_PROJECT_VIEW', l_user_profile_value2, 'USER', fnd_global.user_id);
1396: end if;
1397: when OTHERS THEN
1398: IF L_DEBUG = 'Y' THEN
1399: gms_error_pkg.gms_debug('GMS_SUMMARIZE_BUDGETS.SUMMARIZE_BASELINED_VERSION - In when Others exception','C');
1401: RETCODE := 'U';
1402: ERRBUF := (SQLERRM||' '||SQLCODE);
1403: /* bug 8214030: resetting the profile values back */
1404: if (l_set_profile_success1 = TRUE) then
1405: l_set_profile_success1 := fnd_profile.save('PA_SUPER_PROJECT', l_user_profile_value1, 'USER', fnd_global.user_id);
1406: end if;
1407: if (l_set_profile_success2 = TRUE) then
1408: l_set_profile_success2 := fnd_profile.save('PA_SUPER_PROJECT_VIEW', l_user_profile_value2, 'USER', fnd_global.user_id);
1409: end if;
1404: if (l_set_profile_success1 = TRUE) then
1405: l_set_profile_success1 := fnd_profile.save('PA_SUPER_PROJECT', l_user_profile_value1, 'USER', fnd_global.user_id);
1406: end if;
1407: if (l_set_profile_success2 = TRUE) then
1408: l_set_profile_success2 := fnd_profile.save('PA_SUPER_PROJECT_VIEW', l_user_profile_value2, 'USER', fnd_global.user_id);
1409: end if;
1410: END summarize_baselined_versions;
1411:
1412: END GMS_SUMMARIZE_BUDGETS;