1 PACKAGE BODY hr_be_extra_person_rules AS
2 /* $Header: pebeexpr.pkb 120.0.12010000.2 2008/08/06 09:05:01 ubhat 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 IF val_changed(p_correspondence_language) THEN
50 --
51 OPEN c_system_person_type(p_person_type_id);
52 FETCH c_system_person_type INTO l_system_person_type;
53 CLOSE c_system_person_type;
54 --
55 IF l_system_person_type IN ('EMP', 'EMP_APL') THEN
56 IF p_correspondence_language IS NULL THEN
57 hr_utility.set_message(800, 'HR_BE_LANGUAGE_CODE_NULL');
58 hr_utility.raise_error;
59 ELSIf p_correspondence_language NOT IN ('NL','F','D') THEN
60 hr_utility.set_message(800, 'HR_BE_LANGUAGE_CODE_WRONG');
61 hr_utility.raise_error;
62 END IF;
63 END IF;
64 END IF;
65 END extra_language_checks;
66 --
67 --
68 -- Region of birth:
69 --
70 -- It cannot be entered.
71 --
72 -- Note: Supports both real and API system values (these are passed when the value has not
73 -- been changed.
74 --
75 PROCEDURE extra_person_checks
76 (p_region_of_birth IN VARCHAR2) IS
77 BEGIN
78 -- Added the validation for the Bug No. 6469769 to check whether the Belgium Legislation is installed or not.
79 -- Only if it is installed,the validation is performed.
80 IF NOT hr_utility.chk_product_install('Oracle Human Resources', 'BE') THEN
81 hr_utility.trace ('BE Legislation not installed. Not performing the validations');
82 RETURN;
83 END IF;
84 If val_changed(p_region_of_birth) AND p_region_of_birth IS NOT NULL THEN
85 hr_utility.set_message(800, 'HR_BE_REGION_OF_BIRTH_NOT_NULL');
86 hr_utility.raise_error;
87 END IF;
88 END extra_person_checks;
89
90 --
91 --
92 -- Employee Category:
93 --
94 -- It cannot be null.
95 --
96 --
97 PROCEDURE extra_assignment_checks
98 (p_employee_category IN VARCHAR2) IS
99 BEGIN
100 -- Added the validation for the Bug No. 6469769 to check whether the Belgium Legislation is installed or not.
101 -- Only if it is installed,the validation is performed.
102 IF NOT hr_utility.chk_product_install('Oracle Human Resources', 'BE') THEN
103 hr_utility.trace ('BE Legislation not installed. Not performing the validations');
104 RETURN;
105 END IF;
106 If p_employee_category IS NULL THEN
107 hr_utility.set_message(800, 'HR_BE_EMPLOYEE_CAT_NOT_NULL');
108 hr_utility.raise_error;
109 END IF;
110 END extra_assignment_checks;
111
112
113
114 END hr_be_extra_person_rules;