59: close csr_sec_grp;
60: --
61: -- The primary key is invalid therefore we must error
62: --
63: fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
64: hr_multi_message.add
65: (p_associated_column1
66: => nvl(p_associated_column1,'VEHICLE_ALLOCATION_ID')
67: );
140: --
141: -- The primary key is invalid therefore we must error
142: --
143: close csr_leg_code;
144: fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
145: fnd_message.raise_error;
146: end if;
147: hr_utility.set_location(l_proc,30);
148: --
141: -- The primary key is invalid therefore we must error
142: --
143: close csr_leg_code;
144: fnd_message.set_name('PAY','HR_7220_INVALID_PRIMARY_KEY');
145: fnd_message.raise_error;
146: end if;
147: hr_utility.set_location(l_proc,30);
148: --
149: -- Set the global variables so the values are
474: (p_vehicle_allocation_id => p_rec.vehicle_allocation_id
475: ,p_effective_date => p_effective_date
476: ,p_object_version_number => p_rec.object_version_number
477: ) THEN
478: fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
479: fnd_message.set_token('PROCEDURE ', l_proc);
480: fnd_message.set_token('STEP ', '5');
481: fnd_message.raise_error;
482: END IF;
475: ,p_effective_date => p_effective_date
476: ,p_object_version_number => p_rec.object_version_number
477: ) THEN
478: fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
479: fnd_message.set_token('PROCEDURE ', l_proc);
480: fnd_message.set_token('STEP ', '5');
481: fnd_message.raise_error;
482: END IF;
483: --
476: ,p_object_version_number => p_rec.object_version_number
477: ) THEN
478: fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
479: fnd_message.set_token('PROCEDURE ', l_proc);
480: fnd_message.set_token('STEP ', '5');
481: fnd_message.raise_error;
482: END IF;
483: --
484: -- EDIT_HERE: Add checks to ensure non-updateable args have
477: ) THEN
478: fnd_message.set_name('PER', 'HR_6153_ALL_PROCEDURE_FAIL');
479: fnd_message.set_token('PROCEDURE ', l_proc);
480: fnd_message.set_token('STEP ', '5');
481: fnd_message.raise_error;
482: END IF;
483: --
484: -- EDIT_HERE: Add checks to ensure non-updateable args have
485: -- not been updated.
556: --
557: -- An unhandled or unexpected error has occurred which
558: -- we must report
559: --
560: fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
561: fnd_message.set_token('PROCEDURE', l_proc);
562: fnd_message.set_token('STEP','15');
563: fnd_message.raise_error;
564: End dt_update_validate;
557: -- An unhandled or unexpected error has occurred which
558: -- we must report
559: --
560: fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
561: fnd_message.set_token('PROCEDURE', l_proc);
562: fnd_message.set_token('STEP','15');
563: fnd_message.raise_error;
564: End dt_update_validate;
565: --
558: -- we must report
559: --
560: fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
561: fnd_message.set_token('PROCEDURE', l_proc);
562: fnd_message.set_token('STEP','15');
563: fnd_message.raise_error;
564: End dt_update_validate;
565: --
566: -- ----------------------------------------------------------------------------
559: --
560: fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
561: fnd_message.set_token('PROCEDURE', l_proc);
562: fnd_message.set_token('STEP','15');
563: fnd_message.raise_error;
564: End dt_update_validate;
565: --
566: -- ----------------------------------------------------------------------------
567: -- |--------------------------< dt_delete_validate >--------------------------|
653: --
654: -- An unhandled or unexpected error has occurred which
655: -- we must report
656: --
657: fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
658: fnd_message.set_token('PROCEDURE', l_proc);
659: fnd_message.set_token('STEP','15');
660: fnd_message.raise_error;
661: --
654: -- An unhandled or unexpected error has occurred which
655: -- we must report
656: --
657: fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
658: fnd_message.set_token('PROCEDURE', l_proc);
659: fnd_message.set_token('STEP','15');
660: fnd_message.raise_error;
661: --
662: End dt_delete_validate;
655: -- we must report
656: --
657: fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
658: fnd_message.set_token('PROCEDURE', l_proc);
659: fnd_message.set_token('STEP','15');
660: fnd_message.raise_error;
661: --
662: End dt_delete_validate;
663: --
656: --
657: fnd_message.set_name('PAY', 'HR_6153_ALL_PROCEDURE_FAIL');
658: fnd_message.set_token('PROCEDURE', l_proc);
659: fnd_message.set_token('STEP','15');
660: fnd_message.raise_error;
661: --
662: End dt_delete_validate;
663: --
664: -----------------------------------------------------------------------------
854:
855: EXCEPTION
856: ---------
857: WHEN no_data_found then
858: fnd_message.raise_error;
859:
860: WHEN others then
861: fnd_message.raise_error;
862:
857: WHEN no_data_found then
858: fnd_message.raise_error;
859:
860: WHEN others then
861: fnd_message.raise_error;
862:
863:
864: End;
865: ------------------------------------------------------------------------------
884:
885: EXCEPTION
886: ---------
887: WHEN no_data_found then
888: fnd_message.raise_error;
889:
890: WHEN others then
891: fnd_message.raise_error;
892: End;
887: WHEN no_data_found then
888: fnd_message.raise_error;
889:
890: WHEN others then
891: fnd_message.raise_error;
892: End;
893: -----------------------------------------------------------------------------
894: ---------------------Check the Primary Vehicle Allocation-
895: -----------------------------------------------------------------------------
1425:
1426: --Checking the vehicle status ,if it Inactive then
1427: --vehicle cannot be allocate
1428: IF l_vehicle_status = 'I' THEN
1429: fnd_message.set_name('PQP', 'PQP_230925_INACTIVE_VEH_ASSIGN');
1430: fnd_message.raise_error;
1431: END IF;
1432:
1433: --Fixing the bug #2864591
1426: --Checking the vehicle status ,if it Inactive then
1427: --vehicle cannot be allocate
1428: IF l_vehicle_status = 'I' THEN
1429: fnd_message.set_name('PQP', 'PQP_230925_INACTIVE_VEH_ASSIGN');
1430: fnd_message.raise_error;
1431: END IF;
1432:
1433: --Fixing the bug #2864591
1434: --Checking the allocation effective start date is
1434: --Checking the allocation effective start date is
1435: --greter than or equal to veh reg date
1436: IF l_initial_registration IS NOT NULL THEN
1437: IF l_initial_registration > p_effective_date THEN
1438: fnd_message.set_name('PQP', 'PQP_230926_REG_DATE_ASSIGN_ERR');
1439: fnd_message.set_token('TOKEN',l_registration_number);
1440: fnd_message.raise_error;
1441: END IF;
1442: END IF;
1435: --greter than or equal to veh reg date
1436: IF l_initial_registration IS NOT NULL THEN
1437: IF l_initial_registration > p_effective_date THEN
1438: fnd_message.set_name('PQP', 'PQP_230926_REG_DATE_ASSIGN_ERR');
1439: fnd_message.set_token('TOKEN',l_registration_number);
1440: fnd_message.raise_error;
1441: END IF;
1442: END IF;
1443:
1436: IF l_initial_registration IS NOT NULL THEN
1437: IF l_initial_registration > p_effective_date THEN
1438: fnd_message.set_name('PQP', 'PQP_230926_REG_DATE_ASSIGN_ERR');
1439: fnd_message.set_token('TOKEN',l_registration_number);
1440: fnd_message.raise_error;
1441: END IF;
1442: END IF;
1443:
1444:
1449: ,p_argument_value => p_rec.usage_type
1450: ,p_message => l_message);
1451:
1452: IF l_return_status = -1 THEN
1453: fnd_message.set_name('PQP', 'PQP_230734_FLD_MANDTRY');
1454: fnd_message.set_token('FEILD','Usage Type');
1455: fnd_message.raise_error;
1456: END IF;
1457: END IF;
1450: ,p_message => l_message);
1451:
1452: IF l_return_status = -1 THEN
1453: fnd_message.set_name('PQP', 'PQP_230734_FLD_MANDTRY');
1454: fnd_message.set_token('FEILD','Usage Type');
1455: fnd_message.raise_error;
1456: END IF;
1457: END IF;
1458:
1451:
1452: IF l_return_status = -1 THEN
1453: fnd_message.set_name('PQP', 'PQP_230734_FLD_MANDTRY');
1454: fnd_message.set_token('FEILD','Usage Type');
1455: fnd_message.raise_error;
1456: END IF;
1457: END IF;
1458:
1459: --Checking usage Type lookup validation
1468: ,p_validation_start_date => p_validation_start_date
1469: ,p_validation_end_date => p_validation_end_date);
1470:
1471: IF l_return_status = -1 THEN
1472: fnd_message.set_name('PQP','PQP_230722_VLD_USG_OWNRSHP');
1473: fnd_message.raise_error;
1474: END IF;
1475: ELSE
1476: /*
1469: ,p_validation_end_date => p_validation_end_date);
1470:
1471: IF l_return_status = -1 THEN
1472: fnd_message.set_name('PQP','PQP_230722_VLD_USG_OWNRSHP');
1473: fnd_message.raise_error;
1474: END IF;
1475: ELSE
1476: /*
1477: l_return_status := chk_lookup(
1482: ,p_validation_start_date => p_validation_start_date
1483: ,p_validation_end_date => p_validation_end_date);
1484:
1485: IF l_return_status = -1 THEN
1486: fnd_message.set_name('PQP','PQP_230722_VLD_USG_OWNRSHP');
1487: fnd_message.raise_error;
1488: END IF;*/
1489: NULL;
1490: END IF;
1483: ,p_validation_end_date => p_validation_end_date);
1484:
1485: IF l_return_status = -1 THEN
1486: fnd_message.set_name('PQP','PQP_230722_VLD_USG_OWNRSHP');
1487: fnd_message.raise_error;
1488: END IF;*/
1489: NULL;
1490: END IF;
1491:
1498: ,p_validation_start_date => p_validation_start_date
1499: ,p_validation_end_date => p_validation_end_date);
1500:
1501: IF l_return_status = -1 THEN
1502: fnd_message.set_name('PQP','PQP_230824_VALID_CALC_METHOD');
1503: fnd_message.raise_error;
1504: END IF;
1505:
1506: --Checking the regnumber exist
1499: ,p_validation_end_date => p_validation_end_date);
1500:
1501: IF l_return_status = -1 THEN
1502: fnd_message.set_name('PQP','PQP_230824_VALID_CALC_METHOD');
1503: fnd_message.raise_error;
1504: END IF;
1505:
1506: --Checking the regnumber exist
1507: l_return_status := chk_reg_exist_for_alloc(
1509: ,p_effective_date => p_effective_date
1510: ,p_message => l_message );
1511:
1512: IF l_return_status = -1 THEN
1513: fnd_message.set_name('PQP', 'PQP_230759_ALLOC_REG_EXIST');
1514: fnd_message.raise_error;
1515: END IF;
1516:
1517:
1510: ,p_message => l_message );
1511:
1512: IF l_return_status = -1 THEN
1513: fnd_message.set_name('PQP', 'PQP_230759_ALLOC_REG_EXIST');
1514: fnd_message.raise_error;
1515: END IF;
1516:
1517:
1518: --Checking the fuelcard/fuelNumber/fuelbenifit value
1525: ,p_effective_date => p_effective_date
1526: ,p_message => l_message );
1527:
1528: IF l_return_status = -1 THEN
1529: fnd_message.set_name('PQP', 'PQP_230738_COMP_OWNR_MNDTRY');
1530: fnd_message.set_token('TOKEN','Fuel Card');
1531: fnd_message.raise_error;
1532: END IF;
1533: END IF;
1526: ,p_message => l_message );
1527:
1528: IF l_return_status = -1 THEN
1529: fnd_message.set_name('PQP', 'PQP_230738_COMP_OWNR_MNDTRY');
1530: fnd_message.set_token('TOKEN','Fuel Card');
1531: fnd_message.raise_error;
1532: END IF;
1533: END IF;
1534:
1527:
1528: IF l_return_status = -1 THEN
1529: fnd_message.set_name('PQP', 'PQP_230738_COMP_OWNR_MNDTRY');
1530: fnd_message.set_token('TOKEN','Fuel Card');
1531: fnd_message.raise_error;
1532: END IF;
1533: END IF;
1534:
1535: --Getting the legislationId for business groupId
1549:
1550: -- If there is already allocation then throw error
1551: -- because it should be only one entry for P/E
1552: IF l_return_count = -1 THEN
1553: fnd_message.set_name('PQP', 'PQP_230708_PMRY_RESTRICT');
1554: fnd_message.raise_error;
1555: END IF;
1556: END IF;
1557:
1550: -- If there is already allocation then throw error
1551: -- because it should be only one entry for P/E
1552: IF l_return_count = -1 THEN
1553: fnd_message.set_name('PQP', 'PQP_230708_PMRY_RESTRICT');
1554: fnd_message.raise_error;
1555: END IF;
1556: END IF;
1557:
1558:
1581: l_number_value := fnd_number.CANONICAL_TO_NUMBER(l_max_conf_count);
1582: End;
1583: IF l_cmy_veh_alloc_count >= l_number_value THEN
1584: l_message := 'person already reached the maximum limit';
1585: fnd_message.set_name('PQP', 'PQP_230709_MAX_COMP_ALLOC');
1586: fnd_message.raise_error;
1587: END IF;
1588: END IF;
1589:
1582: End;
1583: IF l_cmy_veh_alloc_count >= l_number_value THEN
1584: l_message := 'person already reached the maximum limit';
1585: fnd_message.set_name('PQP', 'PQP_230709_MAX_COMP_ALLOC');
1586: fnd_message.raise_error;
1587: END IF;
1588: END IF;
1589:
1590: --Checking the Share Company Car validation
1599: p_information_category =>'PQP_VEHICLE_MILEAGE',
1600: p_message => l_message );
1601:
1602: IF l_return_count = -1 THEN
1603: fnd_message.set_name('PQP', 'PQP_230707_VEH_ALLOC_INFO');
1604: fnd_message.raise_error;
1605: END IF;
1606: END IF;
1607:
1600: p_message => l_message );
1601:
1602: IF l_return_count = -1 THEN
1603: fnd_message.set_name('PQP', 'PQP_230707_VEH_ALLOC_INFO');
1604: fnd_message.raise_error;
1605: END IF;
1606: END IF;
1607:
1608:
1623: ,p_message =>l_message );
1624: -- If there is already allocation then throw error
1625: -- because it should be only one entry for default
1626: IF l_return_count = -1 THEN
1627: fnd_message.set_name('PQP', 'PQP_230746_ONE_ESS_RSTRICT');
1628: fnd_message.raise_error;
1629: END IF;
1630: END IF;
1631:
1624: -- If there is already allocation then throw error
1625: -- because it should be only one entry for default
1626: IF l_return_count = -1 THEN
1627: fnd_message.set_name('PQP', 'PQP_230746_ONE_ESS_RSTRICT');
1628: fnd_message.raise_error;
1629: END IF;
1630: END IF;
1631:
1632:
1651: End;
1652:
1653: IF l_pri_veh_alloc_count >= l_number_value THEN
1654: l_message := 'person already reached the maximum limit';
1655: fnd_message.set_name('PQP', 'PQP_230710_MAX_PVT_ALLOC');
1656: fnd_message.raise_error;
1657: END IF;
1658: END IF;
1659: -- cheking for share Private car
1652:
1653: IF l_pri_veh_alloc_count >= l_number_value THEN
1654: l_message := 'person already reached the maximum limit';
1655: fnd_message.set_name('PQP', 'PQP_230710_MAX_PVT_ALLOC');
1656: fnd_message.raise_error;
1657: END IF;
1658: END IF;
1659: -- cheking for share Private car
1660: l_return_count := pqp_config_shared_veh(
1668: p_information_category =>'PQP_VEHICLE_MILEAGE',
1669: p_message => l_message );
1670:
1671: IF l_return_count = -1 THEN
1672: fnd_message.set_name('PQP', 'PQP_230707_VEH_ALLOC_INFO');
1673: fnd_message.raise_error;
1674: END IF;
1675: END IF;
1676: Exception
1669: p_message => l_message );
1670:
1671: IF l_return_count = -1 THEN
1672: fnd_message.set_name('PQP', 'PQP_230707_VEH_ALLOC_INFO');
1673: fnd_message.raise_error;
1674: END IF;
1675: END IF;
1676: Exception
1677: when app_exception.application_exception then
1789: p_rec.vehicle_repository_id THEN
1790:
1791: IF l_vehicle_status = 'I' THEN
1792: l_message := 'Vehicle status is Inactive,so vehicle cannot update';
1793: fnd_message.set_name('PQP', 'PQP_230925_INACTIVE_VEH_ASSIGN');
1794: fnd_message.raise_error;
1795: END IF;
1796: END IF;
1797:
1790:
1791: IF l_vehicle_status = 'I' THEN
1792: l_message := 'Vehicle status is Inactive,so vehicle cannot update';
1793: fnd_message.set_name('PQP', 'PQP_230925_INACTIVE_VEH_ASSIGN');
1794: fnd_message.raise_error;
1795: END IF;
1796: END IF;
1797:
1798: --Fixing the bug #2864591
1799: --Checking the allocation effective start date is
1800: --greter than or equal to veh reg date
1801: IF l_initial_registration IS NOT NULL THEN
1802: IF l_initial_registration > p_effective_date THEN
1803: fnd_message.set_name('PQP', 'PQP_230926_REG_DATE_ASSIGN_ERR');
1804: fnd_message.set_token('TOKEN',l_registration_number);
1805: fnd_message.raise_error;
1806: END IF;
1807: END IF;
1800: --greter than or equal to veh reg date
1801: IF l_initial_registration IS NOT NULL THEN
1802: IF l_initial_registration > p_effective_date THEN
1803: fnd_message.set_name('PQP', 'PQP_230926_REG_DATE_ASSIGN_ERR');
1804: fnd_message.set_token('TOKEN',l_registration_number);
1805: fnd_message.raise_error;
1806: END IF;
1807: END IF;
1808:
1801: IF l_initial_registration IS NOT NULL THEN
1802: IF l_initial_registration > p_effective_date THEN
1803: fnd_message.set_name('PQP', 'PQP_230926_REG_DATE_ASSIGN_ERR');
1804: fnd_message.set_token('TOKEN',l_registration_number);
1805: fnd_message.raise_error;
1806: END IF;
1807: END IF;
1808:
1809: --Checking for value change
1821: ,p_effective_date => p_effective_date
1822: ,p_validation_start_date => p_validation_start_date
1823: ,p_validation_end_date => p_validation_end_date);
1824: IF l_return_status = -1 THEN
1825: fnd_message.set_name('PQP','PQP_230722_VLD_USG_OWNRSHP');
1826: fnd_message.raise_error;
1827: END IF;
1828: ELSE
1829: /*
1822: ,p_validation_start_date => p_validation_start_date
1823: ,p_validation_end_date => p_validation_end_date);
1824: IF l_return_status = -1 THEN
1825: fnd_message.set_name('PQP','PQP_230722_VLD_USG_OWNRSHP');
1826: fnd_message.raise_error;
1827: END IF;
1828: ELSE
1829: /*
1830: l_return_status := chk_lookup(
1834: ,p_effective_date => p_effective_date
1835: ,p_validation_start_date => p_validation_start_date
1836: ,p_validation_end_date => p_validation_end_date);
1837: IF l_return_status = -1 THEN
1838: fnd_message.set_name('PQP','PQP_230722_VLD_USG_OWNRSHP');
1839: fnd_message.raise_error;
1840: END IF;*/
1841: NULL;
1842: END IF;
1835: ,p_validation_start_date => p_validation_start_date
1836: ,p_validation_end_date => p_validation_end_date);
1837: IF l_return_status = -1 THEN
1838: fnd_message.set_name('PQP','PQP_230722_VLD_USG_OWNRSHP');
1839: fnd_message.raise_error;
1840: END IF;*/
1841: NULL;
1842: END IF;
1843: END IF;
1854: ,p_validation_start_date => p_validation_start_date
1855: ,p_validation_end_date => p_validation_end_date);
1856:
1857: IF l_return_status = -1 THEN
1858: fnd_message.set_name('PQP','PQP_230824_VALID_CALC_METHOD');
1859: fnd_message.raise_error;
1860: END IF;
1861: END IF;
1862:
1855: ,p_validation_end_date => p_validation_end_date);
1856:
1857: IF l_return_status = -1 THEN
1858: fnd_message.set_name('PQP','PQP_230824_VALID_CALC_METHOD');
1859: fnd_message.raise_error;
1860: END IF;
1861: END IF;
1862:
1863:
1875:
1876: -- If there is already allocation then throw error,because it
1877: --should be only one entry for P
1878: IF l_return_count = -1 THEN
1879: fnd_message.set_name('PQP', 'PQP_230708_PMRY_RESTRICT');
1880: fnd_message.raise_error;
1881: END IF;
1882: END IF;
1883: END IF;
1876: -- If there is already allocation then throw error,because it
1877: --should be only one entry for P
1878: IF l_return_count = -1 THEN
1879: fnd_message.set_name('PQP', 'PQP_230708_PMRY_RESTRICT');
1880: fnd_message.raise_error;
1881: END IF;
1882: END IF;
1883: END IF;
1884:
1900: ,p_message =>l_message );
1901: --If there is already allocation then throw error
1902: --because it should be only one entry for default
1903: IF l_return_count = -1 THEN
1904: fnd_message.set_name('PQP', 'PQP_230746_ONE_ESS_RSTRICT');
1905: fnd_message.raise_error;
1906: END IF;
1907: END IF;
1908: END IF;
1901: --If there is already allocation then throw error
1902: --because it should be only one entry for default
1903: IF l_return_count = -1 THEN
1904: fnd_message.set_name('PQP', 'PQP_230746_ONE_ESS_RSTRICT');
1905: fnd_message.raise_error;
1906: END IF;
1907: END IF;
1908: END IF;
1909:
1961: ,p_effective_date =>p_effective_date
1962: ,p_message => l_message );
1963: hr_utility.set_location('Purge delete status:'||l_return_status,40);
1964: IF l_return_status = -1 THEN
1965: fnd_message.set_name('PQP', 'PQP_230724_DEL_ALLOC_RESTRICT');
1966: fnd_message.raise_error;
1967: END IF;
1968:
1969: ELSIF p_datetrack_mode = 'DELETE' THEN
1962: ,p_message => l_message );
1963: hr_utility.set_location('Purge delete status:'||l_return_status,40);
1964: IF l_return_status = -1 THEN
1965: fnd_message.set_name('PQP', 'PQP_230724_DEL_ALLOC_RESTRICT');
1966: fnd_message.raise_error;
1967: END IF;
1968:
1969: ELSIF p_datetrack_mode = 'DELETE' THEN
1970: --This is for enddate
1973: ,p_effective_date =>p_effective_date
1974: ,p_message => l_message );
1975: hr_utility.set_location('En date delete status :'||l_return_status,45);
1976: IF l_return_status = -1 THEN
1977: fnd_message.set_name('PQP', 'PQP_230700_CANCEL_INFO');
1978: fnd_message.raise_error;
1979: END IF;
1980: END IF;
1981:
1974: ,p_message => l_message );
1975: hr_utility.set_location('En date delete status :'||l_return_status,45);
1976: IF l_return_status = -1 THEN
1977: fnd_message.set_name('PQP', 'PQP_230700_CANCEL_INFO');
1978: fnd_message.raise_error;
1979: END IF;
1980: END IF;
1981:
1982: hr_utility.set_location(' Leaving:'||l_proc, 10);