DBA Data[Home] [Help]

PACKAGE: APPS.HR_PERSON

Source


1 PACKAGE hr_person AUTHID CURRENT_USER AS
2 /* $Header: peperson.pkh 120.0.12020000.2 2013/01/30 09:40:59 srannama ship $ */
3 /*
4  ******************************************************************
5  *                                                                *
6  *  Copyright (C) 1992 Oracle Corporation UK Ltd.,                *
7  *                   Chertsey, England.                           *
8  *                                                                *
9  *  All rights reserved.                                          *
10  *                                                                *
11  *  This material has been provided pursuant to an agreement      *
12  *  containing restrictions on its use.  The material is also     *
13  *  protected by copyright law.  No part of this material may     *
14  *  be copied or distributed, transmitted or transcribed, in      *
15  *  any form or by any means, electronic, mechanical, magnetic,   *
16  *  manual, or otherwise, or disclosed to third parties without   *
17  *  the express written permission of Oracle Corporation UK Ltd,  *
18  *  Oracle Park, Bittams Lane, Guildford Road, Chertsey, Surrey,  *
19  *  England.                                                      *
20  *                                                                *
21  ****************************************************************** */
22 /*
23  Name        : hr_person  (HEADER)
24 
25  Description : This package declares procedures required to INSERT,
26    UPDATE or DELETE people on Oracle Human Resources. Note, this
27    does not include extra validation provided by calling programs (such
28    as screen QuickPicks and HRLink validation) OR that provided by use
29    of constraints and triggers held against individual tables.
30  Change List
31  -----------
32 
33  Version Date      Author     ER/CR No. Description of Change
34  -------+---------+----------+---------+--------------------------
35  70.0    21-DEC-92 SZWILLIA             Date Created
36                                         Requires new messages
37  70.1    04-JAN-93 PBARRY               Following procedures added:
38 					product_installed
39                                         person_existance_check
40                                         pay_predel_validation
41                                         ssp_predel_validation
42                                         weak_predel_validation
43                                         strong_predel_validation
44                                         delete_a_person
45                                         people_default_deletes
46                                         applicant_default_deletes
47  70.2    04-JAN-93 PBARRY		Ignore_all_relationships parameter
48 					removed from strong_predel_validation.
49  70.3    11-FEB-93 PBARRY		P_SESSION_DATE parameter added to :
50 					weak_predel_validation
51 					strong_predel_validation
52 					delete_a_person
53 					check_contact
54  70.4    04-MAR-93 SZWILLIA             Changed parameters to dates.
55  70.5    11-MAR-93 NKHAn		Added 'exit' to the end
56  70.6    19-APR-93 TMathers             Added chk_future_person_type,
57                                               chk_prev_person_type,
58                                               Validate_address.
59                                         Changed derive_full_name
60                                         to be a procedure rather than
61                                         a function.Changed
62                                         strong_pre_delete validation
63                                         removed a line.
64  70.7    09-JUN-93   TMATHERS           Fixed validate_dob to work for any
65                                         person_type.
66  70.11   13-JUN-93   TMATHERS           Fixed generate_number added p_person_id
67                                         parameter. Fixed version comments also.
68  70.14   07-Dec-93   TMATHERS           Split Validate National Identifier
69  80.1                                   so that duplicate check is in another
70                                         procedure, check_ni_unique. B280
71  70.16   26-jul-94   TMathers           Overloaded chk_future wrt G1121.
72  70.17   06-May-96   TMathers           Overloaded derive_full_name to cope
73  70.18   07-May-96   TMathers           missing ????
74  70.19   27-Jan-97   VTreiger           Added PRE_NAME_ADJUNCT,SUFFIX as
75                                         parameters to derive_full_name
76 			        	 with suffix field.(352340).
77  115.1   20-Apr-00   czdickin           Added PER_INFORMATIONXX as parameters
78                                         to derive_full_name.
79  115.2   23-JAN092   stlocke		Added dbdrv commands
80  115.3   20-FEB-02   adhunter           Added npw parameters to generate_number and
81                                         validate_unique_number
82  115.4   03-NOV-02   eumenyio           added nocopy
83 
84  115.7   27-JAN-04   irgonzal           Enh 3299580: Overloaded generate_number.
85  120.0   24-JAN-13   srannama           ER - Future Person Types
86  .12020000.2
87 
88  ================================================================= */
89 --
90 -- -----------------------  generate_number ------------------------
91 --
92 -- Procedure accepts the current emp and apl flags, national identifier
93 -- and business group and outputs the employee and applicant number
94 -- (Note if employee and applicant number are supplied and the method
95 --  is not automatic - the numbers will remain unchanged).
96 --
97 PROCEDURE generate_number
98  (p_current_employee    VARCHAR2 default null,
99   p_current_applicant   VARCHAR2 default null,
100   p_current_npw         VARCHAR2 default null,
101   p_national_identifier VARCHAR2 default null,
102   p_business_group_id   NUMBER,
103   p_person_id           NUMBER,
104   p_employee_number  IN OUT NOCOPY VARCHAR2 ,
105   p_applicant_number IN OUT NOCOPY VARCHAR2 ,
106   p_npw_number       IN OUT NOCOPY VARCHAR2);
107 --
108 -- 3299580: Overloaded
109 --
110 PROCEDURE generate_number
111  (p_current_employee    VARCHAR2 default null,
112   p_current_applicant   VARCHAR2 default null,
113   p_current_npw         VARCHAR2 default null,
114   p_national_identifier VARCHAR2 default null,
115   p_business_group_id   NUMBER,
116   p_person_id           NUMBER,
117   p_employee_number  IN OUT NOCOPY VARCHAR2 ,
118   p_applicant_number IN OUT NOCOPY VARCHAR2 ,
119   p_npw_number       IN OUT NOCOPY VARCHAR2
120  ,p_effective_date      IN     date
121  ,p_party_id            IN     number
122  ,p_date_of_birth       IN     date
123  ,p_start_date          IN     date default null
124  );
125 --
126 --
127 -- -------------------------- derive_full_name  ---------------------------
128 -- Construct FULL_NAME based on all name fields and if this name and date of
129 -- birth combination already exists (upper or lower case) then write an error
130 -- but DO NOT FAIL the procedure. Full Name may still be required as forms
131 -- treats this as a warning not an error
132 --
133 PROCEDURE derive_full_name
134 (p_first_name    VARCHAR2,
135  p_middle_names  VARCHAR2,
136  p_last_name     VARCHAR2,
137  p_known_as      VARCHAR2,
138  p_title         VARCHAR2,
139  p_suffix        VARCHAR2,
140  p_pre_name_adjunct VARCHAR2,
141  p_date_of_birth DATE,
142  p_person_id         NUMBER,
143  p_business_group_id NUMBER,
144  p_full_name OUT NOCOPY VARCHAR2 ,
145  p_duplicate_flag OUT NOCOPY VARCHAR2,
146  p_per_information1 VARCHAR2 DEFAULT NULL,
147  p_per_information2 VARCHAR2 DEFAULT NULL,
148  p_per_information3 VARCHAR2 DEFAULT NULL,
149  p_per_information4 VARCHAR2 DEFAULT NULL,
150  p_per_information5 VARCHAR2 DEFAULT NULL,
151  p_per_information6 VARCHAR2 DEFAULT NULL,
152  p_per_information7 VARCHAR2 DEFAULT NULL,
153  p_per_information8 VARCHAR2 DEFAULT NULL,
154  p_per_information9 VARCHAR2 DEFAULT NULL,
155  p_per_information10 VARCHAR2 DEFAULT NULL,
156  p_per_information11 VARCHAR2 DEFAULT NULL,
157  p_per_information12 VARCHAR2 DEFAULT NULL,
158  p_per_information13 VARCHAR2 DEFAULT NULL,
159  p_per_information14 VARCHAR2 DEFAULT NULL,
160  p_per_information15 VARCHAR2 DEFAULT NULL,
161  p_per_information16 VARCHAR2 DEFAULT NULL,
162  p_per_information17 VARCHAR2 DEFAULT NULL,
163  p_per_information18 VARCHAR2 DEFAULT NULL,
164  p_per_information19 VARCHAR2 DEFAULT NULL,
165  p_per_information20 VARCHAR2 DEFAULT NULL,
166  p_per_information21 VARCHAR2 DEFAULT NULL,
167  p_per_information22 VARCHAR2 DEFAULT NULL,
168  p_per_information23 VARCHAR2 DEFAULT NULL,
169  p_per_information24 VARCHAR2 DEFAULT NULL,
170  p_per_information25 VARCHAR2 DEFAULT NULL,
171  p_per_information26 VARCHAR2 DEFAULT NULL,
172  p_per_information27 VARCHAR2 DEFAULT NULL,
173  p_per_information28 VARCHAR2 DEFAULT NULL,
174  p_per_information29 VARCHAR2 DEFAULT NULL,
175  p_per_information30 VARCHAR2 DEFAULT NULL);
176 --
177 PROCEDURE derive_full_name
178 (p_first_name    VARCHAR2,
179  p_middle_names  VARCHAR2,
180  p_last_name     VARCHAR2,
181  p_known_as      VARCHAR2,
182  p_title         VARCHAR2,
183  p_suffix        VARCHAR2,
184  p_date_of_birth DATE,
185  p_person_id         NUMBER,
186  p_business_group_id NUMBER,
187  p_full_name OUT NOCOPY VARCHAR2 ,
188  p_duplicate_flag OUT NOCOPY VARCHAR2,
189  p_per_information1 VARCHAR2 DEFAULT NULL,
190  p_per_information2 VARCHAR2 DEFAULT NULL,
191  p_per_information3 VARCHAR2 DEFAULT NULL,
192  p_per_information4 VARCHAR2 DEFAULT NULL,
193  p_per_information5 VARCHAR2 DEFAULT NULL,
194  p_per_information6 VARCHAR2 DEFAULT NULL,
195  p_per_information7 VARCHAR2 DEFAULT NULL,
196  p_per_information8 VARCHAR2 DEFAULT NULL,
197  p_per_information9 VARCHAR2 DEFAULT NULL,
198  p_per_information10 VARCHAR2 DEFAULT NULL,
199  p_per_information11 VARCHAR2 DEFAULT NULL,
200  p_per_information12 VARCHAR2 DEFAULT NULL,
201  p_per_information13 VARCHAR2 DEFAULT NULL,
202  p_per_information14 VARCHAR2 DEFAULT NULL,
203  p_per_information15 VARCHAR2 DEFAULT NULL,
204  p_per_information16 VARCHAR2 DEFAULT NULL,
205  p_per_information17 VARCHAR2 DEFAULT NULL,
206  p_per_information18 VARCHAR2 DEFAULT NULL,
207  p_per_information19 VARCHAR2 DEFAULT NULL,
208  p_per_information20 VARCHAR2 DEFAULT NULL,
209  p_per_information21 VARCHAR2 DEFAULT NULL,
210  p_per_information22 VARCHAR2 DEFAULT NULL,
211  p_per_information23 VARCHAR2 DEFAULT NULL,
212  p_per_information24 VARCHAR2 DEFAULT NULL,
213  p_per_information25 VARCHAR2 DEFAULT NULL,
214  p_per_information26 VARCHAR2 DEFAULT NULL,
215  p_per_information27 VARCHAR2 DEFAULT NULL,
216  p_per_information28 VARCHAR2 DEFAULT NULL,
217  p_per_information29 VARCHAR2 DEFAULT NULL,
218  p_per_information30 VARCHAR2 DEFAULT NULL );
219 --
220 PROCEDURE derive_full_name
221 (p_first_name    VARCHAR2,
222  p_middle_names  VARCHAR2,
223  p_last_name     VARCHAR2,
224  p_known_as      VARCHAR2,
225  p_title         VARCHAR2,
226  p_date_of_birth DATE,
227  p_person_id         NUMBER,
228  p_business_group_id NUMBER,
229  p_full_name OUT NOCOPY VARCHAR2 ,
230  p_duplicate_flag OUT NOCOPY VARCHAR2,
231  p_per_information1 VARCHAR2 DEFAULT NULL,
232  p_per_information2 VARCHAR2 DEFAULT NULL,
233  p_per_information3 VARCHAR2 DEFAULT NULL,
234  p_per_information4 VARCHAR2 DEFAULT NULL,
235  p_per_information5 VARCHAR2 DEFAULT NULL,
236  p_per_information6 VARCHAR2 DEFAULT NULL,
237  p_per_information7 VARCHAR2 DEFAULT NULL,
238  p_per_information8 VARCHAR2 DEFAULT NULL,
239  p_per_information9 VARCHAR2 DEFAULT NULL,
240  p_per_information10 VARCHAR2 DEFAULT NULL,
241  p_per_information11 VARCHAR2 DEFAULT NULL,
242  p_per_information12 VARCHAR2 DEFAULT NULL,
243  p_per_information13 VARCHAR2 DEFAULT NULL,
244  p_per_information14 VARCHAR2 DEFAULT NULL,
245  p_per_information15 VARCHAR2 DEFAULT NULL,
246  p_per_information16 VARCHAR2 DEFAULT NULL,
247  p_per_information17 VARCHAR2 DEFAULT NULL,
248  p_per_information18 VARCHAR2 DEFAULT NULL,
249  p_per_information19 VARCHAR2 DEFAULT NULL,
250  p_per_information20 VARCHAR2 DEFAULT NULL,
251  p_per_information21 VARCHAR2 DEFAULT NULL,
252  p_per_information22 VARCHAR2 DEFAULT NULL,
253  p_per_information23 VARCHAR2 DEFAULT NULL,
254  p_per_information24 VARCHAR2 DEFAULT NULL,
255  p_per_information25 VARCHAR2 DEFAULT NULL,
256  p_per_information26 VARCHAR2 DEFAULT NULL,
260  p_per_information30 VARCHAR2 DEFAULT NULL);
257  p_per_information27 VARCHAR2 DEFAULT NULL,
258  p_per_information28 VARCHAR2 DEFAULT NULL,
259  p_per_information29 VARCHAR2 DEFAULT NULL,
261 
262 --  ------------------- check_ni_unique --------------------
263 procedure check_ni_unique
264 ( p_national_identifier VARCHAR2,
265   p_person_id           NUMBER,
266   p_business_group_id   NUMBER);
267 --
268 --
269 -- ------------------- validate_national_identifier -----------------------
270 --
271 -- Pass in national identifier and validate both construct (dependent on
272 -- the legislation of the business group) and uniqueness within business
273 -- group
274 --
275 PROCEDURE validate_national_identifier
276 ( p_national_identifier VARCHAR2,
277   p_person_id           NUMBER,
278   p_business_group_id   NUMBER);
279 --
280 --
281 -- ----------------------- validate_dob ------------------------------------
282 --
283 -- Date of Birth must be greater than start date for employees and applicants
284 --
285 PROCEDURE validate_dob
286 (p_date_of_birth      DATE,
287  p_start_date         DATE);
288 --
289 --
290 -- ----------------------- validate_sex_and_title --------------------------
291 --
292 -- Validation which should be performed at commit time for any person
293 --
294 PROCEDURE validate_sex_and_title(p_current_employee VARCHAR2
295                         ,p_sex              VARCHAR2
296                         ,p_title            VARCHAR2);
297 --
298 -- ----------------------- validate_unique_number --------------------------
299 --
300 -- Validation which should be performed at commit time for any person
301 --
302 PROCEDURE validate_unique_number(p_person_id          NUMBER
303                         ,p_business_group_id  NUMBER
304                         ,p_employee_number    VARCHAR2
305                         ,p_applicant_number   VARCHAR2
306                         ,p_npw_number         VARCHAR2
307                         ,p_current_employee   VARCHAR2
308                         ,p_current_applicant  VARCHAR2
309                         ,p_current_npw        VARCHAR2);
310 --
311 --
312 -- ----------------------- product_installed --------------------------
313 --
314 -- Has this product been installed? Return status and oracleid also.
315 --
316   PROCEDURE product_installed (p_application_short_name IN varchar2,
317                               p_status          OUT NOCOPY varchar2,
318                               p_yes_no          OUT NOCOPY varchar2,
319                               p_oracle_username OUT NOCOPY varchar2);
320 --
321 -- ----------------------- weak_predel_validation --------------------------
322 --
323 -- Weak pre-delete validation called primarily from Delete Person form.
324 --
325   PROCEDURE weak_predel_validation (p_person_id 	IN number,
326 				    p_session_date	IN date);
327 --
328 -- ----------------------- strong_predel_validation --------------------------
329 --
330 -- Strong pre-delete validation called from the Enter Person and Applicant
331 -- Quick Entry forms.
332 --
333   PROCEDURE strong_predel_validation (p_person_id IN number,
334 				      p_session_date IN date);
335 --
336 -- ----------------------- check_contact --------------------------
337 --
338 -- Whilst deleteing a contact relationship, is this contact 'used' for
339 -- anything else? If not then delete this person.
340 --
341   PROCEDURE check_contact (p_person_id                  IN number,
342                            p_contact_person_id          IN number,
343                            p_contact_relationship_id    IN number,
344 			   p_session_date		IN date);
345 --
346 -- ----------------------- delete_a_person --------------------------
347 --
348 -- Delete a person completely from the HR database. Deletes from all tables
349 -- referencing this person. Used primarily by Delete Person form.
350 --
351   PROCEDURE delete_a_person (p_person_id        IN number,
352                              p_form_call        IN boolean,
353 			     p_session_date	IN date);
354 --
355 -- ----------------------- people_default_deletes --------------------------
356 --
357 -- Delete people who only have default information entered for them.
358 -- Used primarily by the Enter Person form.
359 --
360   PROCEDURE people_default_deletes (p_person_id IN number,
361                                     p_form_call IN boolean);
362 --
363 -- ----------------------- applicant_default_deletes --------------------------
364 --
365 -- Delete applicants who only have default information entered for them.
366 -- Used primarily by the Applicant Quick Entry form.
367 --
368   PROCEDURE applicant_default_deletes (p_person_id      IN number,
369                                        p_form_call      IN boolean);
370 --
371 ------------------------- BEGIN: chk_future_person_type --------------------
372 FUNCTION chk_future_person_type
373         (p_system_person_type IN VARCHAR2
374         ,p_person_id IN INTEGER
375         ,p_business_group_id IN INTEGER
376         ,p_effective_start_date IN DATE) return BOOLEAN;
377 --
378 ------------------------- BEGIN: fpt_check_ft_person_type --------------------
379 FUNCTION fpt_check_ft_person_type
380         (p_system_person_type IN VARCHAR2
381         ,p_person_id IN INTEGER
382         ,p_business_group_id IN INTEGER
383         ,p_check_all IN VARCHAR2 DEFAULT 'Y'
384         ,p_effective_start_date IN DATE) return BOOLEAN;
385 --
386 ------------------------- BEGIN: chk_future_person_type --------------------
387 FUNCTION chk_future_person_type
388         (p_system_person_type IN VARCHAR2
389         ,p_person_id IN INTEGER
390         ,p_business_group_id IN INTEGER
391         ,p_check_all IN VARCHAR2 DEFAULT 'Y'
395 FUNCTION chk_prev_person_type
392         ,p_effective_start_date IN DATE) return BOOLEAN;
393 --
394 ------------------------- BEGIN: chk_prev_person_type --------------------
396          (p_system_person_type IN VARCHAR2
397          ,p_person_id IN INTEGER
398          ,p_business_group_id IN INTEGER
399          ,p_effective_start_date IN DATE) RETURN BOOLEAN;
400 --
401 ------------------------- BEGIN: validate_address -------------------------
402 PROCEDURE validate_address(p_person_id INTEGER
403                           ,p_business_group_id INTEGER
404                           ,p_address_id INTEGER
405                           ,p_date_from DATE
406                           ,p_date_to DATE
407                           ,p_end_of_time DATE
408                           ,p_primary_flag VARCHAR2);
409 --
410 end hr_person;