DBA Data[Home] [Help]

PACKAGE BODY: APPS.HR_HK_PEOPLE_LEG_HOOK

Source


1 PACKAGE BODY hr_hk_people_leg_hook AS
2 /* $Header: hrhklhpp.pkb 120.1.12010000.3 2009/05/06 09:22:42 pmatamsr ship $ */
3 --
4   g_package  VARCHAR2(33) := 'hr_hk_people_leg_hook.';
5 --
6 
7 
8   PROCEDURE check_hkid_passport(         p_person_type_id           NUMBER
9                                         ,p_national_identifier      VARCHAR2
10                                         ,p_per_information1         VARCHAR2
11                                         ,p_per_information2         VARCHAR2
12                                         ,p_per_information3         VARCHAR2
13                                         ,p_per_information4         VARCHAR2) IS
14 
15     l_proc               VARCHAR2(200) := g_package||'check_hkid_passport';
16     l_system_person_type per_person_types.system_person_type%type;
17 
18   BEGIN
19     hr_utility.set_location('Entering:'|| l_proc, 10);
20 
21    /*Bug 8457005 - Removed the condition and modified the existing check such that the validation of
22                    national identifier and passport number is performed,only if Payroll for HK Legislation
23                    is installed ,otherwise the validation is skipped */
24 
25     IF NOT hr_utility.chk_product_install('Oracle Payroll', 'HK') THEN
26        hr_utility.trace ('HK Legislation not installed. Not performing the validations');
27        RETURN;
28     END IF;
29 
30       OPEN  csr_val_person_type(p_person_type_id);
31       FETCH csr_val_person_type INTO
32             l_system_person_type;
33       CLOSE csr_val_person_type;
34 
35    -- Check if the Person is Employee - Bug No : 2817820. The cursor csr_val_person_type included to fetch the
36    -- person_type using person_type_id.
37       IF l_system_person_type like 'EMP%' THEN
38          IF p_national_identifier IS NULL THEN
39            IF ((p_per_information1 IS NULL)
40               OR (p_per_information2 IS NULL)
41               OR (p_per_information3 IS NULL)
42               OR (p_per_information4 IS NULL)) THEN
43            -- Error
44              hr_utility.set_message(800,'HR_HK_HKID_OR_PASSPORT_INFO');
45              hr_utility.raise_error;
46             END IF;
47           END IF;
48       END IF;
49     hr_utility.set_location(' Leaving:'||l_proc, 20);
50   END check_hkid_passport;
51 
52 
53 
54 /* Bug No : 2737948 - Included a new procedure check_hongkong_name for Hong Kong Name validation */
55 
56  PROCEDURE check_hongkong_name( p_person_type_id NUMBER
57                                ,p_per_information6  VARCHAR2) IS
58 
59    l_proc      VARCHAR2(200) := g_package|| 'check_hongkong_name';
60    l_system_person_type  per_person_types.system_person_type%type;
61 
62   BEGIN
63     hr_utility.set_location('Entering:'|| l_proc, 10);
64     IF NOT hr_utility.chk_product_install('Oracle Human Resources', 'HK') THEN
65        hr_utility.trace ('HK Legislation not installed. Not performing the validations');
66        RETURN;
67     END IF;
68 
69     OPEN  csr_val_person_type(p_person_type_id);
70     FETCH csr_val_person_type INTO
71           l_system_person_type;
72     CLOSE csr_val_person_type;
73 
74     IF l_system_person_type like 'EMP%' THEN
75        IF (p_per_information6 IS NULL) THEN
76           hr_utility.set_message('800', 'HR_HK_HONGKONG_NAME');
77           hr_utility.raise_error;
78        END IF;
79     END IF;
80 
81     hr_utility.set_location(' Leaving:'||l_proc, 20);
82   EXCEPTION
83     WHEN OTHERS THEN
84      hr_utility.trace('Error in ' || l_proc );
85      raise;
86   END check_hongkong_name;
87 
88 
89 END hr_hk_people_leg_hook;