1 PACKAGE BODY hr_be_extra_person_rules AS
2 /* $Header: pebeexpr.pkb 120.1.12020000.2 2012/07/16 10:11:26 sgmaram ship $ */
3 --
4 --
5 -- Service functions to return TRUE if the value passed has been changed.
6 --
7 FUNCTION val_changed(p_value IN NUMBER) RETURN BOOLEAN IS
8 BEGIN
9 RETURN (p_value IS NULL OR p_value <> hr_api.g_number);
10 END val_changed;
11 --
12 FUNCTION val_changed(p_value IN VARCHAR2) RETURN BOOLEAN IS
13 BEGIN
14 RETURN (p_value IS NULL OR p_value <> hr_api.g_varchar2);
15 END val_changed;
16 --
17 FUNCTION val_changed(p_value IN DATE) RETURN BOOLEAN IS
18 BEGIN
19 RETURN (p_value IS NULL OR p_value <> hr_api.g_date);
20 END val_changed;
21 --
22 --
23 -- Correspondance language:
24 --
25 -- It is mandatory for an employee and must be one of the following languages -
26 -- 'NL' - Dutch, 'F' - French, or 'D' - German.
27 --
28 -- Note: Supports both real and API system values (these are passed when the value has not
29 -- been changed.
30 --
31 procedure extra_language_checks
32 (p_person_type_id IN NUMBER
33 ,p_correspondence_language IN VARCHAR2) IS
34 --
35 CURSOR c_system_person_type(p_person_type_id NUMBER) IS
36 SELECT system_person_type
37 FROM per_person_types
38 WHERE person_type_id = p_person_type_id;
39 --
40 l_system_person_type per_person_types.system_person_type%TYPE;
41 BEGIN
42 -- Added the validation for the Bug No. 6469769 to check whether the Belgium Legislation is installed or not.
43 -- Only if it is installed,the validation is performed.
44 IF NOT hr_utility.chk_product_install('Oracle Human Resources', 'BE') THEN
45 hr_utility.trace ('BE Legislation not installed. Not performing the validations');
46 RETURN;
47 END IF;
48
49
50 -- Bug#14250197
51 -- This 'if' clause avoids checking for the various
52 -- mandatory parameters during the global deployment
53 -- process for an employee.
54
55
56 IF per_per_bus.g_global_transfer_in_process IS NULL
57 OR per_per_bus.g_global_transfer_in_process = FALSE then
58
59 -- Bug#14250197
60
61 IF val_changed(p_correspondence_language) THEN
62 --
63 OPEN c_system_person_type(p_person_type_id);
64 FETCH c_system_person_type INTO l_system_person_type;
65 CLOSE c_system_person_type;
66 --
67 IF l_system_person_type IN ('EMP', 'EMP_APL') THEN
68 IF p_correspondence_language IS NULL THEN
69 hr_utility.set_message(800, 'HR_BE_LANGUAGE_CODE_NULL');
70 hr_utility.raise_error;
71 ELSIf p_correspondence_language NOT IN ('NL','F','D') THEN
72 hr_utility.set_message(800, 'HR_BE_LANGUAGE_CODE_WRONG');
73 hr_utility.raise_error;
74 END IF;
75 END IF;
76 END IF;
77 END IF; -- Bug#14250197
78 END extra_language_checks;
79 --
80 --
81 -- Region of birth:
82 --
83 -- It cannot be entered.
84 --
85 -- Note: Supports both real and API system values (these are passed when the value has not
86 -- been changed.
87 --
88 PROCEDURE extra_person_checks
89 (p_region_of_birth IN VARCHAR2) IS
90 BEGIN
91 -- Added the validation for the Bug No. 6469769 to check whether the Belgium Legislation is installed or not.
92 -- Only if it is installed,the validation is performed.
93 IF NOT hr_utility.chk_product_install('Oracle Human Resources', 'BE') THEN
94 hr_utility.trace ('BE Legislation not installed. Not performing the validations');
95 RETURN;
96 END IF;
97 If val_changed(p_region_of_birth) AND p_region_of_birth IS NOT NULL THEN
98 hr_utility.set_message(800, 'HR_BE_REGION_OF_BIRTH_NOT_NULL');
99 hr_utility.raise_error;
100 END IF;
101 END extra_person_checks;
102
103 --
104 --
105 -- Employee Category:
106 --
107 -- It cannot be null.
108 --
109 --
110 PROCEDURE extra_assignment_checks
111 (p_employee_category IN VARCHAR2) IS
112 BEGIN
113 -- Added the validation for the Bug No. 6469769 to check whether the Belgium Legislation is installed or not.
114 -- Only if it is installed,the validation is performed.
115 IF NOT hr_utility.chk_product_install('Oracle Human Resources', 'BE') THEN
116 hr_utility.trace ('BE Legislation not installed. Not performing the validations');
117 RETURN;
118 END IF;
119 If p_employee_category IS NULL THEN
120 hr_utility.set_message(800, 'HR_BE_EMPLOYEE_CAT_NOT_NULL');
121 hr_utility.raise_error;
122 END IF;
123 END extra_assignment_checks;
124
125
126
127 END hr_be_extra_person_rules;