45: raise l_error;
46: end if;
47: hr_utility.set_location(l_proc, 7);
48:
49: if per_cpn_shd.g_old_rec.competence_cluster = 'UNIT_STANDARD'
50: and (p_rec.competence_cluster is NULL
51: or p_rec.competence_cluster <> 'UNIT_STANDARD') then
52: --
53: fnd_message.set_name('PER','HR_449146_QUA_FWK_CHG_CLUSTER');
47: hr_utility.set_location(l_proc, 7);
48:
49: if per_cpn_shd.g_old_rec.competence_cluster = 'UNIT_STANDARD'
50: and (p_rec.competence_cluster is NULL
51: or p_rec.competence_cluster <> 'UNIT_STANDARD') then
52: --
53: fnd_message.set_name('PER','HR_449146_QUA_FWK_CHG_CLUSTER');
54: fnd_message.raise_error;
55: end if;
269: end if;
270: --
271: -- only continue if called from UPDATE check
272: --
273: -- Apart from having the standard date validation check ie.date from <= date_to
274: -- and date_to >= date_from, need to make sure that the user cannot change a date
275: -- so as to invalidate the dates on the competence element.
276: -- Check dates againts competence elements (only in Update mode)
277: --
1305: --
1306: end chk_competence_cluster;
1307: --
1308: -------------------------------------------------------------------------------
1309: --------------------------
1311: --
1312: -- Description:
1313: -- This procedure checks that a unit_standard_id is unique
1309: --------------------------
1310: -------------------------------------------------------------------------------
1311: --
1312: -- Description:
1313: -- This procedure checks that a unit_standard_id is unique
1314: --
1315: -- Pre_conditions:
1316: -- None.
1317: --
1316: -- None.
1317: --
1318: -- In Arguments:
1319: -- p_competence_id
1320: -- p_unit_standard_id
1321: -- p_business_group_id
1322: -- p_object_version_number
1323: -- p_effective_date
1324: --
1332: -- Access Status
1333: -- Internal Table Handler Use Only.
1334: --
1335: --
1336: procedure chk_unit_standard_id
1337: (p_competence_id in per_competences.competence_id%TYPE
1338: ,p_unit_standard_id in per_competences.unit_standard_id%TYPE
1339: ,p_business_group_id in per_competences.business_group_id%TYPE
1340: ,p_object_version_number in per_competences.object_version_number%TYPE
1334: --
1335: --
1336: procedure chk_unit_standard_id
1337: (p_competence_id in per_competences.competence_id%TYPE
1338: ,p_unit_standard_id in per_competences.unit_standard_id%TYPE
1339: ,p_business_group_id in per_competences.business_group_id%TYPE
1340: ,p_object_version_number in per_competences.object_version_number%TYPE
1341: ,p_effective_date in date
1342: )
1344: --
1345: --
1346: -- declare cursor
1347: --
1348: cursor csr_local_unit_standard_id is
1349: select 1 from per_competences
1350: where unit_standard_id = p_unit_standard_id
1351: and business_group_id = p_business_group_id
1352: and p_effective_date between date_from and NVL(date_to, hr_api.g_eot);
1346: -- declare cursor
1347: --
1348: cursor csr_local_unit_standard_id is
1349: select 1 from per_competences
1350: where unit_standard_id = p_unit_standard_id
1351: and business_group_id = p_business_group_id
1352: and p_effective_date between date_from and NVL(date_to, hr_api.g_eot);
1353: --
1354: cursor csr_global_unit_standard_id is
1350: where unit_standard_id = p_unit_standard_id
1351: and business_group_id = p_business_group_id
1352: and p_effective_date between date_from and NVL(date_to, hr_api.g_eot);
1353: --
1354: cursor csr_global_unit_standard_id is
1355: select 1 from per_competences
1356: where unit_standard_id = p_unit_standard_id
1357: and p_effective_date between date_from and NVL(date_to, hr_api.g_eot);
1358:
1352: and p_effective_date between date_from and NVL(date_to, hr_api.g_eot);
1353: --
1354: cursor csr_global_unit_standard_id is
1355: select 1 from per_competences
1356: where unit_standard_id = p_unit_standard_id
1357: and p_effective_date between date_from and NVL(date_to, hr_api.g_eot);
1358:
1359: l_proc varchar2(72) := g_package||'chk_unit_standard_id';
1360: l_api_updating boolean;
1355: select 1 from per_competences
1356: where unit_standard_id = p_unit_standard_id
1357: and p_effective_date between date_from and NVL(date_to, hr_api.g_eot);
1358:
1359: l_proc varchar2(72) := g_package||'chk_unit_standard_id';
1360: l_api_updating boolean;
1361: l_exists varchar2(1);
1362: --
1363: begin
1364: hr_utility.set_location('Entering:'|| l_proc, 10);
1365: --
1366: -- Only proceed with validation if :
1367: -- a) The current g_old_rec is current and
1368: -- b) The value for unit_standard_id has changed
1369: --
1370: l_api_updating := per_cpn_shd.api_updating
1371: (p_competence_id => p_competence_id
1372: ,p_object_version_number => p_object_version_number);
1370: l_api_updating := per_cpn_shd.api_updating
1371: (p_competence_id => p_competence_id
1372: ,p_object_version_number => p_object_version_number);
1373: --
1374: if (p_unit_standard_id is not NULL) then
1375: if ( (l_api_updating and nvl(per_cpn_shd.g_old_rec.unit_standard_id,
1376: hr_api.g_varchar2)
1377: <> nvl(p_unit_standard_id,hr_api.g_varchar2)
1378: ) or
1371: (p_competence_id => p_competence_id
1372: ,p_object_version_number => p_object_version_number);
1373: --
1374: if (p_unit_standard_id is not NULL) then
1375: if ( (l_api_updating and nvl(per_cpn_shd.g_old_rec.unit_standard_id,
1376: hr_api.g_varchar2)
1377: <> nvl(p_unit_standard_id,hr_api.g_varchar2)
1378: ) or
1379: (NOT l_api_updating)
1373: --
1374: if (p_unit_standard_id is not NULL) then
1375: if ( (l_api_updating and nvl(per_cpn_shd.g_old_rec.unit_standard_id,
1376: hr_api.g_varchar2)
1377: <> nvl(p_unit_standard_id,hr_api.g_varchar2)
1378: ) or
1379: (NOT l_api_updating)
1380: ) then
1381: --
1383: hr_utility.set_location(l_proc, 20);
1384: --
1385: -- Local competence
1386: --
1387: open csr_local_unit_standard_id;
1388: fetch csr_local_unit_standard_id into l_exists;
1389: if csr_local_unit_standard_id%FOUND then
1390: close csr_local_unit_standard_id;
1391: --
1384: --
1385: -- Local competence
1386: --
1387: open csr_local_unit_standard_id;
1388: fetch csr_local_unit_standard_id into l_exists;
1389: if csr_local_unit_standard_id%FOUND then
1390: close csr_local_unit_standard_id;
1391: --
1392: hr_utility.set_location(l_proc, 30);
1385: -- Local competence
1386: --
1387: open csr_local_unit_standard_id;
1388: fetch csr_local_unit_standard_id into l_exists;
1389: if csr_local_unit_standard_id%FOUND then
1390: close csr_local_unit_standard_id;
1391: --
1392: hr_utility.set_location(l_proc, 30);
1393: --
1386: --
1387: open csr_local_unit_standard_id;
1388: fetch csr_local_unit_standard_id into l_exists;
1389: if csr_local_unit_standard_id%FOUND then
1390: close csr_local_unit_standard_id;
1391: --
1392: hr_utility.set_location(l_proc, 30);
1393: --
1394: hr_utility.set_message(800, 'HR_449089_UNIT_STD_ID_EXISTS');
1394: hr_utility.set_message(800, 'HR_449089_UNIT_STD_ID_EXISTS');
1395: hr_utility.raise_error;
1396: --
1397: END IF;
1398: close csr_local_unit_standard_id;
1399: else
1400: hr_utility.set_location(l_proc, 40);
1401: --
1402: -- Global competence
1400: hr_utility.set_location(l_proc, 40);
1401: --
1402: -- Global competence
1403: --
1404: open csr_global_unit_standard_id;
1405: fetch csr_global_unit_standard_id into l_exists;
1406: if csr_global_unit_standard_id%FOUND then
1407: close csr_global_unit_standard_id;
1408: --
1401: --
1402: -- Global competence
1403: --
1404: open csr_global_unit_standard_id;
1405: fetch csr_global_unit_standard_id into l_exists;
1406: if csr_global_unit_standard_id%FOUND then
1407: close csr_global_unit_standard_id;
1408: --
1409: hr_utility.set_location(l_proc, 50);
1402: -- Global competence
1403: --
1404: open csr_global_unit_standard_id;
1405: fetch csr_global_unit_standard_id into l_exists;
1406: if csr_global_unit_standard_id%FOUND then
1407: close csr_global_unit_standard_id;
1408: --
1409: hr_utility.set_location(l_proc, 50);
1410: --
1403: --
1404: open csr_global_unit_standard_id;
1405: fetch csr_global_unit_standard_id into l_exists;
1406: if csr_global_unit_standard_id%FOUND then
1407: close csr_global_unit_standard_id;
1408: --
1409: hr_utility.set_location(l_proc, 50);
1410: --
1411: hr_utility.set_message(800, 'HR_449089_UNIT_STD_ID_EXISTS');
1411: hr_utility.set_message(800, 'HR_449089_UNIT_STD_ID_EXISTS');
1412: hr_utility.raise_error;
1413: --
1414: END IF;
1415: close csr_global_unit_standard_id;
1416: end if;
1417: end if;
1418: end if;
1419: --
1418: end if;
1419: --
1420: hr_utility.set_location('Leaving: '|| l_proc, 60);
1421: --
1422: end chk_unit_standard_id;
1423: --
1424: -------------------------------------------------------------------------------
1425: ----------------------------< chk_credit_type >--------------------------------
1426: -------------------------------------------------------------------------------
2371: );
2372: hr_utility.set_location(l_proc, 50);
2373:
2374: --
2375: -- Rule check unit_standard_id
2376: --
2377: per_cpn_bus.chk_unit_standard_id
2378: (p_competence_id => p_rec.competence_id
2379: ,p_unit_standard_id => p_rec.unit_standard_id
2373:
2374: --
2375: -- Rule check unit_standard_id
2376: --
2377: per_cpn_bus.chk_unit_standard_id
2378: (p_competence_id => p_rec.competence_id
2379: ,p_unit_standard_id => p_rec.unit_standard_id
2380: ,p_business_group_id => p_rec.business_group_id
2381: ,p_object_version_number => p_rec.object_version_number
2375: -- Rule check unit_standard_id
2376: --
2377: per_cpn_bus.chk_unit_standard_id
2378: (p_competence_id => p_rec.competence_id
2379: ,p_unit_standard_id => p_rec.unit_standard_id
2380: ,p_business_group_id => p_rec.business_group_id
2381: ,p_object_version_number => p_rec.object_version_number
2382: ,p_effective_date => p_effective_date
2383: );
2605: );
2606: hr_utility.set_location(l_proc, 70);
2607:
2608: --
2609: -- Rule check unit_standard_id
2610: --
2611: per_cpn_bus.chk_unit_standard_id
2612: (p_competence_id => p_rec.competence_id
2613: ,p_unit_standard_id => p_rec.unit_standard_id
2607:
2608: --
2609: -- Rule check unit_standard_id
2610: --
2611: per_cpn_bus.chk_unit_standard_id
2612: (p_competence_id => p_rec.competence_id
2613: ,p_unit_standard_id => p_rec.unit_standard_id
2614: ,p_business_group_id => p_rec.business_group_id
2615: ,p_object_version_number => p_rec.object_version_number
2609: -- Rule check unit_standard_id
2610: --
2611: per_cpn_bus.chk_unit_standard_id
2612: (p_competence_id => p_rec.competence_id
2613: ,p_unit_standard_id => p_rec.unit_standard_id
2614: ,p_business_group_id => p_rec.business_group_id
2615: ,p_object_version_number => p_rec.object_version_number
2616: ,p_effective_date => p_effective_date
2617: );