57: else
58: raise NO_DATA_FOUND;
59: end if;
60:
61: x_return_status := FND_API.G_RET_STS_SUCCESS;
62:
63: EXCEPTION
64: WHEN NO_DATA_FOUND THEN
65: x_return_status := FND_API.G_RET_STS_ERROR;
61: x_return_status := FND_API.G_RET_STS_SUCCESS;
62:
63: EXCEPTION
64: WHEN NO_DATA_FOUND THEN
65: x_return_status := FND_API.G_RET_STS_ERROR;
66: raise;
67: WHEN TOO_MANY_ROWS THEN
68: x_return_status := FND_API.G_RET_STS_ERROR;
69: raise;
64: WHEN NO_DATA_FOUND THEN
65: x_return_status := FND_API.G_RET_STS_ERROR;
66: raise;
67: WHEN TOO_MANY_ROWS THEN
68: x_return_status := FND_API.G_RET_STS_ERROR;
69: raise;
70: WHEN OTHERS THEN
71: x_return_status := FND_API.G_RET_STS_ERROR;
72: raise;
67: WHEN TOO_MANY_ROWS THEN
68: x_return_status := FND_API.G_RET_STS_ERROR;
69: raise;
70: WHEN OTHERS THEN
71: x_return_status := FND_API.G_RET_STS_ERROR;
72: raise;
73: END check_internal_or_external;
74:
75:
149: -- because we now handle external people
150: -----------------------------------------
151: IF l_resource_type_id = 101 THEN
152:
153: IF p_resource_id IS NOT NULL AND p_resource_id<>FND_API.G_MISS_NUM THEN
154:
155: IF p_check_id_flag = 'Y' THEN
156:
157: /* Start of Changes for Bug 6056112 */
299:
300: ---------------------
301: -- For type HZ_PARTY
302: ---------------------
303: IF p_resource_id IS NOT NULL AND p_resource_id<>FND_API.G_MISS_NUM THEN
304:
305: SELECT party_id
306: INTO x_resource_id
307: FROM pa_party_resource_details_v hz
327: x_resource_type_id := 112;
328:
329: END IF; /* after checking the resource_type_id */
330:
331: x_return_status := FND_API.G_RET_STS_SUCCESS;
332:
333: EXCEPTION
334: WHEN NO_DATA_FOUND THEN
335: x_resource_id := NULL;
332:
333: EXCEPTION
334: WHEN NO_DATA_FOUND THEN
335: x_resource_id := NULL;
336: x_return_status := FND_API.G_RET_STS_ERROR;
337: x_error_message_code := 'PA_RESOURCE_INVALID_AMBIGUOUS';
338: WHEN TOO_MANY_ROWS THEN
339: x_resource_id := NULL;
340: x_return_status := FND_API.G_RET_STS_ERROR;
336: x_return_status := FND_API.G_RET_STS_ERROR;
337: x_error_message_code := 'PA_RESOURCE_INVALID_AMBIGUOUS';
338: WHEN TOO_MANY_ROWS THEN
339: x_resource_id := NULL;
340: x_return_status := FND_API.G_RET_STS_ERROR;
341: x_error_message_code := 'PA_MULTIPLE_RESOURCE';
342: WHEN OTHERS THEN
343: --PA_Error_Utils.Set_Error_Stack
344: -- (`pa_resource_utils.check_resourcename_or_id');
343: --PA_Error_Utils.Set_Error_Stack
344: -- (`pa_resource_utils.check_resourcename_or_id');
345: -- This sets the current program unit name in the
346: -- error stack. Helpful in Debugging
347: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
348: x_resource_id := NULL;
349:
350: END Check_ResourceName_Or_Id;
351:
397: x_jtf_resource_id := null ;
398:
399: END IF;
400:
401: x_return_status := FND_API.G_RET_STS_SUCCESS;
402:
403: EXCEPTION
404: WHEN NO_DATA_FOUND THEN
405: x_jtf_resource_id := null ;
402:
403: EXCEPTION
404: WHEN NO_DATA_FOUND THEN
405: x_jtf_resource_id := null ;
406: x_return_status := FND_API.G_RET_STS_SUCCESS;
407: --x_return_status := FND_API.G_RET_STS_ERROR;
408: --x_error_message_code := 'PA_CRM_RES_NULL';
409: WHEN OTHERS THEN
410: --PA_Error_Utils.Set_Error_Stack
403: EXCEPTION
404: WHEN NO_DATA_FOUND THEN
405: x_jtf_resource_id := null ;
406: x_return_status := FND_API.G_RET_STS_SUCCESS;
407: --x_return_status := FND_API.G_RET_STS_ERROR;
408: --x_error_message_code := 'PA_CRM_RES_NULL';
409: WHEN OTHERS THEN
410: --PA_Error_Utils.Set_Error_Stack
411: -- (`pa_resource_utils.check_resourcename_or_id');
412: -- This sets the current program unit name in the
413: -- error stack. Helpful in Debugging
414:
415: X_JTF_RESOURCE_ID := NULL ; -- 4537865
416: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
417:
418: END Get_CRM_Res_id;
419:
420: PROCEDURE CHECK_CC_FOR_RESOURCE(
447: -- instances.
448:
449: IF PA_UTILS.pa_morg_implemented = 'N' THEN
450: X_CC_OK := 'Y';
451: X_RETURN_STATUS := FND_API.G_RET_STS_SUCCESS;
452: ELSE
453: /* Dependency against pa_projects_expend_v v115.14 */
454:
455: open get_org_id_from_resource;
543: WHEN NULL_INVALID_PARAMS THEN
544: /*
545: * When p_resource_id passed in is invalid.
546: */
547: x_return_status := FND_API.G_RET_STS_ERROR;
548: x_error_message_code := 'PA_RS_OU_DATE_NULL';
549: WHEN OTHERS THEN
550: X_CC_OK := NULL ; -- 4537865
551: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
547: x_return_status := FND_API.G_RET_STS_ERROR;
548: x_error_message_code := 'PA_RS_OU_DATE_NULL';
549: WHEN OTHERS THEN
550: X_CC_OK := NULL ; -- 4537865
551: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
552: x_error_message_code := NULL;
553: RAISE ; -- 4537865
554: END CHECK_CC_FOR_RESOURCE;
555:
592: and TRUNC(l_date) between TRUNC(res.resource_effective_start_date) and TRUNC(res.resource_effective_end_date));
593:
594: BEGIN
595:
596: x_return_status := FND_API.G_RET_STS_SUCCESS;
597:
598: l_future_resource := is_future_resource( p_resource_id);
599:
600: --bug 8988264 : skkoppul
621: x_valid := 'Y';
622: else
623: x_valid := 'N';
624: end if;
625: x_return_status := FND_API.G_RET_STS_SUCCESS;
626:
627: EXCEPTION
628: WHEN NO_DATA_FOUND THEN
629: x_return_status := FND_API.G_RET_STS_ERROR;
625: x_return_status := FND_API.G_RET_STS_SUCCESS;
626:
627: EXCEPTION
628: WHEN NO_DATA_FOUND THEN
629: x_return_status := FND_API.G_RET_STS_ERROR;
630: x_error_message_code := 'PA_RES_NOT_EXPORG';
631: WHEN OTHERS THEN
632: --PA_Error_Utils.Set_Error_Stack
633: -- (`pa_job_utils.check_resource_belongs_exporg');
634: -- This sets the current program unit name in the
635: -- error stack. Helpful in Debugging
636:
637: x_valid := NULL ; -- 4537865
638: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
639: x_error_message_code := NULL;
640:
641: END CHECK_RES_BELONGS_EXPORG;
642:
679: -- modified this cursor for bug#9233998
680:
681: BEGIN
682:
683: x_return_status := FND_API.G_RET_STS_SUCCESS;
684:
685: open cur_exist(p_resource_id, p_start_date_active, p_end_date_active);
686: fetch cur_exist into l_exist;
687: close cur_exist;
690: x_valid := 'Y';
691: else
692: x_valid := 'N';
693: end if;
694: x_return_status := FND_API.G_RET_STS_SUCCESS;
695:
696: EXCEPTION
697: WHEN NO_DATA_FOUND THEN
698: x_return_status := FND_API.G_RET_STS_ERROR;
694: x_return_status := FND_API.G_RET_STS_SUCCESS;
695:
696: EXCEPTION
697: WHEN NO_DATA_FOUND THEN
698: x_return_status := FND_API.G_RET_STS_ERROR;
699: x_error_message_code := 'PA_RES_NOT_EXPORG';
700: WHEN OTHERS THEN
701: x_valid := NULL ;
702: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
698: x_return_status := FND_API.G_RET_STS_ERROR;
699: x_error_message_code := 'PA_RES_NOT_EXPORG';
700: WHEN OTHERS THEN
701: x_valid := NULL ;
702: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
703: x_error_message_code := NULL;
704:
705: END CHECK_RES_BELONGS_EXPORG;
706: --
984: ,x_msg_count => l_msg_count
985: ,x_msg_data => l_msg_data
986: );
987:
988: IF l_return_status <> fnd_api.g_ret_sts_success
989: THEN
990: x_return_status := l_return_status;
991: return;
992: END IF;
1020: COMMIT;
1021: --4537865
1022: EXCEPTION
1023: WHEN OTHERS THEN
1024: x_return_status := Fnd_Api.G_RET_STS_UNEXP_ERROR;
1025: Fnd_Msg_Pub.add_exc_msg
1026: ( p_pkg_name => 'pa_resource_utils'
1027: , p_procedure_name => 'insert_grant'
1028: , p_error_text => SUBSTRB(SQLERRM,1,100));
1071: --Call API to delete INSTANCE record.
1072:
1073: pa_security_pvt.revoke_role
1074: (
1075: p_commit => FND_API.G_TRUE
1076: ,p_debug_mode => NULL
1077: ,p_project_role_id => NULL
1078: ,p_menu_name => p_role_name
1079: ,p_object_name => 'ORGANIZATION'
1109:
1110: -- Delete the INSTANCE_SET record.
1111: l_set_id := pa_security_pvt.get_instance_set_id(l_set_name);
1112: pa_security_pvt.revoke_role(
1113: p_commit => FND_API.G_TRUE
1114: ,p_debug_mode => NULL
1115: ,p_project_role_id => NULL
1116: ,p_menu_name => p_role_name
1117: ,p_object_name => l_object_name
1133: COMMIT;
1134: --4537865
1135: EXCEPTION
1136: WHEN OTHERS THEN
1137: x_return_status := Fnd_Api.G_RET_STS_UNEXP_ERROR;
1138: Fnd_Msg_Pub.add_exc_msg
1139: ( p_pkg_name => 'pa_resource_utils'
1140: , p_procedure_name => 'delete_grant'
1141: , p_error_text => SUBSTRB(SQLERRM,1,100));
1366: AND trunc(NVL(fg.end_date, SYSDATE+1));
1367:
1368: BEGIN
1369:
1370: x_return_status := FND_API.G_RET_STS_SUCCESS;
1371:
1372: -- Validate the PersonId
1373:
1374: BEGIN
1445: --dbms_output.put_line(P_primarycontactid||P_primarycontactName);
1446:
1447: EXCEPTION
1448: WHEN NO_DATA_FOUND THEN
1449: -- x_return_status := FND_API.G_RET_STS_ERROR;
1450: -- x_error_message_code := 'PA_RESOURCE_NO_PRIMARY_CONTACT';
1451: -- NULL; Commented NULL for 4537865
1452:
1453: P_PrimaryContactId := NULL ; -- 4537865
1477: -- Bug 4684198 - remove nvl on effective_end_date - col is not null
1478:
1479: EXCEPTION
1480: WHEN NO_DATA_FOUND THEN
1481: -- x_return_status := FND_API.G_RET_STS_ERROR;
1482: -- x_error_message_code := 'PA_RESOURCE_NO_ANALYST';
1483: NULL;
1484: WHEN OTHERS THEN
1485: NULL;
1492: -- if no rows found for the roleid,orgid,objid for a
1493: -- person then raie exception to avoid no data found in
1494: -- out paraemter plsql tables - P_ResourceIdTab.
1495: IF P_ResourceIdTab(1) IS NULL and P_PrimaryContactId is NULL then
1496: x_return_status := FND_API.G_RET_STS_ERROR;
1497: x_error_message_code := 'PA_RESOURCE_NO_APPROVAL';
1498: END IF;
1499: EXCEPTION
1500:
1501:
1502: WHEN PersonException then
1503: P_PrimaryContactId := NULL ; --4537865
1504: P_PrimaryContactName := NULL ; --4537865
1505: x_return_status := FND_API.G_RET_STS_ERROR;
1506: x_error_message_code := 'PA_RESOURCE_INVALID_PERSON';
1507:
1508: WHEN NO_DATA_FOUND THEN
1509:
1509:
1510: P_PrimaryContactId := NULL ; --4537865
1511: P_PrimaryContactName := NULL ; --4537865
1512:
1513: x_return_status := FND_API.G_RET_STS_ERROR;
1514: x_error_message_code := 'PA_RESOURCE_INVALID_PERSON';
1515:
1516:
1517: WHEN OTHERS THEN -- will also handle missing role
1516:
1517: WHEN OTHERS THEN -- will also handle missing role
1518: P_PrimaryContactId := NULL ; --4537865
1519: P_PrimaryContactName := NULL ; --4537865
1520: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
1521: --dbms_output.put_line('missing role exception');
1522: raise;
1523:
1524: end get_resource_analyst ;
1548:
1549: -- initialize the error stack
1550: PA_DEBUG.init_err_stack('PA_RESOURCE_UTILS.get_prim_contact_id_name');
1551: -- initialize the return status to success
1552: x_return_status := FND_API.G_RET_STS_SUCCESS;
1553:
1554:
1555: SELECT distinct pep.person_id -- changes for 11.5.10 security
1556: -- to_number(substr(fg.grantee_key,instr(fg.grantee_key,':')+1))
1581: EXCEPTION
1582: WHEN NO_DATA_FOUND THEN
1583: -- as discussed with Mr.Ramesh,this is not a business rule violation
1584: -- so commented
1585: -- x_return_status := FND_API.G_RET_STS_ERROR;
1586: -- x_error_message_code := 'PA_RESOURCE_NO_ANALYST';
1587:
1588: x_PrimaryContactId := NULL; -- 4537865
1589: x_PrimaryContactName := NULL ; -- 4537865
1614: BEGIN
1615: -- initialize the error stack
1616: PA_DEBUG.init_err_stack('PA_RESOURCE_UTILS.get_manager_id_name');
1617: -- initialize the return status to success
1618: x_return_status := FND_API.G_RET_STS_SUCCESS;
1619:
1620: --Modified code for future dated person
1621: --Manager check is still as of sysdate
1622: SELECT assn.supervisor_id,pep.full_name
1637: EXCEPTION
1638: WHEN NO_DATA_FOUND THEN
1639: -- as discussed with Mr.Ramesh,this is not a business rule violation
1640: -- so commented
1641: -- x_return_status := FND_API.G_RET_STS_ERROR;
1642: -- x_error_message_code := 'PA_RESOURCE_NO_MANAGER';
1643:
1644: x_ManagerId := NULL ; -- 4537865
1645: x_ManagerName := NULL ; -- 4537865
1723:
1724: -- initialize the error stack
1725: PA_DEBUG.init_err_stack('PA_RESOURCE_UTILS.get_org_id');
1726: -- initialize the return status to success
1727: x_return_status := FND_API.G_RET_STS_SUCCESS;
1728:
1729: -- pick the Organization id for the Current Assignment
1730: -- where assignment type is primary type.
1731: -- may raise exception if the person is not on current assnment
1745: WHEN OTHERS THEN
1746: -- set the exception message and stack
1747: -- FND_MSG_PUB.add_exc_msg('PA_RESOURCE_UTILS.get_org_id'
1748: -- ,PA_DEBUG.g_err_stack);
1749: -- x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1750: -- raise;
1751: -- null; 4537865
1752: x_orgid := NULL ;
1753:
1772:
1773: -- initialize the error stack
1774: PA_DEBUG.init_err_stack('PA_RESOURCE_UTILS.get_person_id');
1775: -- initialize the return status to success
1776: x_return_status := FND_API.G_RET_STS_SUCCESS;
1777:
1778: IF P_resourceid is NOT NULL then
1779: -- may raise too many rows exception
1780: SELECT Person_id
1822: EXCEPTION
1823: WHEN NO_DATA_FOUND THEN
1824: x_PersonId := NULL ; --4537865
1825: x_error_message_code := 'PA_RESOURCE_INVALID_RESOURCE';
1826: x_return_status := FND_API.G_RET_STS_ERROR;
1827:
1828: WHEN PersonException then
1829: x_PersonId := NULL ; -- 4537865
1830: x_error_message_code := 'PA_RESOURCE_INVALID_PERSON';
1827:
1828: WHEN PersonException then
1829: x_PersonId := NULL ; -- 4537865
1830: x_error_message_code := 'PA_RESOURCE_INVALID_PERSON';
1831: x_return_status := FND_API.G_RET_STS_ERROR;
1832:
1833:
1834: WHEN OTHERS THEN
1835: -- set the exception message and stack
1835: -- set the exception message and stack
1836: x_PersonId := NULL ; -- 4537865
1837: FND_MSG_PUB.add_exc_msg('PA_RESOURCE_UTILS.get_org_id'
1838: ,PA_DEBUG.g_err_stack);
1839: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
1840: raise;
1841:
1842: END get_person_id;
1843:
1851:
1852: -- initialize the error stack
1853: PA_DEBUG.init_err_stack('PA_RESOURCE_UTILS.get_object_id');
1854: -- initialize the return status to success
1855: x_return_status := FND_API.G_RET_STS_SUCCESS;
1856:
1857:
1858: -- pick the Object id for the organization (seeded data)
1859: SELECT distinct object_id
1916: -- initialize the error stack
1917: PA_DEBUG.init_err_stack('PA_RESOURCE_UTILS.get_org_primary_contact');
1918:
1919: -- initialize the return status to success
1920: x_return_status := FND_API.G_RET_STS_SUCCESS;
1921:
1922: IF p_assignment_id IS NULL THEN
1923: l_start_date := sysdate;
1924: ELSE
1945: ,v_personid
1946: ,v_error_message_code
1947: ,v_return_status);
1948: --check for return status if error found then add it to stack
1949: IF v_return_status = FND_API.G_RET_STS_ERROR THEN
1950: PA_UTILS.add_message(p_app_short_name => 'PA',
1951: p_msg_name => v_error_message_code);
1952: END IF;
1953:
1956: ,l_start_date
1957: ,v_orgid
1958: ,v_error_message_code
1959: ,v_return_status);
1960: IF v_return_status = FND_API.G_RET_STS_ERROR THEN
1961: PA_UTILS.add_message(p_app_short_name => 'PA',
1962: p_msg_name => v_error_message_code);
1963: END IF;
1964:
1969: ,v_error_message_code
1970: ,v_return_status);
1971:
1972:
1973: IF v_return_status = FND_API.G_RET_STS_ERROR THEN
1974: PA_UTILS.add_message(p_app_short_name => 'PA',
1975: p_msg_name => v_error_message_code);
1976: END IF;
1977:
1987: ,x_PrimaryContactName
1988: ,v_return_status
1989: ,v_error_message_code );
1990:
1991: IF v_return_status = FND_API.G_RET_STS_ERROR THEN
1992: PA_UTILS.add_message(p_app_short_name => 'PA',
1993: p_msg_name => v_error_message_code);
1994: END IF;
1995:
2000: ,x_ManagerId
2001: ,x_ManagerName
2002: ,v_error_message_code
2003: ,v_return_status);
2004: IF v_return_status = FND_API.G_RET_STS_ERROR THEN
2005: PA_UTILS.add_message(p_app_short_name => 'PA',
2006: p_msg_name => v_error_message_code);
2007: END IF;
2008:
2010: -- then pass the error messages.
2011: IF (x_ManagerId is NULL and x_primarycontactid is NULL) then
2012: PA_UTILS.add_message(p_app_short_name => 'PA',
2013: p_msg_name => 'PA_RESOURCE_NO_APPROVAL');
2014: x_return_status := FND_API.G_RET_STS_ERROR;
2015:
2016: END IF;
2017:
2018: v_msg_count := FND_MSG_PUB.count_msg;
2019:
2020: -- if num of message is one then pass it to out parameter x_msg_data
2021: IF v_msg_count = 1 and (x_ManagerId is NULL and x_primarycontactid is NULL) then
2022: PA_INTERFACE_UTILS_PUB.get_messages(
2023: p_encoded => FND_API.G_TRUE
2024: ,p_msg_index => 1
2025: ,p_msg_count => v_msg_count
2026: ,p_data => v_msg_data
2027: ,p_msg_index_out => v_msg_index_out);
2048:
2049: -- set the exception message and stack
2050: FND_MSG_PUB.add_exc_msg('PA_RESOURCE_UTILS.get_org_primary_contact'
2051: ,PA_DEBUG.g_err_stack);
2052: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2053: -- dbms_output.put_line('missing');
2054: raise;
2055:
2056:
2563:
2564: -- initialize the error stack
2565: PA_DEBUG.init_err_stack('PA_RESOURCE_UTILS.get_person_name');
2566: -- initialize the return status to success
2567: x_return_status := FND_API.G_RET_STS_SUCCESS;
2568:
2569: IF p_person_id IS NOT NULL then
2570:
2571: /* changed the select statement to be based on per_all_people_f and added
2590:
2591: EXCEPTION
2592: WHEN NO_DATA_FOUND THEN
2593: x_person_name := null;
2594: x_return_status := FND_API.G_RET_STS_ERROR;
2595:
2596: WHEN OTHERS THEN
2597:
2598: -- RESET OUT PARAM 4537865
2600:
2601: -- set the exception message and stack
2602: FND_MSG_PUB.add_exc_msg('PA_RESOURCE_UTILS.get_person_name'
2603: ,PA_DEBUG.g_err_stack);
2604: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2605: raise;
2606:
2607: END get_person_name;
2608:
2628:
2629: -- initialize the error stack
2630: PA_DEBUG.init_err_stack('PA_RESOURCE_UTILS.get_location_details');
2631: -- initialize the return status to success
2632: x_return_status := FND_API.G_RET_STS_SUCCESS;
2633:
2634: IF p_location_id IS NOT NULL then
2635:
2636: SELECT address_line_1,
2667: x_address_line_3 := null;
2668: x_town_or_city := null;
2669: x_postal_code := null;
2670: x_country := null;
2671: x_return_status := FND_API.G_RET_STS_ERROR;
2672:
2673: WHEN OTHERS THEN
2674: -- RESET OUT PARAMS 4537865
2675: x_address_line_1 := null;
2681:
2682: -- set the exception message and stack
2683: FND_MSG_PUB.add_exc_msg('PA_RESOURCE_UTILS.get_location_details'
2684: ,PA_DEBUG.g_err_stack);
2685: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2686: raise;
2687:
2688: END get_location_details;
2689:
2705:
2706: -- initialize the error stack
2707: PA_DEBUG.init_err_stack('PA_RESOURCE_UTILS.get_org_defaults');
2708: -- initialize the return status to success
2709: x_return_status := FND_API.G_RET_STS_SUCCESS;
2710:
2711: IF p_organization_id IS NOT NULL then
2712: -- split into two separate selects - one for OU and one
2713: -- for Calendar
2756:
2757: -- set the exception message and stack
2758: FND_MSG_PUB.add_exc_msg('PA_RESOURCE_UTILS.get_org_defaults'
2759: ,PA_DEBUG.g_err_stack);
2760: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2761: raise;
2762:
2763: END get_org_defaults;
2764:
2784:
2785: -- initialize the error stack
2786: PA_DEBUG.init_err_stack('PA_RESOURCE_UTILS.check_exp_org');
2787: -- initialize the return status to success
2788: x_return_status := FND_API.G_RET_STS_SUCCESS;
2789:
2790: x_valid := 'N';
2791: IF p_organization_id IS NOT NULL then
2792:
2818:
2819: EXCEPTION
2820: WHEN NO_DATA_FOUND THEN
2821: x_valid := 'N';
2822: x_return_status := FND_API.G_RET_STS_ERROR;
2823:
2824: WHEN OTHERS THEN
2825:
2826: -- RESET OUT PARAMS : 4537865
2829:
2830: -- set the exception message and stack
2831: FND_MSG_PUB.add_exc_msg('PA_RESOURCE_UTILS.check_exp_org'
2832: ,PA_DEBUG.g_err_stack);
2833: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2834: raise;
2835:
2836: END check_exp_org;
2837:
2856:
2857: -- initialize the error stack
2858: PA_DEBUG.init_err_stack('PA_RESOURCE_UTILS.check_res_exists');
2859: -- initialize the return status to success
2860: x_return_status := FND_API.G_RET_STS_SUCCESS;
2861:
2862: x_valid := 'N';
2863: IF p_person_id IS NOT NULL then
2864:
2883:
2884: EXCEPTION
2885: WHEN NO_DATA_FOUND THEN
2886: x_valid := 'N';
2887: x_return_status := FND_API.G_RET_STS_ERROR;
2888:
2889: WHEN OTHERS THEN
2890: --4537865 RESET OUT PARAMS
2891: x_valid := 'N';
2892:
2893: -- set the exception message and stack
2894: FND_MSG_PUB.add_exc_msg('PA_RESOURCE_UTILS.check_res_exists'
2895: ,PA_DEBUG.g_err_stack);
2896: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR;
2897: raise;
2898:
2899: END check_res_exists;
2900:
4003: WHEN OTHERS THEN
4004: -- Set the exception Message and the stack
4005: FND_MSG_PUB.add_exc_msg(p_pkg_name => 'PA_RESOURCE_UTILS.Validate_person'
4006: ,p_procedure_name => PA_DEBUG.G_Err_Stack );
4007: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
4008: RAISE;
4009:
4010: END validate_person;
4011:
4534: --dbms_output.put_line('mgr id M - id not null ' || x_manager_id);
4535: END IF;
4536: END IF;
4537:
4538: x_return_status := FND_API.G_RET_STS_SUCCESS;
4539: x_msg_count := FND_MSG_PUB.Count_Msg;
4540:
4541: EXCEPTION
4542: WHEN NO_DATA_FOUND THEN
4540:
4541: EXCEPTION
4542: WHEN NO_DATA_FOUND THEN
4543: x_manager_id := NULL;
4544: x_return_status := FND_API.G_RET_STS_ERROR;
4545: x_error_message_code := 'PA_RES_INVALID_MGR_HIER';
4546: x_msg_count := FND_MSG_PUB.Count_Msg;
4547:
4548: WHEN TOO_MANY_ROWS THEN
4546: x_msg_count := FND_MSG_PUB.Count_Msg;
4547:
4548: WHEN TOO_MANY_ROWS THEN
4549: x_manager_id := NULL;
4550: x_return_status := FND_API.G_RET_STS_ERROR;
4551: x_error_message_code := 'PA_MULTIPLE_RESOURCE';
4552: x_msg_count := FND_MSG_PUB.Count_Msg;
4553:
4554: WHEN OTHERS THEN
4551: x_error_message_code := 'PA_MULTIPLE_RESOURCE';
4552: x_msg_count := FND_MSG_PUB.Count_Msg;
4553:
4554: WHEN OTHERS THEN
4555: x_return_status := FND_API.G_RET_STS_UNEXP_ERROR ;
4556: x_manager_id := NULL;
4557: x_msg_count := FND_MSG_PUB.Count_Msg;
4558:
4559: END Check_ManagerName_Or_Id;
4652:
4653: BEGIN
4654:
4655: -- initialize the return status to success
4656: v_return_status := FND_API.G_RET_STS_SUCCESS;
4657:
4658: --Bug 4473484
4659: IF p_start_date IS NULL THEN
4660: l_start_date := sysdate;
4681: ,v_personid
4682: ,v_error_message_code
4683: ,v_return_status);
4684: --check for return status if error found then add it to stack
4685: IF v_return_status = FND_API.G_RET_STS_ERROR THEN
4686: PA_UTILS.add_message(p_app_short_name => 'PA',
4687: p_msg_name => v_error_message_code);
4688: END IF;
4689:
4700: ,x_ManagerId
4701: ,x_ManagerName
4702: ,v_error_message_code
4703: ,v_return_status);
4704: IF v_return_status = FND_API.G_RET_STS_ERROR THEN
4705: PA_UTILS.add_message(p_app_short_name => 'PA',
4706: p_msg_name => v_error_message_code);
4707: END IF;
4708: IF x_ManagerId IS NULL THEN
4941:
4942: -- initialize the error stack
4943: PA_DEBUG.init_err_stack('PA_RESOURCE_UTILS.Init_FTE_Sync_WF');
4944: -- initialize the return status to success
4945: x_return_status := FND_API.G_RET_STS_SUCCESS;
4946:
4947: l_term_type := pa_resource_utils.get_term_type(p_person_id) ;
4948:
4949: IF (l_term_type = 'I') THEN
5045:
5046:
5047: EXCEPTION
5048: WHEN OTHERS THEN
5049: x_return_status := FND_API.G_RET_STS_ERROR;
5050: x_msg_count := 1;
5051: x_msg_data := substr(SQLERRM,1,240);
5052: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'PA_RESOURCE_UTILS',
5053: p_procedure_name => 'Init_FTE_sync_wf');
5052: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'PA_RESOURCE_UTILS',
5053: p_procedure_name => 'Init_FTE_sync_wf');
5054: If x_msg_count = 1 THEN
5055: pa_interface_utils_pub.get_messages
5056: (p_encoded => FND_API.G_TRUE,
5057: p_msg_index => 1,
5058: p_msg_count => x_msg_count,
5059: p_msg_data => x_msg_data,
5060: p_data => x_msg_data,
5086: BEGIN
5087: -- initialize the error stack
5088: PA_DEBUG.init_err_stack('PA_RESOURCE_UTILS.set_fte_flag');
5089: -- initialize the return status to success
5090: x_return_status := FND_API.G_RET_STS_SUCCESS;
5091:
5092: l_resource_id := pa_resource_utils.get_resource_id(p_person_id);
5093:
5094: IF NVL(l_resource_id,-999) <> -999 THEN
5101: WHERE
5102: resource_id = l_resource_id;
5103:
5104: ELSIF NVL(l_resource_id,-999) = -999 THEN
5105: x_return_status := FND_API.G_RET_STS_ERROR;
5106:
5107: END IF ; --IF l_resource_id <> -999
5108:
5109: -- reset the error stack
5110: PA_DEBUG.reset_err_stack;
5111:
5112: EXCEPTION
5113: WHEN OTHERS THEN
5114: x_return_status := FND_API.G_RET_STS_ERROR;
5115: x_msg_count := 1;
5116: x_msg_data := substr(SQLERRM,1,240);
5117: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'PA_RESOURCE_UTILS',
5118: p_procedure_name => 'set_fte_flag');
5117: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'PA_RESOURCE_UTILS',
5118: p_procedure_name => 'set_fte_flag');
5119: If x_msg_count = 1 THEN
5120: pa_interface_utils_pub.get_messages
5121: (p_encoded => FND_API.G_TRUE,
5122: p_msg_index => 1,
5123: p_msg_count => x_msg_count,
5124: p_msg_data => x_msg_data,
5125: p_data => x_msg_data,
5152: BEGIN
5153: -- initialize the error stack
5154: PA_DEBUG.init_err_stack('PA_RESOURCE_UTILS.get_fte_flag');
5155: -- initialize the return status to success
5156: x_return_status := FND_API.G_RET_STS_SUCCESS;
5157:
5158: l_resource_id := pa_resource_utils.get_resource_id(p_person_id);
5159:
5160: IF NVL(l_resource_id,-999) <> -999 THEN
5165: WHERE resource_id = l_resource_id;
5166:
5167: ELSIF NVL(l_resource_id,-999) = -999 THEN
5168:
5169: x_return_status := FND_API.G_RET_STS_ERROR;
5170: l_future_term_wf_flag := NULL ;
5171:
5172: END IF ;
5173:
5178:
5179: EXCEPTION
5180: WHEN OTHERS THEN
5181: x_future_term_wf_flag := NULL;
5182: x_return_status := FND_API.G_RET_STS_ERROR;
5183: x_msg_count := 1;
5184: x_msg_data := substr(SQLERRM,1,240);
5185: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'PA_RESOURCE_UTILS',
5186: p_procedure_name => 'get_fte_flag');
5185: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'PA_RESOURCE_UTILS',
5186: p_procedure_name => 'get_fte_flag');
5187: If x_msg_count = 1 THEN
5188: pa_interface_utils_pub.get_messages
5189: (p_encoded => FND_API.G_TRUE,
5190: p_msg_index => 1,
5191: p_msg_count => x_msg_count,
5192: p_msg_data => x_msg_data,
5193: p_data => x_msg_data,
5224: BEGIN
5225: -- initialize the error stack
5226: PA_DEBUG.init_err_stack('PA_RESOURCE_UTILS.is_fte');
5227: -- initialize the return status to success
5228: x_return_status := FND_API.G_RET_STS_SUCCESS;
5229:
5230: SELECT distinct(resource_person_type)
5231: INTO l_resource_person_type
5232: FROM pa_resources_denorm
5276: PA_DEBUG.reset_err_stack;
5277:
5278: EXCEPTION
5279: WHEN OTHERS THEN
5280: x_return_status := FND_API.G_RET_STS_ERROR;
5281: x_msg_count := 1;
5282: x_msg_data := substr(SQLERRM,1,240);
5283: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'PA_RESOURCE_UTILS',
5284: p_procedure_name => 'is_fte');
5283: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'PA_RESOURCE_UTILS',
5284: p_procedure_name => 'is_fte');
5285: If x_msg_count = 1 THEN
5286: pa_interface_utils_pub.get_messages
5287: (p_encoded => FND_API.G_TRUE,
5288: p_msg_index => 1,
5289: p_msg_count => x_msg_count,
5290: p_msg_data => x_msg_data,
5291: p_data => x_msg_data,
5318: BEGIN
5319: -- initialize the error stack
5320: PA_DEBUG.init_err_stack('PA_RESOURCE_UTILS.get_valid_enddate');
5321: -- initialize the return status to success
5322: x_return_status := FND_API.G_RET_STS_SUCCESS;
5323:
5324:
5325: SELECT TRUNC (MAX (resource_effective_end_date))
5326: INTO l_max_res_denorm_end_date
5344: PA_DEBUG.reset_err_stack;
5345:
5346: EXCEPTION
5347: WHEN OTHERS THEN
5348: x_return_status := FND_API.G_RET_STS_ERROR;
5349: x_msg_count := 1;
5350: x_msg_data := substr(SQLERRM,1,240);
5351: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'PA_RESOURCE_UTILS',
5352: p_procedure_name => 'get_valid_enddate');
5351: FND_MSG_PUB.add_exc_msg( p_pkg_name => 'PA_RESOURCE_UTILS',
5352: p_procedure_name => 'get_valid_enddate');
5353: If x_msg_count = 1 THEN
5354: pa_interface_utils_pub.get_messages
5355: (p_encoded => FND_API.G_TRUE,
5356: p_msg_index => 1,
5357: p_msg_count => x_msg_count,
5358: p_msg_data => x_msg_data,
5359: p_data => x_msg_data,