DBA Data[Home] [Help]

PACKAGE BODY: APPS.GHR_PAR_BUS

Source


1 Package Body ghr_par_bus as
2 /* $Header: ghparrhi.pkb 120.5.12010000.3 2008/10/22 07:10:55 utokachi ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  varchar2(33)	:= '  ghr_par_bus.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |---------------------------< chk_non_updateable_args>----------------------------|
12 -- ----------------------------------------------------------------------------
13 -- May not be reuqired as the Family code also is updateable now.
14 
15 -- ---------------------------------------------------------------------------
16 --  ---------------------------------------------------------------------------
17 -- |-----------------------------< chk_nature_of_action_id >---------------------------|
18 --  ---------------------------------------------------------------------------
19 --
20 -- Description:
21 --   Validates that the nature_of_action is valid for the specific family
22 --   as of the effective_date
23 --
24 -- Pre Conditions:
25 --
26 -- In Parameters:
27 --   p_first_nature_of_action_id
28 --   p_pa_request_id
29 --   p_object_version_number
30 --   p_effective_date
31 --
32 -- Post Success:
33 --   Processing continues.
34 --
35 -- Post Failure:
36 --   An application error is raised and the process is terminated
37 --
38 -- Access Status:
39 --   Internal Table Handler Use Only.
40 --
41 -- ---------------------------------------------------------------------------
42   procedure chk_nature_of_action_id
43    (p_first_nature_of_action_id    in  ghr_pa_requests.first_noa_id%TYPE
44    ,p_pa_request_id                in  ghr_pa_requests.pa_request_id%TYPE
45    ,p_noa_family_code              in  ghr_pa_requests.noa_family_code%TYPE
46    ,p_object_version_number        in  ghr_pa_requests.object_version_number%TYPE
47    ,p_effective_date               in  date
48    )is
49   --
50   l_proc           varchar2(72) := g_package ||'chk_nature_of_action_id';
51   l_exists         boolean      := false;
52   l_api_updating   boolean;
53   l_effective_date date         := trunc(nvl(p_effective_date,sysdate));
54 
55   Cursor    cur_noa_id is
56     select  1
57     from    ghr_noa_families  noa
58     where   noa.nature_of_action_id = p_first_nature_of_action_id
59     and     noa.noa_family_code     = p_noa_family_code
60     and     l_effective_date
61     between nvl(noa.start_date_active,l_effective_date)
62     and     nvl(noa.end_date_active,l_effective_date)
63     and     noa.enabled_flag        = 'Y';
64 
65    begin
66     hr_utility.set_location('Entering:'|| l_proc, 10);
67 
68   --check mandatory arguments have been set
69     hr_api.mandatory_arg_error
70    (p_api_name       => l_proc,
71     p_argument       => 'noa_family_code',
72     p_argument_value => p_noa_family_code
73    );
74 
75     hr_utility.set_location(l_proc, 20);
76   --
77   --  Only proceed with validation if:
78   --  a) The current g_old_rec is current and
79   --  b) The nature_of_action_id has changed
80   --  c) a record is being inserted
81   --
82     l_api_updating := ghr_par_shd.api_updating
83       (p_pa_request_id         => p_pa_request_id
84       ,p_object_version_number => p_object_version_number
85       );
86     hr_utility.set_location(l_proc, 30);
87   --
88     if ((l_api_updating
89       and nvl(ghr_par_shd.g_old_rec.first_noa_id, hr_api.g_number)
90        <> nvl(p_first_nature_of_action_id,hr_api.g_number))
91     or
92        (NOT l_api_updating))
93     then
94       hr_utility.set_location(l_proc, 40);
95     --
96     -- Check if  first_nature_of_action_id is valid
97     --
98       If p_first_nature_of_action_id is not null then
99         for noa_id in cur_noa_id loop
100           l_exists := true;
101           exit;
102         end loop;
103 
104     -- to include logic to check if not valid as of the effective date
105        if not l_exists then
106          hr_utility.set_message(8301, 'GHR_38167_INV_NAT_OF_ACT_FAM');
107          hr_utility.raise_error;
108        end if;
109       end if;
110     end if;
111    --
112      hr_utility.set_location(' Leaving:'||l_proc, 20);
113   --
114    end chk_nature_of_action_id;
115 --
116 
117 -- ---------------------------------------------------------------------------
118 -- --------------------------- <chk_second_nature_of_action >------------------
119 -- ---------------------------------------------------------------------------
120 
121 -- To check that the second nature of action is valid for the specific first_nature_of_action_id
122 
123  procedure chk_second_nature_of_action_id
124    (p_first_nature_of_action_id    in  ghr_pa_requests.first_noa_id%TYPE
125    ,p_second_nature_of_action_id   in  ghr_pa_requests.first_noa_id%TYPE
126   , p_first_noa_code               in  ghr_pa_requests.first_noa_code%type
127    ,p_pa_request_id                in  ghr_pa_requests.pa_request_id%TYPE
128  --  ,p_noa_family_code              in  ghr_pa_requests.noa_family_code%TYPE
129    ,p_object_version_number        in  ghr_pa_requests.object_version_number%TYPE
130    ,p_effective_date               in  date
131    )is
132   --
133   l_proc           varchar2(72) := g_package ||'chk_second_nature_of_action_id';
134   l_exists         boolean      := false;
135   l_api_updating   boolean;
136   l_effective_date date         := trunc(nvl(p_effective_date,sysdate));
137 
138   Cursor    cur_sec_noa_id is
139     select  1
140     from    ghr_dual_actions  dua
141     where   dua.first_noa_id  = p_first_nature_of_action_id
142     and     dua.second_noa_id = p_second_nature_of_action_id;
143    -- and     l_effective_date
144    -- between nvl(noa.start_date_active,l_effective_date)
145    -- and     nvl(noa.end_date_active,l_effective_date)
146    -- and     noa.enabled_flag        = 'Y';
147 
148    begin
149     hr_utility.set_location('Entering:'|| l_proc, 10);
150 
151   /*--check mandatory arguments have been set
152    hr_api.mandatory_arg_error
153    (p_api_name       => l_proc,
154     p_argument       => 'noa_family_code',
155     p_argument_value => p_noa_family_code
156    );
157   */
158 
159     hr_utility.set_location(l_proc, 20);
160   --
161   --  Only proceed with validation if:
162   --  a) The current g_old_rec is current and
163   --  b) The nature_of_action_id has changed
164   --  c) a record is being inserted
165   --
166     l_api_updating := ghr_par_shd.api_updating
167       (p_pa_request_id         => p_pa_request_id
168       ,p_object_version_number => p_object_version_number
169       );
170     hr_utility.set_location(l_proc, 30);
171   --
172     if ((l_api_updating
173       and nvl(ghr_par_shd.g_old_rec.second_noa_id, hr_api.g_number)
174        <> nvl(p_second_nature_of_action_id,hr_api.g_number))
175     or
176        (NOT l_api_updating))
177     then
178       hr_utility.set_location(l_proc, 40);
179     --
180     -- Check if  second_nature_of_action_id is valid
181     --
182       If p_second_nature_of_action_id is not null then
183         If p_first_nature_of_action_id is null then
184           hr_utility.set_message(8301,'GHR_38273_FIRST_NOA_MUST');
185           hr_utility.raise_error;
186         Else
187           If p_first_noa_code not in ('001','002') then
188             for noa_id in cur_sec_noa_id loop
189               l_exists := true;
190               exit;
191             end loop;
192 
193             if not l_exists then
194               hr_utility.set_message(8301, 'GHR_38274_INVALID_DUAL_NOA');
195               hr_utility.raise_error;
196             end if;
197           End if;
198         End if;
199       end if;
200     end if;
201    --
202      hr_utility.set_location(' Leaving:'||l_proc, 20);
203   --
204    end chk_second_nature_of_action_id;
205 
206 
207 --  ---------------------------------------------------------------------------
208 -- |-----------------------------< chk_valid_person >---------------------------|
209 --  ---------------------------------------------------------------------------
210 --
211 -- Description:
212 --   Validates that the person_id exists in the table per_people_f,
213 --   as of the effective_date
214 --
215 -- Pre Conditions:
216 --
217 -- In Parameters:
218 --   p_person_id
219 --   p_effective_date
220 --
221 -- Post Success:
222 --   Processing continues.
223 --
224 -- Post Failure:
225 --   An application error is raised and the process is terminated
226 --
227 -- Access Status:
228 --   Internal Table Handler Use Only.
229 --
230 -- ---------------------------------------------------------------------------
231 function chk_valid_person_id
232   (p_val_person_id    in  ghr_pa_requests.requested_by_person_id%TYPE
233   ,p_effective_date   in  date
234   ) return char is
235   --
236   l_proc           varchar2(72) := g_package ||'chk_valid_person_id';
237   l_exists         boolean := false;
238 
239   --
240   cursor cur_per_id is
241     SELECT  1
242     FROM   per_all_people_f per
243     where  per.person_id = p_val_person_id;
244 
245   cursor cur_per_dt_id is
246     SELECT  1
247     FROM    per_all_people_f per
248     WHERE   per.person_id = p_val_person_id
249     AND     nvl(p_effective_date,sysdate)
250     BETWEEN per.effective_start_date and per.effective_end_date;
251   --
252 begin
253   hr_utility.set_location('Entering:'||l_proc, 10);
254   --
255   --Check if the person exists
256   --
257   for cur_person_id in cur_per_id loop
258     hr_utility.set_location(l_proc, 20);
259     l_exists := true;
260     exit;
261   end loop;
262   If l_exists then
263       l_exists := false;
264   -- check if person exists as of the effective date
265     for csr_person_id_rec in cur_per_dt_id loop
266       l_exists := true;
267       exit;
268     end loop;
269     hr_utility.set_location(l_proc, 50);
270     if not l_exists then
271        return('INV_PER_DT');
272     end if;
273   else
274     return('INV_PER');
275   end if;
276   return('X');
277   --
278   hr_utility.set_location(' Leaving:'||l_proc, 60);
279   --
280 end chk_valid_person_id;
281 --
282 --  ---------------------------------------------------------------------------
283 -- |-----------------------------< chk_additional_info_person_id >---------------------------|
284 --  ---------------------------------------------------------------------------
285 --
286 --  Desciption:
287 --    This procedures validates that the additional_info_person_id exists on the ghr_PERSON_F
288 --    table at a given effective_date
289 --
290 --  Pre-conditions :
291 --    None
292 --
293 --  In Parameters :
294 --   p_pa_request_id
295 --   p_additional_info_person_id
296 --   p_effective_date
297 --   p_object_version_number
298 --
299 --  Post Success :
300 --    Processing continues if the person id is valid
301 --
302 --  Post Failure :
303 --    An application error will be raised and processing is terminated if the
304 --    person id is invalid
305 --
306 --  Access Status :
307 --    Internal Row Handler Use only.
308 --
309 -- {End of Comments}
310 --
311 -- ---------------------------------------------------------------------------
312 
313 procedure chk_additional_info_person_id
314   (p_pa_request_id                  in ghr_pa_requests.pa_request_id%TYPE
315   ,p_object_version_number          in ghr_pa_requests.object_version_number%TYPE
316   ,p_additional_info_person_id         in ghr_pa_requests.additional_info_person_id%TYPE
317   ,p_effective_date                 in date) is
318 
319   l_exists         varchar2(15);
320   l_proc           varchar2(72)  := g_package ||'chk_additional_info_person_id';
321   l_api_updating   boolean;
322   --
323 begin
324   hr_utility.set_location('Entering:'|| l_proc, 10);
325   --
326   hr_utility.set_location(l_proc, 20);
327   --
328   --  Only proceed with validation if:
329   --  a) The current g_old_rec is current and
330   --  b) The additional_info_person_id value has changed
331   --  c) a record is being inserted
332   --
333   l_api_updating := ghr_par_shd.api_updating
334     (p_pa_request_id => p_pa_request_id
335     ,p_object_version_number => p_object_version_number
336     );
337   hr_utility.set_location(l_proc, 30);
338   --
339   if ((l_api_updating
340       and nvl(ghr_par_shd.g_old_rec.additional_info_person_id, hr_api.g_number)
341       <> nvl(p_additional_info_person_id,hr_api.g_number))
342     or
343       (NOT l_api_updating))
344   then
345     hr_utility.set_location(l_proc, 40);
346     --
347     -- Check if  additional_info_person_id is valid
348     --
349     If p_additional_info_person_id is not null then
350     --
351        l_exists := chk_valid_person_id(p_additional_info_person_id,p_effective_date);
352        if nvl(l_exists,'x') = 'INV_PER_DT' then
353          hr_utility.set_message(8301, 'GHR_38061_INV_ADD_INFO_PER_DT');
354          hr_utility.raise_error;
355        elsif nvl(l_exists,'x') = 'INV_PER' then
356          hr_utility.set_message(8301, 'GHR_38062_INV_ADD_INFO_PERSON');
357          hr_utility.raise_error;
358        end if;
359     end if;
360     hr_utility.set_location(l_proc, 50);
361     --
362   end if;
363   hr_utility.set_location(l_proc, 60);
364   --
365   hr_utility.set_location(' Leaving:'|| l_proc, 70);
366 end chk_additional_info_person_id;
367 
368 
369 
370 --  ---------------------------------------------------------------------------
371 -- |-----------------------------< chk_requested_by_person_id >---------------------------|
372 --  ---------------------------------------------------------------------------
373 --
374 --  Desciption:
375 --    This procedures validates that the requested_by_person_id exists on the ghr_PERSON_F
376 --    table at a given effective_date
377 --
378 --  Pre-conditions :
379 --    None
380 --
381 --  In Parameters :
382 --   p_pa_request_id
383 --   p_requested_by_person_id
384 --   p_effective_date
385 --   p_object_version_number
386 --
387 --  Post Success :
388 --    Processing continues if the person id is valid
389 --
390 --  Post Failure :
391 --    An application error will be raised and processing is terminated if the
392 --    person id is invalid
393 --
394 --  Access Status :
395 --    Internal Row Handler Use only.
396 --
397 -- {End of Comments}
398 --
399 -- ---------------------------------------------------------------------------
400 
404   ,p_requested_by_person_id         in ghr_pa_requests.requested_by_person_id%TYPE
401 procedure chk_requested_by_person_id
402   (p_pa_request_id                  in ghr_pa_requests.pa_request_id%TYPE
403   ,p_object_version_number          in ghr_pa_requests.object_version_number%TYPE
405   ,p_effective_date                 in date) is
406 
407   l_exists         varchar2(15);
408   l_proc           varchar2(72)  := g_package ||'chk_requested_by_person_id';
409   l_api_updating   boolean;
410   --
411 begin
412   hr_utility.set_location('Entering:'|| l_proc, 10);
413   --
414   hr_utility.set_location(l_proc, 20);
415   --
416   --  Only proceed with validation if:
417   --  a) The current g_old_rec is current and
418   --  b) The requested_by_person_id value has changed
419   --  c) a record is being inserted
420   --
421   l_api_updating := ghr_par_shd.api_updating
422     (p_pa_request_id => p_pa_request_id
423     ,p_object_version_number => p_object_version_number
424     );
425   hr_utility.set_location(l_proc, 30);
426   --
427   if ((l_api_updating
428       and nvl(ghr_par_shd.g_old_rec.requested_by_person_id, hr_api.g_number)
429       <> nvl(p_requested_by_person_id,hr_api.g_number))
430     or
431       (NOT l_api_updating))
432   then
433     hr_utility.set_location(l_proc, 40);
434     --
435     -- Check if  requested_by_person_id is valid
436     --
437     If p_requested_by_person_id is not null then
438     --
439        l_exists := chk_valid_person_id(p_requested_by_person_id,p_effective_date);
440        if nvl(l_exists,'x') = 'INV_PER_DT' then
441          hr_utility.set_message(8301, 'GHR_38063_INV_REQ_PERSON_DT');
442          hr_utility.raise_error;
443        elsif nvl(l_exists,'x') = 'INV_PER' then
444          hr_utility.set_message(8301, 'GHR_38064_INV_REQ_PERSON');
445          hr_utility.raise_error;
446        end if;
447 
448     end if;
449     hr_utility.set_location(l_proc, 50);
450     --
451     end if;
452     hr_utility.set_location(l_proc, 60);
453     --
454   hr_utility.set_location(' Leaving:'|| l_proc, 70);
455 end chk_requested_by_person_id;
456 
457 --  ---------------------------------------------------------------------------
458 -- |-----------------------------< chk_person_id >---------------------------|
459 --  ---------------------------------------------------------------------------
460 --
461 --  Desciption:
462 --    This procedures validates that the additional_info_person_id exists on the ghr_PERSON_F
463 --    table at a given effective_date
464 --
465 --  Pre-conditions :
466 --    None
467 --
468 --  In Parameters :
469 --   p_pa_request_id
470 --   p_person_id
471 --   p_effective_date
472 --   p_object_version_number
473 --
474 --  Post Success :
475 --    Processing continues if the person id is valid
476 --
477 --  Post Failure :
478 --    An application error will be raised and processing is terminated if the
479 --    person id is invalid
480 --
481 --  Access Status :
482 --    Internal Row Handler Use only.
483 --
484 -- {End of Comments}
485 --
486 -- ---------------------------------------------------------------------------
487 
488 procedure chk_person_id
489   (p_pa_request_id                  in ghr_pa_requests.pa_request_id%TYPE
490   ,p_noa_family_code                in ghr_pa_requests.noa_family_code%TYPE
491   ,p_object_version_number          in ghr_pa_requests.object_version_number%TYPE
492   ,p_person_id                      in ghr_pa_requests.person_id%TYPE
493   ,p_first_noa_cancel_or_correct in ghr_pa_requests.first_noa_cancel_or_correct%TYPE
494   ,p_effective_date                 in date) is
495 
496   l_exists         varchar2(15);
497   l_proc           varchar2(72)  :=  g_package ||'chk_person_id';
498   l_api_updating   boolean;
499   l_person_type    per_person_types.system_person_type%type := Null;
500   l_effective_start_date date := null;
501   --
502    cursor c_person_type_rec is
503     select ppf.effective_start_date,
504            ppt.system_person_type
505     from   per_all_people_f ppf,
506            per_person_types ppt
507     where  ppf.person_id = p_person_id
508     and    ppf.effective_start_date < nvl(p_effective_date,sysdate)
509     and    ppt.person_type_id       = ppf.person_type_id
510     order by 1 desc;
511 
512 begin
513   hr_utility.set_location('Entering:'|| l_proc, 10);
514   --
515     If p_person_id is not null then
516     --
517        l_exists := chk_valid_person_id(p_person_id,p_effective_date);
518        if nvl(l_exists,'x') = 'INV_PER_DT' then
519          hr_utility.set_message(8301, 'GHR_38059_INV_PERSON_DT');
520          hr_utility.raise_error;
521        elsif nvl(l_exists,'x') = 'INV_PER' then
522          hr_utility.set_message(8301, 'GHR_38060_INV_PERSON');
523          hr_utility.raise_error;
524        end if;
525           -- If conversion action and the person type is EX_EMP check to ensure that
526 
527        -- he has not been terminated more than 3 days since the effective_date
528      IF p_first_noa_cancel_or_correct not in (ghr_history_api.g_cancel,'CORRECT') THEN
529        If p_noa_family_code = 'CONV_APP' then
530          hr_utility.set_location('Conversion to app',1);
531          for person_type_rec in c_person_type_rec loop
535          end loop;
532            l_person_type := person_type_rec.system_person_type;
533            l_effective_start_date := person_type_rec.effective_start_date;
534            exit;
536          If nvl(l_person_type,hr_api.g_varchar2) = 'EX_EMP' then
537            hr_utility.set_location(' Ex Emp in Conv',1);
538            hr_utility.set_location('Termination date ' || l_effective_start_date,1);
539            if (nvl(p_effective_date,sysdate) - 3) >= (l_effective_start_date ) then
540               hr_utility.set_message(8301,'GHR_38645_EX_EMP_MORE_THAN_3');
541               hr_utility.raise_error;
542            end if;
543          End if;
544        End if;
545      END IF;
546 
547     end if;
548     hr_utility.set_location(l_proc, 50);
549     --
550   --end if;
551   hr_utility.set_location(l_proc, 60);
552   --
553   hr_utility.set_location(' Leaving:'|| l_proc, 70);
554 end chk_person_id;
555 
556 
557 --  ---------------------------------------------------------------------------
558 -- |-----------------------------< chk_authorized_by_person_id >---------------------------|
559 --  ---------------------------------------------------------------------------
560 --
561 --  Desciption:
562 --    This procedures validates that the authorized_by_person_id exists on the ghr_PERSON_F
563 --    table at a given effective_date
564 --
565 --  Pre-conditions :
566 --    None
567 --
568 --  In Parameters :
569 --   p_pa_request_id
570 --   p_authorized_by_person_id
571 --   p_effective_date
572 --   p_object_version_number
573 --
574 --  Post Success :
575 --    Processing continues if the person id is valid
576 --
577 --  Post Failure :
578 --    An application error will be raised and processing is terminated if the
579 --    person id is invalid
580 --
581 --  Access Status :
582 --    Internal Row Handler Use only.
583 --
584 -- {End of Comments}
585 --
586 -- ---------------------------------------------------------------------------
587 
588 procedure chk_authorized_by_person_id
589   (p_pa_request_id                  in ghr_pa_requests.pa_request_id%TYPE
590   ,p_object_version_number          in ghr_pa_requests.object_version_number%TYPE
591   ,p_authorized_by_person_id        in ghr_pa_requests.authorized_by_person_id%TYPE
592   ,p_effective_date                 in date) is
593 
594   l_exists         varchar2(15);
595   l_proc           varchar2(72)  := g_package ||'chk_authorized_by_person_id';
596   l_api_updating   boolean;
597   --
598 begin
599   hr_utility.set_location('Entering:'|| l_proc, 10);
600   --
601   -- Check mandatory parameters have been set
602   hr_utility.set_location(l_proc, 20);
603   --
604   --  Only proceed with validation if:
605   --  a) The current g_old_rec is current and
606   --  b) The authorized_by_person_id value has changed
607   --  c) a record is being inserted
608   --
609   l_api_updating := ghr_par_shd.api_updating
610     (p_pa_request_id => p_pa_request_id
611     ,p_object_version_number => p_object_version_number
612     );
613   hr_utility.set_location(l_proc, 30);
614   --
615   if ((l_api_updating
616       and nvl(ghr_par_shd.g_old_rec.authorized_by_person_id, hr_api.g_number)
617       <> nvl(p_authorized_by_person_id,hr_api.g_number))
618     or
619       (NOT l_api_updating))
620   then
621     hr_utility.set_location(l_proc, 40);
622     --
623     -- Check if  authorized_by_person_id is valid
624     --
625     If p_authorized_by_person_id is not null then
626     --
627        l_exists := chk_valid_person_id(p_authorized_by_person_id,p_effective_date);
628        if nvl(l_exists,'x') = 'INV_PER_DT' then
629          hr_utility.set_message(8301, 'GHR_38065_INV_AUTH_PERSON_DT');
630          hr_utility.raise_error;
631        elsif nvl(l_exists,'x') = 'INV_PER' then
632          hr_utility.set_message(8301, 'GHR_38066_INV_AUTH_PERSON');
633          hr_utility.raise_error;
634        end if;
635 
636     end if;
637     hr_utility.set_location(l_proc, 50);
638     --
639     end if;
640     hr_utility.set_location(l_proc, 60);
641     --
642   hr_utility.set_location(' Leaving:'|| l_proc, 70);
643 end chk_authorized_by_person_id;
644 
645 -- ----------------------------------------------------------------------------
646 -- |---------------------------< chk_employee_assignment>----------------------------|
647 -- ----------------------------------------------------------------------------
648 --
649 -- Description:
650 --   Validates that the employee_assignment_id exists in the table per_assignments_f,
651 --   as of the effective_date
652 --
653 -- Pre Conditions:
654 --
655 --
656 -- In Parameters:
657 --   p_pa_request_id
658 --   p_object_version_number
659 --   p_employee_assignment_id
660 --   p_effective_date
661 --
662 -- Post Success:
663 --   Processing continues.
664 --
665 -- Post Failure:
666 --   An application error is raised and the process is terminated
667 --
668 -- Access Status:
669 --   Internal Table Handler Use Only.
670 --
671 
672 procedure chk_employee_assignment_id
673   (p_pa_request_id              in  ghr_pa_requests.pa_request_id%TYPE
677    )	is
674   ,p_object_version_number      in ghr_pa_requests.object_version_number%TYPE
675   ,p_employee_assignment_id    in  ghr_pa_requests.employee_assignment_id%TYPE
676   ,p_effective_date  in  date
678   --
679   l_proc     varchar2(72) := g_package||'chk_employee_assignment_id';
680   l_exists   boolean   := false;
681   l_person_id per_all_people_f.person_id%type;
682   l_api_updating boolean;
683   l_effective_date  date;
684   l_st_date  date;
685   l_ed_date  date;
686   --
687   cursor cur_par_noa_code is
688    SELECT  first_noa_code,noa_family_code
689    FROM    ghr_pa_requests par
690    WHERE   par.pa_request_id = p_pa_request_id;
691 
692   cursor cur_asg_id is
693     SELECT   person_id
694     FROM     per_all_assignments_f asg
695     WHERE    asg.assignment_id = p_employee_assignment_id;
696 
697   cursor cur_asg_dt_id is
698     SELECT  1
699     FROM    per_all_assignments_f asg
700     WHERE   asg.assignment_id = p_employee_assignment_id
701     AND     nvl(p_effective_date,sysdate)
702     BETWEEN asg.effective_start_date and asg.effective_end_date;
703 --7015822
704 cursor cur_ex_emp(p_person_id in number) is
705     select ppf.effective_start_date,
706            ppt.system_person_type
707     from   per_all_people_f ppf,
708            per_person_types ppt
709     where  ppf.person_id = p_person_id
710     and    ppf.effective_start_date <= nvl(p_effective_date,sysdate)
711     and    ppt.person_type_id       = ppf.person_type_id
712     order by 1 desc;
713 --7015822
714  --
715 begin
716   hr_utility.set_location('Entering:'||l_proc, 10);
717   --
718   -- Check mandatory parameters have been set
719   --
720   --  Only proceed with validation if:
721   --  a) The current g_old_rec is current and
722   --  b) The assignment_id value has changed
723   --  c) a record is being inserted
724   --
725   l_api_updating := ghr_par_shd.api_updating
726     (p_pa_request_id => p_pa_request_id
727     ,p_object_version_number => p_object_version_number
728     );
729   hr_utility.set_location(l_proc, 20);
730   --
731   if ((l_api_updating
732       and nvl(ghr_par_shd.g_old_rec.employee_assignment_id,hr_api.g_number)
733       <> nvl(p_employee_assignment_id,hr_api.g_number))
734     or
735       (NOT l_api_updating))
736   then
737     hr_utility.set_location(l_proc, 30);
738     --
739     -- Check if  employee_assignment_id is valid
740     --
741     If p_employee_assignment_id is not null then
742      for  recasg in cur_asg_id loop
743        l_exists := true;
744        l_person_id := recasg.person_id;
745        exit;
746      end loop;
747   --
748      hr_utility.set_location(l_proc, 40);
749      if l_exists then
750         l_exists := false;
751          for par_noa_code_rec in cur_par_noa_code loop
752            if par_noa_code_rec.noa_family_code <> 'CONV_APP' then
753              l_exists := false;
754              for recasg in cur_asg_dt_id loop
755                l_exists := true;
756                exit;
757              end loop;
758 
759 	      --BUG 7015822- Added this condition to handle an appointment of an Ex-Employee
760 	      -- when it is saved to inbox by giving only date and opened again to give an employee
761 	      --details and saved to inbox again raising GHR_38067_INV_ASSIGNMENT_DT error
762              if (not l_exists) and
763 	        par_noa_code_rec.noa_family_code = 'APP' then
764 		for rec_cur_ex_emp in cur_ex_emp(p_person_id => l_person_id)
765 		loop
766 		  if  rec_cur_ex_emp.system_person_type = 'EX_EMP' then
767 		      l_exists := true;
768 		  end if;
769 		  exit;
770                 end loop;
771 	     end if;
772 		-- 7015822
773 
774              if not l_exists then
775                hr_utility.set_message(8301, 'GHR_38067_INV_ASSIGNMENT_DT');
776                hr_utility.raise_error;
777              end if;
778            end if;
779          end loop;
780      else
781        hr_utility.set_message(8301, 'GHR_38068_INV_ASSIGNMENT');
782        hr_utility.raise_error;
783      end if;
784    end if;
785  end if;
786  hr_utility.set_location(' Leaving:'||l_proc, 70);
787   --
788  end chk_employee_assignment_id;
789 
790 
791 
792 -- ----------------------------------------------------------------------------
793 -- |---------------------------< chk_from_position_id>----------------------------|
794 -- ----------------------------------------------------------------------------
795 --
796 -- Description:
797 --   Validates that the from_position_id exists in the table per_assignments_f,
798 --   as of the effective_date
799 --
800 -- Pre Conditions:
801 --
802 --
803 -- In Parameters:
804 --   p_pa_request_id
805 --   p_object_version_number
806 --   p_employee_assignment_id
807 --   p_from_position_id
808 --   p_effective_date
809 --
810 -- Post Success:
811 --   Processing continues.
812 --
813 -- Post Failure:
814 --   An application error is raised and the process is terminated
815 --
816 -- Access Status:
817 --   Internal Table Handler Use Only.
818 --
819 
820 procedure chk_from_position_id
824   ,p_from_position_id           in  ghr_pa_requests.from_position_id%type
821   (p_pa_request_id              in  ghr_pa_requests.pa_request_id%TYPE
822   ,p_object_version_number      in  ghr_pa_requests.object_version_number%TYPE
823   ,p_employee_assignment_id     in  ghr_pa_requests.employee_assignment_id%TYPE
825   ,p_effective_date  in  date
826    )	is
827   --
828   l_proc     varchar2(72) := g_package||'chk_from_position_id';
829   l_exists   boolean   := false;
830   l_api_updating boolean;
831   l_effective_date  date;
832   l_st_date  date;
833   l_ed_date  date;
834   --
835   cursor cur_pos_id is
836     SELECT   1
837     FROM     per_all_assignments_f asg
838     WHERE    asg.assignment_id  = p_employee_assignment_id
839     AND      asg.position_id    = p_from_position_id;
840  --
841 begin
842   hr_utility.set_location('Entering:'||l_proc, 10);
843   --
844   -- Check mandatory parameters have been set
845   --
846   --  Only proceed with validation if:
847   --  a) The current g_old_rec is current and
848   --  b) The assignment_id value has changed
849   --  c) a record is being inserted
850   --
851   l_api_updating := ghr_par_shd.api_updating
852     (p_pa_request_id => p_pa_request_id
853     ,p_object_version_number => p_object_version_number
854     );
855   hr_utility.set_location(l_proc, 20);
856   --
857   if ((l_api_updating
858       and nvl(ghr_par_shd.g_old_rec.from_position_id,hr_api.g_number)
859       <> nvl(p_from_position_id,hr_api.g_number))
860     or
861       (NOT l_api_updating))
862   then
863     hr_utility.set_location(l_proc, 30);
864     --
865     -- Check if from_position_id is valid
866     --
867     If p_from_position_id is not null then
868      for  recpos in cur_pos_id loop
869        l_exists := true;
870        exit;
871      end loop;
872   --
873      if not l_exists then
874        hr_utility.set_message(8301, 'GHR_38056_INV_FROM_POSITION');
875        hr_utility.raise_error;
876      end if;
877    end if;
878  end if;
879  hr_utility.set_location(' Leaving:'||l_proc, 70);
880   --
881  end chk_from_position_id;
882 --
883 --
884 -- ----------------------------------------------------------------------------
885 -- |---------------------------< chk_first_action_la_code1>----------------------------|
886 -- ----------------------------------------------------------------------------
887 --
888 procedure chk_first_action_la_code1
889   (p_pa_request_id              in  ghr_pa_requests.pa_request_id%TYPE
890   ,p_object_version_number      in  ghr_pa_requests.object_version_number%TYPE
891   ,p_first_action_la_code1      in  ghr_pa_requests.first_action_la_code1%TYPE
892   ,p_first_nature_of_action_id  in  ghr_pa_requests.first_noa_id%TYPE
893   ,p_effective_date             in  date
894    )is
895   --
896   l_proc         varchar2(72) := g_package||'chk_first_action_la_code1';
897   l_exists       boolean   := false;
898   l_api_updating boolean;
899  --Bug# 7501214. added the SUBSTR condition for lac_lookup_code to avoid the error
900  -- while checking the LAC codes which are duplicated. Like VWN and VWN1 etc.
901 
902   cursor c_la_code is
903     select  hl.lookup_code ,
904             hl.meaning
905     from    hr_lookups hl ,
906             ghr_noac_las       nla
907     where   nla.nature_of_action_id  = p_first_nature_of_action_id
908     and     SUBSTR(nla.lac_lookup_code,1,3)      = p_first_action_la_code1
909     and     nla.valid_first_lac_flag = 'Y'
910     and     hl.lookup_type           = 'GHR_US_LEGAL_AUTHORITY'
911     and     hl.lookup_code           = nla.lac_lookup_code
912     and     hl.enabled_flag          = 'Y'
913     and     nvl(p_effective_date,trunc(sysdate))
914     between nvl(hl.start_date_active,nvl(p_effective_date,trunc(sysdate)))
915     and     nvl(hl.end_date_active,nvl(p_effective_date,trunc(sysdate)));
916 
917 begin
918   hr_utility.set_location('Entering:'||l_proc, 10);
919   --
920   -- Check mandatory parameters have been set
921   --
922  /* --  Only proceed with validation if:
923   --  a) The current g_old_rec is current and
924   --  b) The first_action_la_code1 value has changed
925   --  c) a record is being inserted
926   --
927   l_api_updating := ghr_par_shd.api_updating
928     (p_pa_request_id => p_pa_request_id
929     ,p_object_version_number => p_object_version_number
930     );
931   hr_utility.set_location(l_proc, 20);
932   --
933   if ((l_api_updating
934       and nvl(ghr_par_shd.g_old_rec.first_action_la_code1,hr_api.g_varchar2)
935       <> nvl(p_first_action_la_code1,hr_api.g_varchar2))
936     or
937       (NOT l_api_updating))
938   then
939 
940     hr_utility.set_location(l_proc, 30);
941     --
942 */
943     -- Check if  first_action_la_code1 is valid
944     --
945     If p_first_action_la_code1 is not null then
946       for la_code  in c_la_code loop
947         l_exists := true;
948         exit;
949       end loop;
950   --
951       hr_utility.set_location(l_proc, 40);
952       if not l_exists then
953         hr_utility.set_message(8301, 'GHR_38105_INV_FIRST_LA_CODE1');
954         hr_utility.raise_error;
955       end if;
956     end if;
957  -- end if;
958  hr_utility.set_location(' Leaving:'||l_proc, 70);
962 -- ----------------------------------------------------------------------------
959   --
960  end chk_first_action_la_code1;
961 --
963 -- |---------------------------< chk_first_action_la_code2>----------------------------|
964 -- ----------------------------------------------------------------------------
965 --
966 procedure chk_first_action_la_code2
967   (p_pa_request_id              in  ghr_pa_requests.pa_request_id%TYPE
968   ,p_object_version_number      in  ghr_pa_requests.object_version_number%TYPE
969   ,p_first_action_la_code2      in  ghr_pa_requests.first_action_la_code2%TYPE
970   ,p_first_nature_of_action_id  in  ghr_pa_requests.first_noa_id%TYPE
971   ,p_effective_date             in  date
972    )is
973   --
974   l_proc         varchar2(72) := g_package||'chk_first_action_la_code2';
975   l_exists       boolean   := false;
976   l_api_updating boolean;
977  --Bug# 7501214. added the SUBSTR condition for lac_lookup_code to avoid the error
978  -- while checking the LAC codes which are duplicated. Like VWN and VWN1 etc.
979   cursor c_la_code is
980     select  hl.lookup_code ,
981             hl.meaning
982     from    hr_lookups hl,
983             ghr_noac_las       nla
984     where   nla.nature_of_action_id = p_first_nature_of_action_id
985     and     SUBSTR(nla.lac_lookup_code,1,3)     = p_first_action_la_code2
986     and     nla.valid_second_lac_flag = 'Y'
987     and     hl.lookup_type          = 'GHR_US_LEGAL_AUTHORITY'
988     and     hl.lookup_code          = nla.lac_lookup_code
989     and     hl.enabled_flag         = 'Y'
990     and     nvl(p_effective_date,trunc(sysdate))
991     between nvl(hl.start_date_active,nvl(p_effective_date,trunc(sysdate)))
992     and     nvl(hl.end_date_active,nvl(p_effective_date,trunc(sysdate)));
993 
994 begin
995   hr_utility.set_location('Entering:'||l_proc, 10);
996   --
997   -- Check mandatory parameters have been set
998   --
999 /*
1000   --  Only proceed with validation if:
1001   --  a) The current g_old_rec is current and
1002   --  b) The first_action_la_code2 value has changed
1003   --  c) a record is being inserted
1004   --
1005   l_api_updating := ghr_par_shd.api_updating
1006     (p_pa_request_id => p_pa_request_id
1007     ,p_object_version_number => p_object_version_number
1008     );
1009   hr_utility.set_location(l_proc, 20);
1010   --
1011   if ((l_api_updating
1012       and nvl(ghr_par_shd.g_old_rec.first_action_la_code2,hr_api.g_varchar2)
1013       <> nvl(p_first_action_la_code2,hr_api.g_varchar2))
1014     or
1015       (NOT l_api_updating))
1016   then
1017     hr_utility.set_location(l_proc, 30);
1018 */
1019     --
1020     -- Check if  first_action_la_code2 is valid
1021     --
1022     If p_first_action_la_code2 is not null then
1023       for la_code  in c_la_code loop
1024         l_exists := true;
1025         exit;
1026       end loop;
1027   --
1028       hr_utility.set_location(l_proc, 40);
1029       if not l_exists then
1030         hr_utility.set_message(8301, 'GHR_38106_INV_FIRST_LA_CODE2');
1031         hr_utility.raise_error;
1032       end if;
1033     end if;
1034  -- end if;
1035  hr_utility.set_location(' Leaving:'||l_proc, 70);
1036   --
1037  end chk_first_action_la_code2;
1038 --
1039 
1040 -- ----------------------------------------------------------------------------
1041 -- |---------------------------< chk_duty_station_id>----------------------------|
1042 -- ----------------------------------------------------------------------------
1043 --
1044 -- Description:
1045 --   Validates that the duty_station_id exists in the table per_duty_stations_f,
1046 --   as of the effective_date
1047 --
1048 -- Pre Conditions:
1049 --
1050 --
1051 -- In Parameters:
1052 --   p_pa_request_id
1053 --   p_object_version_number
1054 --   p_duty_station_id
1055 --   p_effective_date
1056 --
1057 -- Post Success:
1058 --   Processing continues.
1059 --
1060 -- Post Failure:
1061 --   An application error is raised and the process is terminated
1062 --
1063 -- Access Status:
1064 --   Internal Table Handler Use Only.
1065 --
1066 
1067  procedure chk_duty_station_id
1068   (p_pa_request_id              in  ghr_pa_requests.pa_request_id%TYPE
1069   ,p_object_version_number      in  ghr_pa_requests.object_version_number%TYPE
1070   ,p_duty_station_id            in  ghr_pa_requests.duty_station_id%TYPE
1071   ,p_effective_date  in  date
1072    )	is
1073   --
1074   l_proc     varchar2(72) := g_package||'chk_duty_station_id';
1075   l_exists   boolean   := false;
1076   l_api_updating boolean;
1077   l_effective_date  date;
1078   l_st_date  date;
1079   l_ed_date  date;
1080   --
1081 
1082   cursor cur_duty_station_id is
1083     SELECT   1
1084     FROM     ghr_duty_stations_f dsf
1085     WHERE    dsf.duty_station_id = p_duty_station_id;
1086 
1087   cursor cur_duty_station_id_dt is
1088     SELECT  1
1089     FROM    ghr_duty_stations_f dsf
1090     WHERE   dsf.duty_station_id = p_duty_station_id
1091     AND     nvl(p_effective_date,sysdate)
1092    BETWEEN dsf.effective_start_date and dsf.effective_end_date;
1093  --
1094 begin
1095   hr_utility.set_location('Entering:'||l_proc, 10);
1096   --
1097   -- Check mandatory parameters have been set
1098   --
1099   --  Only proceed with validation if:
1103   --
1100   --  a) The current g_old_rec is current and
1101   --  b) The assignment_id value has changed
1102   --  c) a record is being inserted
1104   l_api_updating := ghr_par_shd.api_updating
1105     (p_pa_request_id => p_pa_request_id
1106     ,p_object_version_number => p_object_version_number
1107     );
1108   hr_utility.set_location(l_proc, 20);
1109   --
1110   --
1111    If p_duty_station_id is not null then
1112     for  recasg in cur_duty_station_id loop
1113        l_exists := true;
1114        exit;
1115      end loop;
1116   --
1117      hr_utility.set_location(l_proc, 40);
1118      if l_exists then
1119        l_exists := false;
1120        for recasg in cur_duty_station_id_dt loop
1121          l_exists := true;
1122          exit;
1123        end loop;
1124        if not l_exists then
1125          hr_utility.set_message(8301, 'GHR_38646_INV_DUTY_STN_DT');
1126          hr_utility.raise_error;
1127        end if;
1128     else
1129        hr_utility.set_message(8301, 'GHR_38647_INV_DUTY_STN');
1130        hr_utility.raise_error;
1131      end if;
1132    end if;
1133    hr_utility.set_location(' Leaving:'||l_proc, 70);
1134   --
1135  end chk_duty_station_id;
1136 
1137 --
1138 
1139 ----------------------------------------------------------------------------
1140 -- |---------------------------< chk_second_action_la_code1>----------------------------|
1141 -- ----------------------------------------------------------------------------
1142 --
1143 procedure chk_second_action_la_code1
1144   (p_pa_request_id              in  ghr_pa_requests.pa_request_id%TYPE
1145   ,p_object_version_number      in  ghr_pa_requests.object_version_number%TYPE
1146   ,p_second_action_la_code1     in  ghr_pa_requests.second_action_la_code1%TYPE
1147   ,p_second_nature_of_action_id in  ghr_pa_requests.second_noa_id%TYPE
1148   ,p_effective_date             in  date
1149    )is
1150   --
1151   l_proc         varchar2(72) := g_package||'chk_second_action_la_code1';
1152   l_exists       boolean   := false;
1153   l_api_updating boolean;
1154  --Bug# 7501214. added the SUBSTR condition for lac_lookup_code to avoid the error
1155  -- while checking the LAC codes which are duplicated. Like VWN and VWN1 etc.
1156   cursor c_la_code is
1157     select  hl.lookup_code ,
1158             hl.meaning
1159     from    hr_lookups hl ,
1160             ghr_noac_las       nla
1161     where   nla.nature_of_action_id  = p_second_nature_of_action_id
1162     and     SUBSTR(nla.lac_lookup_code,1,3)      = p_second_action_la_code1
1163     and     nla.valid_first_lac_flag = 'Y'
1164     and     hl.lookup_type           = 'GHR_US_LEGAL_AUTHORITY'
1165     and     hl.lookup_code           = nla.lac_lookup_code
1166     and     hl.enabled_flag          = 'Y'
1167     and     nvl(p_effective_date,trunc(sysdate))
1168     between nvl(hl.start_date_active,nvl(p_effective_date,trunc(sysdate)))
1169     and     nvl(hl.end_date_active,nvl(p_effective_date,trunc(sysdate)));
1170 
1171 begin
1172   hr_utility.set_location('Entering:'||l_proc, 10);
1173   --
1174   -- Check mandatory parameters have been set
1175   /*
1176 --
1177   --  Only proceed with validation if:
1178   --  a) The current g_old_rec is current and
1179   --  b) The second_action_la_code1 value has changed
1180   --  c) a record is being inserted
1181   --
1182   l_api_updating := ghr_par_shd.api_updating
1183     (p_pa_request_id => p_pa_request_id
1184     ,p_object_version_number => p_object_version_number
1185     );
1186   hr_utility.set_location(l_proc, 20);
1187   --
1188   if ((l_api_updating
1189       and nvl(ghr_par_shd.g_old_rec.second_action_la_code1,hr_api.g_varchar2)
1190       <> nvl(p_second_action_la_code1,hr_api.g_varchar2))
1191     or
1192       (NOT l_api_updating))
1193   then
1194     hr_utility.set_location(l_proc, 30);
1195 */
1196     --
1197     -- Check if  second_action_la_code1 is valid
1198     --
1199     If p_second_action_la_code1 is not null then
1200       for la_code  in c_la_code loop
1201         l_exists := true;
1202         exit;
1203       end loop;
1204   --
1205       hr_utility.set_location(l_proc, 40);
1206       if not l_exists then
1207         hr_utility.set_message(8301, 'GHR_38107_INV_SECOND_LA_CODE1');
1208         hr_utility.raise_error;
1209       end if;
1210     end if;
1211  -- end if;
1212  hr_utility.set_location(' Leaving:'||l_proc, 70);
1213   --
1214  end chk_second_action_la_code1;
1215 --
1216 -- ----------------------------------------------------------------------------
1217 -- |---------------------------< chk_second_action_la_code2>----------------------------|
1218 -- ----------------------------------------------------------------------------
1219 --
1220 procedure chk_second_action_la_code2
1221   (p_pa_request_id              in  ghr_pa_requests.pa_request_id%TYPE
1222   ,p_object_version_number      in  ghr_pa_requests.object_version_number%TYPE
1223   ,p_second_action_la_code2     in  ghr_pa_requests.second_action_la_code2%TYPE
1224   ,p_second_nature_of_action_id in  ghr_pa_requests.second_noa_id%TYPE
1225   ,p_effective_date             in  date
1226    )is
1227   --
1228   l_proc         varchar2(72) := g_package||'chk_second_action_la_code2';
1229   l_exists       boolean   := false;
1230   l_api_updating boolean;
1231  --Bug# 7501214. added the SUBSTR condition for lac_lookup_code to avoid the error
1235             hl.meaning
1232  -- while checking the LAC codes which are duplicated. Like VWN and VWN1 etc.
1233   cursor c_la_code is
1234     select  hl.lookup_code ,
1236     from    hr_lookups hl ,
1237             ghr_noac_las       nla
1238     where   nla.nature_of_action_id   = p_second_nature_of_action_id
1239     and     substr(nla.lac_lookup_code,1,3)       = p_second_action_la_code2
1240     and     nla.valid_second_lac_flag = 'Y'
1241     and     hl.lookup_type            = 'GHR_US_LEGAL_AUTHORITY'
1242     and     hl.lookup_code            = nla.lac_lookup_code
1243     and     hl.enabled_flag           = 'Y'
1244     and     nvl(p_effective_date,trunc(sysdate))
1245     between nvl(hl.start_date_active,nvl(p_effective_date,trunc(sysdate)))
1246     and     nvl(hl.end_date_active,nvl(p_effective_date,trunc(sysdate)));
1247 
1248 begin
1249   hr_utility.set_location('Entering:'||l_proc, 10);
1250   --
1251   -- Check mandatory parameters have been set
1252   --
1253 /*
1254   --  Only proceed with validation if:
1255   --  a) The current g_old_rec is current and
1256   --  b) The second_action_la_code2 value has changed
1257   --  c) a record is being inserted
1258   --
1259   l_api_updating := ghr_par_shd.api_updating
1260     (p_pa_request_id => p_pa_request_id
1261     ,p_object_version_number => p_object_version_number
1262     );
1263   hr_utility.set_location(l_proc, 20);
1264   --
1265   if ((l_api_updating
1266       and nvl(ghr_par_shd.g_old_rec.second_action_la_code2,hr_api.g_varchar2)
1267       <> nvl(p_second_action_la_code2,hr_api.g_varchar2))
1268     or
1269       (NOT l_api_updating))
1270   then
1271     hr_utility.set_location(l_proc, 30);
1272     --
1273 */
1274     -- Check if  second_action_la_code2 is valid
1275     --
1276     If p_second_action_la_code2 is not null then
1277       for la_code  in c_la_code loop
1278         l_exists := true;
1279         exit;
1280       end loop;
1281   --
1282       hr_utility.set_location(l_proc, 40);
1283       if not l_exists then
1284         hr_utility.set_message(8301, 'GHR_38108_INV_SECOND_LA_CODE2');
1285         hr_utility.raise_error;
1286       end if;
1287     end if;
1288  -- end if;
1289  hr_utility.set_location(' Leaving:'||l_proc, 70);
1290   --
1291  end chk_second_action_la_code2;
1292 --
1293 
1294 -- ----------------------------------------------------------------------------
1295 -- |---------------------------< insert_validate >----------------------------|
1296 -- ----------------------------------------------------------------------------
1297 Procedure insert_validate(p_rec in ghr_par_shd.g_rec_type) is
1298 --
1299   l_proc  varchar2(72) := g_package||'insert_validate';
1300 --
1301 Begin
1302   hr_utility.set_location('Entering:'||l_proc, 5);
1303   --
1304   -- Call all supporting  operations
1305 
1306   -- Check that the routing_group is not null
1307 
1308 /*  hr_api.mandatory_arg_error
1309     (p_api_name       => l_proc,
1310      p_argument       => 'routing_group_id',
1311      p_argument_value => p_rec.routing_group_id); */
1312 
1313 -- Check that the Noa_Family Code is not null
1314     hr_api.mandatory_arg_error
1315     (p_api_name       => l_proc,
1316      p_argument       => 'Noa Family Code',
1317      p_argument_value => p_rec.noa_family_code);
1318 
1319    --  check person_id
1320   --
1321          hr_utility.set_location('chk person id' ,1);
1322           chk_person_id(p_pa_request_id             => p_rec.pa_request_id,
1323                      p_object_version_number     => p_rec.object_version_number,
1324                      p_noa_family_code           => p_rec.noa_family_code,
1325                      p_person_id                 => p_rec.person_id,
1326                      p_first_noa_cancel_or_correct  => p_rec.first_noa_cancel_or_correct,
1327                      p_effective_date            => p_rec.effective_date
1328                                     );
1329 
1330   --  check additional_info_person_id
1331   --
1332        chk_additional_info_person_id(p_pa_request_id             => p_rec.pa_request_id,
1333                                      p_object_version_number     => p_rec.object_version_number,
1334                                      p_additional_info_person_id => p_rec.additional_info_person_id,
1335                                      p_effective_date            => p_rec.effective_date
1336                                     );
1337 
1338 
1339   --  check requested_by_person_id
1340   --
1341         chk_requested_by_person_id(p_pa_request_id => p_rec.pa_request_id,
1342                                      p_object_version_number =>p_rec.object_version_number,
1343                                      p_requested_by_person_id =>p_rec.requested_by_person_id,
1344                                      p_effective_date            =>p_rec.effective_date
1345                                    );
1346 
1347   --  check authorized_by_person_id
1348   --
1349 
1350         chk_authorized_by_person_id(p_pa_request_id => p_rec.pa_request_id,
1351                                      p_object_version_number =>p_rec.object_version_number,
1352                                      p_authorized_by_person_id => p_rec.authorized_by_person_id,
1353                                      p_effective_date            =>p_rec.effective_date
1354                                     );
1355 
1356  --  check employee_assignment_id
1357  --
1361                                   p_effective_date         => p_rec.effective_date
1358        chk_employee_assignment_id(p_pa_request_id          => p_rec.pa_request_id,
1359                                   p_object_version_number  => p_rec.object_version_number,
1360                                   p_employee_assignment_id => p_rec.employee_assignment_id,
1362                                  );
1363 
1364  -- check from_position_id
1365  --
1366      If p_rec.noa_family_code <> 'CONV_APP' and p_rec.noa_family_code <> 'CANCEL'
1367        and p_rec.noa_family_code <> 'CORRECT' then
1368         chk_from_position_id(p_pa_request_id          => p_rec.pa_request_id,
1369                              p_object_version_number  => p_rec.object_version_number,
1370                              p_employee_assignment_id => p_rec.employee_assignment_id,
1371                              p_from_position_id       => p_rec.from_position_id,
1372                              p_effective_date         => p_rec.effective_date
1373                             );
1374           End if;
1375 
1376   -- check nature_of_action_id
1377 
1378        chk_nature_of_action_id
1379       (p_first_nature_of_action_id   => p_rec.first_noa_id
1380       ,p_pa_request_id               => p_rec.pa_request_id
1381       ,p_noa_family_code             => p_rec.noa_family_code
1382       ,p_object_version_number       => p_rec.object_version_number
1383       ,p_effective_date              => p_rec.effective_date
1384       );
1385 
1386   -- check second_nature_of_action_id
1387 
1388       chk_second_nature_of_action_id
1389       (p_first_nature_of_action_id   => p_rec.first_noa_id
1390       ,p_second_nature_of_action_id  => p_rec.second_noa_id
1391      , p_first_noa_code              => p_rec.first_noa_code
1392       ,p_pa_request_id               => p_rec.pa_request_id
1393       ,p_object_version_number       => p_rec.object_version_number
1394       ,p_effective_date              => p_rec.effective_date
1395       );
1396 
1397   -- check first_action_la_code1
1398 
1399      chk_first_action_la_code1
1400     (p_pa_request_id                => p_rec.pa_request_id
1401     ,p_object_version_number        => p_rec.object_version_number
1402     ,p_first_action_la_code1        => p_rec.first_action_la_code1
1403     ,p_first_nature_of_action_id    => p_rec.first_noa_id
1404     ,p_effective_date               => p_rec.effective_date
1405     );
1406 
1407   -- check first_action_la_code2
1408 
1409      chk_first_action_la_code2
1410     (p_pa_request_id                => p_rec.pa_request_id
1411     ,p_object_version_number        => p_rec.object_version_number
1412     ,p_first_action_la_code2        => p_rec.first_action_la_code2
1413     ,p_first_nature_of_action_id    => p_rec.first_noa_id
1414     ,p_effective_date               => p_rec.effective_date
1415     );
1416 
1417  -- check second_action_la_code1
1418     chk_second_action_la_code1
1419     (p_pa_request_id                => p_rec.pa_request_id
1420     ,p_object_version_number        => p_rec.object_version_number
1421     ,p_second_action_la_code1       => p_rec.second_action_la_code1
1422     ,p_second_nature_of_action_id   => p_rec.second_noa_id
1423     ,p_effective_date               => p_rec.effective_date
1424     );
1425 
1426 
1427  -- check second_action_la_code2
1428 
1429      chk_second_action_la_code2
1430     (p_pa_request_id                => p_rec.pa_request_id
1431     ,p_object_version_number        => p_rec.object_version_number
1432     ,p_second_action_la_code2       => p_rec.second_action_la_code2
1433     ,p_second_nature_of_action_id   => p_rec.second_noa_id
1434     ,p_effective_date               => p_rec.effective_date
1435     );
1436 
1437  --  check duty_station_id
1438  --
1439        chk_duty_station_id(p_pa_request_id          => p_rec.pa_request_id,
1440                            p_object_version_number  => p_rec.object_version_number,
1441                            p_duty_station_id        => p_rec.duty_station_id,
1442                            p_effective_date         => p_rec.effective_date
1443                           );
1444 
1445 
1446   -- Call hr_dflex_utility.ins_or_upd_descflex_attribs procedure to validate Descritive Flex Fields
1447 
1448   hr_dflex_utility.ins_or_upd_descflex_attribs
1449       (p_appl_short_name    => 'GHR'
1450       ,p_descflex_name      => 'GHR_PA_REQUESTS'
1451       ,p_attribute_category => p_rec.attribute_category
1452       ,p_attribute1_name    => 'ATTRIBUTE1'
1453       ,p_attribute1_value   => p_rec.ATTRIBUTE1
1454       ,p_attribute2_name    => 'ATTRIBUTE2'
1455       ,p_attribute2_value   => p_rec.ATTRIBUTE2
1456       ,p_attribute3_name    => 'ATTRIBUTE3'
1457       ,p_attribute3_value   => p_rec.ATTRIBUTE3
1458       ,p_attribute4_name    => 'ATTRIBUTE4'
1459       ,p_attribute4_value   => p_rec.ATTRIBUTE4
1460       ,p_attribute5_name    => 'ATTRIBUTE5'
1461       ,p_attribute5_value   => p_rec.ATTRIBUTE5
1462       ,p_attribute6_name    => 'ATTRIBUTE6'
1463       ,p_attribute6_value   => p_rec.ATTRIBUTE6
1464       ,p_attribute7_name    => 'ATTRIBUTE7'
1465       ,p_attribute7_value   => p_rec.ATTRIBUTE7
1466       ,p_attribute8_name    => 'ATTRIBUTE8'
1467       ,p_attribute8_value   => p_rec.ATTRIBUTE8
1468       ,p_attribute9_name    => 'ATTRIBUTE9'
1469       ,p_attribute9_value   => p_rec.ATTRIBUTE9
1470       ,p_attribute10_name    => 'ATTRIBUTE10'
1471       ,p_attribute10_value   => p_rec.ATTRIBUTE10
1472       ,p_attribute11_name    => 'ATTRIBUTE11'
1476       ,p_attribute13_name    => 'ATTRIBUTE13'
1473       ,p_attribute11_value   => p_rec.ATTRIBUTE11
1474       ,p_attribute12_name    => 'ATTRIBUTE12'
1475       ,p_attribute12_value   => p_rec.ATTRIBUTE12
1477       ,p_attribute13_value   => p_rec.ATTRIBUTE13
1478       ,p_attribute14_name    => 'ATTRIBUTE14'
1479       ,p_attribute14_value   => p_rec.ATTRIBUTE14
1480       ,p_attribute15_name    => 'ATTRIBUTE15'
1481       ,p_attribute15_value   => p_rec.ATTRIBUTE15
1482       ,p_attribute16_name    => 'ATTRIBUTE16'
1483       ,p_attribute16_value   => p_rec.ATTRIBUTE16
1484       ,p_attribute17_name    => 'ATTRIBUTE17'
1485       ,p_attribute17_value   => p_rec.ATTRIBUTE17
1486       ,p_attribute18_name    => 'ATTRIBUTE18'
1487       ,p_attribute18_value   => p_rec.ATTRIBUTE18
1488       ,p_attribute19_name    => 'ATTRIBUTE19'
1489       ,p_attribute19_value   => p_rec.ATTRIBUTE19
1490       ,p_attribute20_name    => 'ATTRIBUTE20'
1491       ,p_attribute20_value   => p_rec.ATTRIBUTE20
1492       );
1493   --
1494   hr_utility.set_location(' Leaving:'||l_proc, 10);
1495 End insert_validate;
1496 -- ----------------------------------------------------------------------------
1497 -- |---------------------------< update_validate >----------------------------|
1498 -- ----------------------------------------------------------------------------
1499 Procedure update_validate(p_rec in ghr_par_shd.g_rec_type) is
1500 --
1501   l_proc  varchar2(72) := g_package||'update_validate';
1502 --
1503 Begin
1504   hr_utility.set_location('Entering:'||l_proc, 5);
1505   --
1506   -- Call all supporting business operations
1507   --
1508   --
1509   -- Check that the Noa_Family Code is not null
1510     hr_api.mandatory_arg_error
1511     (p_api_name       => l_proc,
1512      p_argument       => 'Noa Family Code',
1513      p_argument_value => p_rec.noa_family_code);
1514 
1515   -- --  check person_id
1516   --
1517 
1518         chk_person_id(p_pa_request_id             => p_rec.pa_request_id,
1519                      p_object_version_number     => p_rec.object_version_number,
1520                      p_noa_family_code           => p_rec.noa_family_code,
1521                      p_person_id                 => p_rec.person_id,
1522                      p_first_noa_cancel_or_correct  => p_rec.first_noa_cancel_or_correct,
1523                      p_effective_date            => p_rec.effective_date
1524                                     );
1525 
1526 
1527   --  check additional_info_person_id
1528   --
1529        chk_additional_info_person_id(p_pa_request_id             => p_rec.pa_request_id,
1530                                      p_object_version_number     => p_rec.object_version_number,
1531                                      p_additional_info_person_id => p_rec.additional_info_person_id,
1532                                      p_effective_date            => p_rec.effective_date
1533                                     );
1534 
1535 
1536   --  check requested_by_person_id
1537   --
1538         chk_requested_by_person_id(p_pa_request_id => p_rec.pa_request_id,
1539                                      p_object_version_number =>p_rec.object_version_number,
1540                                      p_requested_by_person_id =>p_rec.requested_by_person_id,
1541                                      p_effective_date            =>p_rec.effective_date
1542                                    );
1543 
1544   --  check authorized_by_person_id
1545   --
1546 
1547         chk_authorized_by_person_id(p_pa_request_id => p_rec.pa_request_id,
1548                                      p_object_version_number =>p_rec.object_version_number,
1549                                      p_authorized_by_person_id => p_rec.authorized_by_person_id,
1550                                      p_effective_date            =>p_rec.effective_date
1551                                     );
1552 
1553  --  check employee_assignment_id
1554  --
1555        chk_employee_assignment_id(p_pa_request_id          => p_rec.pa_request_id,
1556                                   p_object_version_number  => p_rec.object_version_number,
1557                                   p_employee_assignment_id => p_rec.employee_assignment_id,
1558                                   p_effective_date         => p_rec.effective_date
1559                                  );
1560 
1561  -- check from_position_id
1562  --
1563       If p_rec.noa_family_code <> 'CONV_APP' and p_rec.noa_family_code <> 'CANCEL'
1564        and p_rec.noa_family_code <> 'CORRECT' then
1565         chk_from_position_id(p_pa_request_id          => p_rec.pa_request_id,
1566                              p_object_version_number  => p_rec.object_version_number,
1567                              p_employee_assignment_id => p_rec.employee_assignment_id,
1568                              p_from_position_id       => p_rec.from_position_id,
1569                              p_effective_date         => p_rec.effective_date
1570                              );
1571       End if;
1572 
1573   -- check nature_of_action_id
1574 
1575        chk_nature_of_action_id
1576       (p_first_nature_of_action_id   => p_rec.first_noa_id
1577       ,p_pa_request_id               => p_rec.pa_request_id
1578       ,p_noa_family_code             => p_rec.noa_family_code
1579       ,p_object_version_number       => p_rec.object_version_number
1580       ,p_effective_date              => p_rec.effective_date
1581       );
1582 
1583   -- check second_nature_of_action_id
1584 
1585       chk_second_nature_of_action_id
1586       (p_first_nature_of_action_id   => p_rec.first_noa_id
1590       ,p_object_version_number       => p_rec.object_version_number
1587       ,p_second_nature_of_action_id  => p_rec.second_noa_id
1588      , p_first_noa_code              => p_rec.first_noa_code
1589       ,p_pa_request_id               => p_rec.pa_request_id
1591       ,p_effective_date              => p_rec.effective_date
1592       );
1593 
1594 
1595   -- check first_action_la_code1
1596 
1597      chk_first_action_la_code1
1598     (p_pa_request_id                => p_rec.pa_request_id
1599     ,p_object_version_number        => p_rec.object_version_number
1600     ,p_first_action_la_code1        => p_rec.first_action_la_code1
1601     ,p_first_nature_of_action_id    => p_rec.first_noa_id
1602     ,p_effective_date               => p_rec.effective_date
1603     );
1604 
1605   -- check first_action_la_code2
1606 
1607      chk_first_action_la_code2
1608     (p_pa_request_id                => p_rec.pa_request_id
1609     ,p_object_version_number        => p_rec.object_version_number
1610     ,p_first_action_la_code2        => p_rec.first_action_la_code2
1611     ,p_first_nature_of_action_id    => p_rec.first_noa_id
1612     ,p_effective_date               => p_rec.effective_date
1613     );
1614 
1615  -- check second_action_la_code1
1616     chk_second_action_la_code1
1617     (p_pa_request_id                => p_rec.pa_request_id
1618     ,p_object_version_number        => p_rec.object_version_number
1619     ,p_second_action_la_code1       => p_rec.second_action_la_code1
1620     ,p_second_nature_of_action_id   => p_rec.second_noa_id
1621     ,p_effective_date               => p_rec.effective_date
1622     );
1623 
1624 
1625  -- check second_action_la_code2
1626 
1627      chk_second_action_la_code2
1628     (p_pa_request_id                => p_rec.pa_request_id
1629     ,p_object_version_number        => p_rec.object_version_number
1630     ,p_second_action_la_code2       => p_rec.second_action_la_code2
1631     ,p_second_nature_of_action_id   => p_rec.second_noa_id
1632     ,p_effective_date               => p_rec.effective_date
1633     );
1634 
1635  --  check duty_station_id
1636  --
1637        chk_duty_station_id(p_pa_request_id          => p_rec.pa_request_id,
1638                            p_object_version_number  => p_rec.object_version_number,
1639                            p_duty_station_id        => p_rec.duty_station_id,
1640                            p_effective_date         => p_rec.effective_date
1641                           );
1642   --
1643 
1644   --
1645   -- Call hr_dflex_utility.ins_or_upd_descflex_attribs procedure to validate Descritive Flex Fields
1646 
1647   hr_dflex_utility.ins_or_upd_descflex_attribs
1648       (p_appl_short_name    => 'GHR'
1649       ,p_descflex_name      => 'GHR_PA_REQUESTS'
1650       ,p_attribute_category => p_rec.attribute_category
1651       ,p_attribute1_name    => 'ATTRIBUTE1'
1652       ,p_attribute1_value   => p_rec.ATTRIBUTE1
1653       ,p_attribute2_name    => 'ATTRIBUTE2'
1654       ,p_attribute2_value   => p_rec.ATTRIBUTE2
1655       ,p_attribute3_name    => 'ATTRIBUTE3'
1656       ,p_attribute3_value   => p_rec.ATTRIBUTE3
1657       ,p_attribute4_name    => 'ATTRIBUTE4'
1658       ,p_attribute4_value   => p_rec.ATTRIBUTE4
1659       ,p_attribute5_name    => 'ATTRIBUTE5'
1660       ,p_attribute5_value   => p_rec.ATTRIBUTE5
1661       ,p_attribute6_name    => 'ATTRIBUTE6'
1662       ,p_attribute6_value   => p_rec.ATTRIBUTE6
1663       ,p_attribute7_name    => 'ATTRIBUTE7'
1664       ,p_attribute7_value   => p_rec.ATTRIBUTE7
1665       ,p_attribute8_name    => 'ATTRIBUTE8'
1666       ,p_attribute8_value   => p_rec.ATTRIBUTE8
1667       ,p_attribute9_name    => 'ATTRIBUTE9'
1668       ,p_attribute9_value   => p_rec.ATTRIBUTE9
1669       ,p_attribute10_name    => 'ATTRIBUTE10'
1670       ,p_attribute10_value   => p_rec.ATTRIBUTE10
1671       ,p_attribute11_name    => 'ATTRIBUTE11'
1672       ,p_attribute11_value   => p_rec.ATTRIBUTE11
1673       ,p_attribute12_name    => 'ATTRIBUTE12'
1674       ,p_attribute12_value   => p_rec.ATTRIBUTE12
1675       ,p_attribute13_name    => 'ATTRIBUTE13'
1676       ,p_attribute13_value   => p_rec.ATTRIBUTE13
1677       ,p_attribute14_name    => 'ATTRIBUTE14'
1678       ,p_attribute14_value   => p_rec.ATTRIBUTE14
1679       ,p_attribute15_name    => 'ATTRIBUTE15'
1680       ,p_attribute15_value   => p_rec.ATTRIBUTE15
1681       ,p_attribute16_name    => 'ATTRIBUTE16'
1682       ,p_attribute16_value   => p_rec.ATTRIBUTE16
1683       ,p_attribute17_name    => 'ATTRIBUTE17'
1684       ,p_attribute17_value   => p_rec.ATTRIBUTE17
1685       ,p_attribute18_name    => 'ATTRIBUTE18'
1686       ,p_attribute18_value   => p_rec.ATTRIBUTE18
1687       ,p_attribute19_name    => 'ATTRIBUTE19'
1688       ,p_attribute19_value   => p_rec.ATTRIBUTE19
1689       ,p_attribute20_name    => 'ATTRIBUTE20'
1690       ,p_attribute20_value   => p_rec.ATTRIBUTE20
1691       );
1692   hr_utility.set_location(' Leaving:'||l_proc, 10);
1693 End update_validate;
1694 --
1695 -- ----------------------------------------------------------------------------
1696 -- |---------------------------< delete_validate >----------------------------|
1697 -- ----------------------------------------------------------------------------
1698 Procedure delete_validate(p_rec in ghr_par_shd.g_rec_type) is
1699 --
1700   l_proc  varchar2(72) := g_package||'delete_validate';
1701 --
1702 Begin
1706   --
1703   hr_utility.set_location('Entering:'||l_proc, 5);
1704   --
1705   -- Call all supporting business operations
1707   hr_utility.set_location(' Leaving:'||l_proc, 10);
1708 End delete_validate;
1709 --
1710 
1711 -- ----------------------------------------------------------------------------
1712 -- |---------------------------< convert_defaults>----------------------------|
1713 -- ----------------------------------------------------------------------------
1714 -- {Start Of Comments}
1715 --
1716 -- Description:
1717 --   The Convert_Defaults procedure is the same as the private procedure
1718 --   convert_defs. This has been included here to make it publically callable
1719 --   from the ghr_sf52_api business process
1720 --
1721 --
1722 -- In Parameters:
1723 --   A Pl/Sql record structre.
1724 --
1725 -- Post Success:
1726 --   The record structure will be returned with all system defaulted parameter
1727 --   values converted into its current row attribute value.
1728 --
1729 -- Post Failure:
1730 --   No direct error handling is required within this function. Any possible
1731 --   errors within this procedure will be a PL/SQL value error due to conversion
1732 
1733 --   of datatypes or data lengths.
1734 --
1735 -- Developer Implementation Notes:
1736 --   None.
1737 --
1738 -- Access Status:
1739 --   Internal Row Handler Use Only.
1740 --
1741 -- {End Of Comments}
1742 -- ----------------------------------------------------------------------------
1743 Procedure convert_defaults(p_rec in out nocopy  ghr_pa_requests%rowtype) is
1744 --
1745   l_proc  varchar2(72) := g_package||'convert_defaults';
1746 --
1747 Begin
1748   --
1749   hr_utility.set_location('Entering:'||l_proc, 5);
1750   --
1751   -- We must now examine each argument value in the
1752   -- p_rec plsql record structure
1753   -- to see if a system default is being used. If a system default
1754   -- is being used then we must set to the 'current' argument value.
1755   --
1756   If (p_rec.pa_notification_id = hr_api.g_number) then
1757     p_rec.pa_notification_id :=
1758     ghr_par_shd.g_old_rec.pa_notification_id;
1759   End If;
1760   If (p_rec.noa_family_code = hr_api.g_varchar2) then
1761     p_rec.noa_family_code :=
1762     ghr_par_shd.g_old_rec.noa_family_code;
1763   End If;
1764   If (p_rec.routing_group_id = hr_api.g_number) then
1765     p_rec.routing_group_id :=
1766     ghr_par_shd.g_old_rec.routing_group_id;
1767   End If;
1768   If (p_rec.proposed_effective_asap_flag = hr_api.g_varchar2) then
1769     p_rec.proposed_effective_asap_flag :=
1770     ghr_par_shd.g_old_rec.proposed_effective_asap_flag;
1771   End If;
1772   If (p_rec.academic_discipline = hr_api.g_varchar2) then
1773     p_rec.academic_discipline :=
1774     ghr_par_shd.g_old_rec.academic_discipline;
1775   End If;
1776   If (p_rec.additional_info_person_id = hr_api.g_number) then
1777     p_rec.additional_info_person_id :=
1778     ghr_par_shd.g_old_rec.additional_info_person_id;
1779   End If;
1780   If (p_rec.additional_info_tel_number = hr_api.g_varchar2) then
1781     p_rec.additional_info_tel_number :=
1782     ghr_par_shd.g_old_rec.additional_info_tel_number;
1783   End If;
1784   If (p_rec.agency_code = hr_api.g_varchar2) then
1785     p_rec.agency_code :=
1786     ghr_par_shd.g_old_rec.agency_code;
1787   End If;
1788   If (p_rec.altered_pa_request_id = hr_api.g_number) then
1789     p_rec.altered_pa_request_id :=
1790     ghr_par_shd.g_old_rec.altered_pa_request_id;
1791   End If;
1792   If (p_rec.annuitant_indicator = hr_api.g_varchar2) then
1793     p_rec.annuitant_indicator :=
1794     ghr_par_shd.g_old_rec.annuitant_indicator;
1795   End If;
1796   If (p_rec.annuitant_indicator_desc = hr_api.g_varchar2) then
1797     p_rec.annuitant_indicator_desc :=
1798     ghr_par_shd.g_old_rec.annuitant_indicator_desc;
1799   End If;
1800   If (p_rec.appropriation_code1 = hr_api.g_varchar2) then
1801     p_rec.appropriation_code1 :=
1802     ghr_par_shd.g_old_rec.appropriation_code1;
1803   End If;
1804   If (p_rec.appropriation_code2 = hr_api.g_varchar2) then
1805     p_rec.appropriation_code2 :=
1806     ghr_par_shd.g_old_rec.appropriation_code2;
1807   End If;
1808   If (p_rec.approval_date = hr_api.g_date) then
1809     p_rec.approval_date :=
1810     ghr_par_shd.g_old_rec.approval_date;
1811   End If;
1812   If (p_rec.approving_official_full_name = hr_api.g_varchar2) then
1813     p_rec.approving_official_full_name :=
1814     ghr_par_shd.g_old_rec.approving_official_full_name;
1815   End If;
1816   If (p_rec.approving_official_work_title = hr_api.g_varchar2) then
1817     p_rec.approving_official_work_title :=
1818     ghr_par_shd.g_old_rec.approving_official_work_title;
1819   End If;
1820   If (p_rec.sf50_approval_date = hr_api.g_date) then
1821     p_rec.sf50_approval_date :=
1822     ghr_par_shd.g_old_rec.sf50_approval_date;
1823   End If;
1824   If (p_rec.sf50_approving_ofcl_full_name = hr_api.g_varchar2) then
1825     p_rec.sf50_approving_ofcl_full_name :=
1826     ghr_par_shd.g_old_rec.sf50_approving_ofcl_full_name ;
1827   End If;
1828   If (p_rec.sf50_approving_ofcl_work_title  = hr_api.g_varchar2) then
1829     p_rec.sf50_approving_ofcl_work_title  :=
1830     ghr_par_shd.g_old_rec.sf50_approving_ofcl_work_title;
1831   End If;
1832   If (p_rec.authorized_by_person_id = hr_api.g_number) then
1833     p_rec.authorized_by_person_id :=
1837     p_rec.authorized_by_title :=
1834     ghr_par_shd.g_old_rec.authorized_by_person_id;
1835   End If;
1836   If (p_rec.authorized_by_title = hr_api.g_varchar2) then
1838     ghr_par_shd.g_old_rec.authorized_by_title;
1839   End If;
1840   If (p_rec.award_amount = hr_api.g_number) then
1841     p_rec.award_amount :=
1842     ghr_par_shd.g_old_rec.award_amount;
1843   End If;
1844   If (p_rec.award_uom = hr_api.g_varchar2) then
1845     p_rec.award_uom :=
1846     ghr_par_shd.g_old_rec.award_uom;
1847   End If;
1848   If (p_rec.bargaining_unit_status = hr_api.g_varchar2) then
1849     p_rec.bargaining_unit_status :=
1850     ghr_par_shd.g_old_rec.bargaining_unit_status;
1851   End If;
1852   If (p_rec.citizenship = hr_api.g_varchar2) then
1853     p_rec.citizenship :=
1854     ghr_par_shd.g_old_rec.citizenship;
1855   End If;
1856   If (p_rec.concurrence_date = hr_api.g_date) then
1857     p_rec.concurrence_date :=
1858     ghr_par_shd.g_old_rec.concurrence_date;
1859   End If;
1860   If (p_rec.custom_pay_calc_flag = hr_api.g_varchar2) then
1861     p_rec.custom_pay_calc_flag :=
1862     ghr_par_shd.g_old_rec.custom_pay_calc_flag;
1863   End If;
1864   If (p_rec.duty_station_code = hr_api.g_varchar2) then
1865     p_rec.duty_station_code :=
1866     ghr_par_shd.g_old_rec.duty_station_code;
1867   End If;
1868   If (p_rec.duty_station_desc = hr_api.g_varchar2) then
1869     p_rec.duty_station_desc :=
1870     ghr_par_shd.g_old_rec.duty_station_desc;
1871   End If;
1872   If (p_rec.duty_station_id = hr_api.g_number) then
1873     p_rec.duty_station_id :=
1874     ghr_par_shd.g_old_rec.duty_station_id;
1875   End If;
1876   If (p_rec.duty_station_location_id = hr_api.g_number) then
1877     p_rec.duty_station_location_id :=
1878     ghr_par_shd.g_old_rec.duty_station_location_id;
1879   End If;
1880   If (p_rec.education_level = hr_api.g_varchar2) then
1881     p_rec.education_level :=
1882     ghr_par_shd.g_old_rec.education_level;
1883   End If;
1884   If (p_rec.effective_date = hr_api.g_date) then
1885     p_rec.effective_date :=
1886     ghr_par_shd.g_old_rec.effective_date;
1887   End If;
1888   If (p_rec.employee_assignment_id = hr_api.g_number) then
1889     p_rec.employee_assignment_id :=
1890     ghr_par_shd.g_old_rec.employee_assignment_id;
1891   End If;
1892   If (p_rec.employee_date_of_birth = hr_api.g_date) then
1893     p_rec.employee_date_of_birth :=
1894     ghr_par_shd.g_old_rec.employee_date_of_birth;
1895   End If;
1896   If (p_rec.employee_dept_or_agency = hr_api.g_varchar2) then
1897     p_rec.employee_dept_or_agency :=
1898     ghr_par_shd.g_old_rec.employee_dept_or_agency;
1899   End If;
1900   If (p_rec.employee_first_name = hr_api.g_varchar2) then
1901     p_rec.employee_first_name :=
1902     ghr_par_shd.g_old_rec.employee_first_name;
1903   End If;
1904   If (p_rec.employee_last_name = hr_api.g_varchar2) then
1905     p_rec.employee_last_name :=
1906     ghr_par_shd.g_old_rec.employee_last_name;
1907   End If;
1908   If (p_rec.employee_middle_names = hr_api.g_varchar2) then
1909     p_rec.employee_middle_names :=
1910     ghr_par_shd.g_old_rec.employee_middle_names;
1911   End If;
1912   If (p_rec.employee_national_identifier = hr_api.g_varchar2) then
1913     p_rec.employee_national_identifier :=
1914     ghr_par_shd.g_old_rec.employee_national_identifier;
1915   End If;
1916   If (p_rec.fegli = hr_api.g_varchar2) then
1917     p_rec.fegli :=
1918     ghr_par_shd.g_old_rec.fegli;
1919   End If;
1920   If (p_rec.fegli_desc = hr_api.g_varchar2) then
1921     p_rec.fegli_desc :=
1922     ghr_par_shd.g_old_rec.fegli_desc;
1923   End If;
1924   If (p_rec.first_action_la_code1 = hr_api.g_varchar2) then
1925     p_rec.first_action_la_code1 :=
1926     ghr_par_shd.g_old_rec.first_action_la_code1;
1927   End If;
1928   If (p_rec.first_action_la_code2 = hr_api.g_varchar2) then
1929     p_rec.first_action_la_code2 :=
1930     ghr_par_shd.g_old_rec.first_action_la_code2;
1931   End If;
1932   If (p_rec.first_action_la_desc1 = hr_api.g_varchar2) then
1933     p_rec.first_action_la_desc1 :=
1934     ghr_par_shd.g_old_rec.first_action_la_desc1;
1935   End If;
1936   If (p_rec.first_action_la_desc2 = hr_api.g_varchar2) then
1937     p_rec.first_action_la_desc2 :=
1938     ghr_par_shd.g_old_rec.first_action_la_desc2;
1939   End If;
1940   If (p_rec.first_noa_cancel_or_correct = hr_api.g_varchar2) then
1941     p_rec.first_noa_cancel_or_correct :=
1942     ghr_par_shd.g_old_rec.first_noa_cancel_or_correct;
1943   End If;
1944   If (p_rec.first_noa_code = hr_api.g_varchar2) then
1945     p_rec.first_noa_code :=
1946     ghr_par_shd.g_old_rec.first_noa_code;
1947   End If;
1948   If (p_rec.first_noa_desc = hr_api.g_varchar2) then
1949     p_rec.first_noa_desc :=
1950     ghr_par_shd.g_old_rec.first_noa_desc;
1951   End If;
1952   If (p_rec.first_noa_id = hr_api.g_number) then
1953     p_rec.first_noa_id :=
1954     ghr_par_shd.g_old_rec.first_noa_id;
1955   End If;
1956   If (p_rec.first_noa_pa_request_id = hr_api.g_number) then
1957     p_rec.first_noa_pa_request_id :=
1958     ghr_par_shd.g_old_rec.first_noa_pa_request_id;
1959   End If;
1960   If (p_rec.flsa_category = hr_api.g_varchar2) then
1961     p_rec.flsa_category :=
1962     ghr_par_shd.g_old_rec.flsa_category;
1963   End If;
1967   End If;
1964   If (p_rec.forwarding_address_line1 = hr_api.g_varchar2) then
1965     p_rec.forwarding_address_line1 :=
1966     ghr_par_shd.g_old_rec.forwarding_address_line1;
1968   If (p_rec.forwarding_address_line2 = hr_api.g_varchar2) then
1969     p_rec.forwarding_address_line2 :=
1970     ghr_par_shd.g_old_rec.forwarding_address_line2;
1971   End If;
1972   If (p_rec.forwarding_address_line3 = hr_api.g_varchar2) then
1973     p_rec.forwarding_address_line3 :=
1974     ghr_par_shd.g_old_rec.forwarding_address_line3;
1975   End If;
1976   If (p_rec.forwarding_country_short_name = hr_api.g_varchar2) then
1977     p_rec.forwarding_country_short_name :=
1978     ghr_par_shd.g_old_rec.forwarding_country_short_name;
1979   End If;
1980   If (p_rec.forwarding_country = hr_api.g_varchar2) then
1981     p_rec.forwarding_country :=
1982     ghr_par_shd.g_old_rec.forwarding_country;
1983   End If;
1984   If (p_rec.forwarding_postal_code = hr_api.g_varchar2) then
1985     p_rec.forwarding_postal_code :=
1986     ghr_par_shd.g_old_rec.forwarding_postal_code;
1987   End If;
1988   If (p_rec.forwarding_region_2 = hr_api.g_varchar2) then
1989     p_rec.forwarding_region_2 :=
1990     ghr_par_shd.g_old_rec.forwarding_region_2;
1991   End If;
1992   If (p_rec.forwarding_town_or_city = hr_api.g_varchar2) then
1993     p_rec.forwarding_town_or_city :=
1994     ghr_par_shd.g_old_rec.forwarding_town_or_city;
1995   End If;
1996   If (p_rec.from_adj_basic_pay = hr_api.g_number) then
1997     p_rec.from_adj_basic_pay :=
1998     ghr_par_shd.g_old_rec.from_adj_basic_pay;
1999   End If;
2000   If (p_rec.from_agency_code = hr_api.g_varchar2) then
2001     p_rec.from_agency_code :=
2002     ghr_par_shd.g_old_rec.from_agency_code;
2003   End If;
2004   If (p_rec.from_agency_desc = hr_api.g_varchar2) then
2005     p_rec.from_agency_desc :=
2006     ghr_par_shd.g_old_rec.from_agency_desc;
2007   End If;
2008   If (p_rec.from_basic_pay = hr_api.g_number) then
2009     p_rec.from_basic_pay :=
2010     ghr_par_shd.g_old_rec.from_basic_pay;
2011   End If;
2012   If (p_rec.from_grade_or_level = hr_api.g_varchar2) then
2013     p_rec.from_grade_or_level :=
2014     ghr_par_shd.g_old_rec.from_grade_or_level;
2015   End If;
2016   If (p_rec.from_locality_adj = hr_api.g_number) then
2017     p_rec.from_locality_adj :=
2018     ghr_par_shd.g_old_rec.from_locality_adj;
2019   End If;
2020   If (p_rec.from_occ_code = hr_api.g_varchar2) then
2021     p_rec.from_occ_code :=
2022     ghr_par_shd.g_old_rec.from_occ_code;
2023   End If;
2024   If (p_rec.from_office_symbol = hr_api.g_varchar2) then
2025     p_rec.from_office_symbol :=
2026     ghr_par_shd.g_old_rec.from_office_symbol;
2027   End If;
2028   If (p_rec.from_other_pay_amount = hr_api.g_number) then
2029     p_rec.from_other_pay_amount :=
2030     ghr_par_shd.g_old_rec.from_other_pay_amount;
2031   End If;
2032   If (p_rec.from_pay_basis = hr_api.g_varchar2) then
2033     p_rec.from_pay_basis :=
2034     ghr_par_shd.g_old_rec.from_pay_basis;
2035   End If;
2036   If (p_rec.from_pay_plan = hr_api.g_varchar2) then
2037     p_rec.from_pay_plan :=
2038     ghr_par_shd.g_old_rec.from_pay_plan;
2039   End If;
2040   -- FWFA Changes Bug#4444609
2041   If (p_rec.input_pay_rate_determinant = hr_api.g_varchar2) then
2042     p_rec.input_pay_rate_determinant :=
2043     ghr_par_shd.g_old_rec.input_pay_rate_determinant;
2044   End If;
2045   If (p_rec.from_pay_table_identifier  = hr_api.g_number) then
2046     p_rec.from_pay_table_identifier :=
2047     ghr_par_shd.g_old_rec.from_pay_table_identifier;
2048   End If;
2049   -- FWFA Changes
2050   If (p_rec.from_position_org_line1 = hr_api.g_varchar2) then
2051     p_rec.from_position_org_line1 :=
2052     ghr_par_shd.g_old_rec.from_position_org_line1;
2053   End If;
2054   If (p_rec.from_position_org_line2 = hr_api.g_varchar2) then
2055     p_rec.from_position_org_line2 :=
2056     ghr_par_shd.g_old_rec.from_position_org_line2;
2057   End If;
2058   If (p_rec.from_position_org_line3 = hr_api.g_varchar2) then
2059     p_rec.from_position_org_line3 :=
2060     ghr_par_shd.g_old_rec.from_position_org_line3;
2061   End If;
2062   If (p_rec.from_position_org_line4 = hr_api.g_varchar2) then
2063     p_rec.from_position_org_line4 :=
2064     ghr_par_shd.g_old_rec.from_position_org_line4;
2065   End If;
2066   If (p_rec.from_position_org_line5 = hr_api.g_varchar2) then
2067     p_rec.from_position_org_line5 :=
2068     ghr_par_shd.g_old_rec.from_position_org_line5;
2069   End If;
2070   If (p_rec.from_position_org_line6 = hr_api.g_varchar2) then
2071     p_rec.from_position_org_line6 :=
2072     ghr_par_shd.g_old_rec.from_position_org_line6;
2073   End If;
2074   If (p_rec.from_position_id = hr_api.g_number) then
2075     p_rec.from_position_id :=
2076     ghr_par_shd.g_old_rec.from_position_id;
2077   End If;
2078   If (p_rec.from_position_number = hr_api.g_varchar2) then
2079     p_rec.from_position_number :=
2080     ghr_par_shd.g_old_rec.from_position_number;
2081   End If;
2082   If (p_rec.from_position_seq_no = hr_api.g_number) then
2083     p_rec.from_position_seq_no :=
2084     ghr_par_shd.g_old_rec.from_position_seq_no;
2085   End If;
2086   If (p_rec.from_position_title = hr_api.g_varchar2) then
2087     p_rec.from_position_title :=
2088     ghr_par_shd.g_old_rec.from_position_title;
2089   End If;
2093   End If;
2090   If (p_rec.from_step_or_rate = hr_api.g_varchar2) then
2091     p_rec.from_step_or_rate :=
2092     ghr_par_shd.g_old_rec.from_step_or_rate;
2094   If (p_rec.from_total_salary = hr_api.g_number) then
2095     p_rec.from_total_salary :=
2096     ghr_par_shd.g_old_rec.from_total_salary;
2097   End If;
2098   If (p_rec.functional_class = hr_api.g_varchar2) then
2099     p_rec.functional_class :=
2100     ghr_par_shd.g_old_rec.functional_class;
2101   End If;
2102   If (p_rec.notepad = hr_api.g_varchar2) then
2103     p_rec.notepad :=
2104     ghr_par_shd.g_old_rec.notepad;
2105   End If;
2106   If (p_rec.part_time_hours = hr_api.g_number) then
2107     p_rec.part_time_hours :=
2108     ghr_par_shd.g_old_rec.part_time_hours;
2109   End If;
2110   If (p_rec.pay_rate_determinant = hr_api.g_varchar2) then
2111     p_rec.pay_rate_determinant :=
2112     ghr_par_shd.g_old_rec.pay_rate_determinant;
2113   End If;
2114   If (p_rec.personnel_office_id = hr_api.g_varchar2) then
2115     p_rec.personnel_office_id :=
2116     ghr_par_shd.g_old_rec.personnel_office_id;
2117   End If;
2118   If (p_rec.person_id = hr_api.g_number) then
2119     p_rec.person_id :=
2120     ghr_par_shd.g_old_rec.person_id;
2121   End If;
2122   If (p_rec.position_occupied = hr_api.g_varchar2) then
2123     p_rec.position_occupied :=
2124     ghr_par_shd.g_old_rec.position_occupied;
2125   End If;
2126   If (p_rec.proposed_effective_date = hr_api.g_date) then
2127     p_rec.proposed_effective_date :=
2128     ghr_par_shd.g_old_rec.proposed_effective_date;
2129   End If;
2130   If (p_rec.proposed_effective_asap_flag = hr_api.g_varchar2) then
2131     p_rec.proposed_effective_asap_flag :=
2132     ghr_par_shd.g_old_rec.proposed_effective_asap_flag;
2133   End If;
2134 
2135   If (p_rec.requested_by_person_id = hr_api.g_number) then
2136     p_rec.requested_by_person_id :=
2137     ghr_par_shd.g_old_rec.requested_by_person_id;
2138   End If;
2139   If (p_rec.requested_by_title = hr_api.g_varchar2) then
2140     p_rec.requested_by_title :=
2141     ghr_par_shd.g_old_rec.requested_by_title;
2142   End If;
2143   If (p_rec.requested_date = hr_api.g_date) then
2144     p_rec.requested_date :=
2145     ghr_par_shd.g_old_rec.requested_date;
2146   End If;
2147   If (p_rec.requesting_office_remarks_desc = hr_api.g_varchar2) then
2148     p_rec.requesting_office_remarks_desc :=
2149     ghr_par_shd.g_old_rec.requesting_office_remarks_desc;
2150   End If;
2151   If (p_rec.requesting_office_remarks_flag = hr_api.g_varchar2) then
2152     p_rec.requesting_office_remarks_flag :=
2153     ghr_par_shd.g_old_rec.requesting_office_remarks_flag;
2154   End If;
2155   If (p_rec.request_number = hr_api.g_varchar2) then
2156     p_rec.request_number :=
2157     ghr_par_shd.g_old_rec.request_number;
2158   End If;
2159   If (p_rec.resign_and_retire_reason_desc = hr_api.g_varchar2) then
2160     p_rec.resign_and_retire_reason_desc :=
2161     ghr_par_shd.g_old_rec.resign_and_retire_reason_desc;
2162   End If;
2163   If (p_rec.retirement_plan = hr_api.g_varchar2) then
2164     p_rec.retirement_plan :=
2165     ghr_par_shd.g_old_rec.retirement_plan;
2166   End If;
2167   If (p_rec.retirement_plan_desc = hr_api.g_varchar2) then
2168     p_rec.retirement_plan_desc :=
2169     ghr_par_shd.g_old_rec.retirement_plan_desc;
2170   End If;
2171   If (p_rec.second_action_la_code1 = hr_api.g_varchar2) then
2172     p_rec.second_action_la_code1 :=
2173     ghr_par_shd.g_old_rec.second_action_la_code1;
2174   End If;
2175   If (p_rec.second_action_la_code2 = hr_api.g_varchar2) then
2176     p_rec.second_action_la_code2 :=
2177     ghr_par_shd.g_old_rec.second_action_la_code2;
2178   End If;
2179   If (p_rec.second_action_la_desc1 = hr_api.g_varchar2) then
2180     p_rec.second_action_la_desc1 :=
2181     ghr_par_shd.g_old_rec.second_action_la_desc1;
2182   End If;
2183   If (p_rec.second_action_la_desc2 = hr_api.g_varchar2) then
2184     p_rec.second_action_la_desc2 :=
2185     ghr_par_shd.g_old_rec.second_action_la_desc2;
2186   End If;
2187   If (p_rec.second_noa_cancel_or_correct = hr_api.g_varchar2) then
2188     p_rec.second_noa_cancel_or_correct :=
2189     ghr_par_shd.g_old_rec.second_noa_cancel_or_correct;
2190   End If;
2191   If (p_rec.second_noa_code = hr_api.g_varchar2) then
2192     p_rec.second_noa_code :=
2193     ghr_par_shd.g_old_rec.second_noa_code;
2194   End If;
2195   If (p_rec.second_noa_desc = hr_api.g_varchar2) then
2196     p_rec.second_noa_desc :=
2197     ghr_par_shd.g_old_rec.second_noa_desc;
2198   End If;
2199   If (p_rec.second_noa_id = hr_api.g_number) then
2200     p_rec.second_noa_id :=
2201     ghr_par_shd.g_old_rec.second_noa_id;
2202   End If;
2203   If (p_rec.second_noa_pa_request_id = hr_api.g_number) then
2204     p_rec.second_noa_pa_request_id :=
2205     ghr_par_shd.g_old_rec.second_noa_pa_request_id;
2206   End If;
2207   If (p_rec.service_comp_date = hr_api.g_date) then
2208     p_rec.service_comp_date :=
2209     ghr_par_shd.g_old_rec.service_comp_date;
2210   End If;
2211   If (p_rec.status = hr_api.g_varchar2) then
2212     p_rec.status :=
2213     ghr_par_shd.g_old_rec.status;
2214   End If;
2215   If (p_rec.supervisory_status = hr_api.g_varchar2) then
2216     p_rec.supervisory_status :=
2217     ghr_par_shd.g_old_rec.supervisory_status;
2218   End If;
2219   If (p_rec.tenure = hr_api.g_varchar2) then
2220     p_rec.tenure :=
2224     p_rec.to_adj_basic_pay :=
2221     ghr_par_shd.g_old_rec.tenure;
2222   End If;
2223   If (p_rec.to_adj_basic_pay = hr_api.g_number) then
2225     ghr_par_shd.g_old_rec.to_adj_basic_pay;
2226   End If;
2227   If (p_rec.to_basic_pay = hr_api.g_number) then
2228     p_rec.to_basic_pay :=
2229     ghr_par_shd.g_old_rec.to_basic_pay;
2230   End If;
2231   If (p_rec.to_grade_id = hr_api.g_number) then
2232     p_rec.to_grade_id :=
2233     ghr_par_shd.g_old_rec.to_grade_id;
2234   End If;
2235   If (p_rec.to_grade_or_level = hr_api.g_varchar2) then
2236     p_rec.to_grade_or_level :=
2237     ghr_par_shd.g_old_rec.to_grade_or_level;
2238   End If;
2239   If (p_rec.to_job_id = hr_api.g_number) then
2240     p_rec.to_job_id :=
2241     ghr_par_shd.g_old_rec.to_job_id;
2242   End If;
2243   If (p_rec.to_locality_adj = hr_api.g_number) then
2244     p_rec.to_locality_adj :=
2245     ghr_par_shd.g_old_rec.to_locality_adj;
2246   End If;
2247   If (p_rec.to_occ_code = hr_api.g_varchar2) then
2248     p_rec.to_occ_code :=
2249     ghr_par_shd.g_old_rec.to_occ_code;
2250   End If;
2251   If (p_rec.to_office_symbol = hr_api.g_varchar2) then
2252     p_rec.to_office_symbol :=
2253     ghr_par_shd.g_old_rec.to_office_symbol;
2254   End If;
2255   If (p_rec.to_organization_id = hr_api.g_number) then
2256     p_rec.to_organization_id :=
2257     ghr_par_shd.g_old_rec.to_organization_id;
2258   End If;
2259   If (p_rec.to_other_pay_amount = hr_api.g_number) then
2260     p_rec.to_other_pay_amount :=
2261     ghr_par_shd.g_old_rec.to_other_pay_amount;
2262   End If;
2263   If (p_rec.to_pay_basis = hr_api.g_varchar2) then
2264     p_rec.to_pay_basis :=
2265     ghr_par_shd.g_old_rec.to_pay_basis;
2266   End If;
2267   If (p_rec.to_pay_plan = hr_api.g_varchar2) then
2268     p_rec.to_pay_plan :=
2269     ghr_par_shd.g_old_rec.to_pay_plan;
2270   End If;
2271   -- FWFA Changes Bug#4444609
2272   If (p_rec.to_pay_table_identifier  = hr_api.g_number) then
2273     p_rec.to_pay_table_identifier :=
2274     ghr_par_shd.g_old_rec.to_pay_table_identifier;
2275   End If;
2276   -- FWFA Changes
2277   If (p_rec.to_position_id = hr_api.g_number) then
2278     p_rec.to_position_id :=
2279     ghr_par_shd.g_old_rec.to_position_id;
2280   End If;
2281   If (p_rec.to_position_org_line1 = hr_api.g_varchar2) then
2282     p_rec.to_position_org_line1 :=
2283     ghr_par_shd.g_old_rec.to_position_org_line1;
2284   End If;
2285   If (p_rec.to_position_org_line2 = hr_api.g_varchar2) then
2286     p_rec.to_position_org_line2 :=
2287     ghr_par_shd.g_old_rec.to_position_org_line2;
2288   End If;
2289   If (p_rec.to_position_org_line3 = hr_api.g_varchar2) then
2290     p_rec.to_position_org_line3 :=
2291     ghr_par_shd.g_old_rec.to_position_org_line3;
2292   End If;
2293   If (p_rec.to_position_org_line4 = hr_api.g_varchar2) then
2294     p_rec.to_position_org_line4 :=
2295     ghr_par_shd.g_old_rec.to_position_org_line4;
2296   End If;
2297   If (p_rec.to_position_org_line5 = hr_api.g_varchar2) then
2298     p_rec.to_position_org_line5 :=
2299     ghr_par_shd.g_old_rec.to_position_org_line5;
2300   End If;
2301   If (p_rec.to_position_org_line6 = hr_api.g_varchar2) then
2302     p_rec.to_position_org_line6 :=
2303     ghr_par_shd.g_old_rec.to_position_org_line6;
2304   End If;
2305 
2306   If (p_rec.to_position_number = hr_api.g_varchar2) then
2307     p_rec.to_position_number :=
2308     ghr_par_shd.g_old_rec.to_position_number;
2309   End If;
2310   If (p_rec.to_position_seq_no = hr_api.g_number) then
2311     p_rec.to_position_seq_no :=
2312     ghr_par_shd.g_old_rec.to_position_seq_no;
2313   End If;
2314   If (p_rec.to_position_title = hr_api.g_varchar2) then
2315     p_rec.to_position_title :=
2316     ghr_par_shd.g_old_rec.to_position_title;
2317   End If;
2318   If (p_rec.to_step_or_rate = hr_api.g_varchar2) then
2319     p_rec.to_step_or_rate :=
2320     ghr_par_shd.g_old_rec.to_step_or_rate;
2321   End If;
2322 
2323   If (p_rec.to_ap_premium_pay_indicator = hr_api.g_varchar2) then
2324     p_rec.to_ap_premium_pay_indicator :=
2325     ghr_par_shd.g_old_rec.to_ap_premium_pay_indicator;
2326   End If;
2327 
2328   If (p_rec.to_auo_premium_pay_indicator = hr_api.g_varchar2) then
2329     p_rec.to_auo_premium_pay_indicator :=
2330     ghr_par_shd.g_old_rec.to_auo_premium_pay_indicator;
2331   End If;
2332 
2333   If (p_rec.to_au_overtime = hr_api.g_number) then
2334     p_rec.to_au_overtime  :=
2335     ghr_par_shd.g_old_rec.to_au_overtime  ;
2336   End If;
2337 
2338   If (p_rec.to_availability_pay = hr_api.g_number) then
2339     p_rec.to_availability_pay :=
2340     ghr_par_shd.g_old_rec.to_availability_pay ;
2341   End If;
2342 
2343   If (p_rec.to_retention_allowance  = hr_api.g_number) then
2344     p_rec.to_retention_allowance  :=
2345     ghr_par_shd.g_old_rec.to_retention_allowance;
2346   End If;
2347 
2348   If (p_rec.to_staffing_differential  = hr_api.g_number) then
2349     p_rec.to_staffing_differential   :=
2350     ghr_par_shd.g_old_rec.to_staffing_differential ;
2351   End If;
2352 
2353    If (p_rec.to_supervisory_differential  = hr_api.g_number) then
2354     p_rec.to_supervisory_differential   :=
2355     ghr_par_shd.g_old_rec.to_supervisory_differential ;
2356   End If;
2357 
2358   If (p_rec.to_total_salary = hr_api.g_number) then
2362   If (p_rec.veterans_preference = hr_api.g_varchar2) then
2359     p_rec.to_total_salary :=
2360     ghr_par_shd.g_old_rec.to_total_salary;
2361   End If;
2363     p_rec.veterans_preference :=
2364     ghr_par_shd.g_old_rec.veterans_preference;
2365   End If;
2366   If (p_rec.veterans_pref_for_rif = hr_api.g_varchar2) then
2367     p_rec.veterans_pref_for_rif :=
2368     ghr_par_shd.g_old_rec.veterans_pref_for_rif;
2369   End If;
2370   If (p_rec.veterans_status = hr_api.g_varchar2) then
2371     p_rec.veterans_status :=
2372     ghr_par_shd.g_old_rec.veterans_status;
2373   End If;
2374   If (p_rec.work_schedule = hr_api.g_varchar2) then
2375     p_rec.work_schedule :=
2376     ghr_par_shd.g_old_rec.work_schedule;
2377   End If;
2378   If (p_rec.work_schedule_desc = hr_api.g_varchar2) then
2379     p_rec.work_schedule_desc :=
2380     ghr_par_shd.g_old_rec.work_schedule_desc;
2381   End If;
2382   If (p_rec.year_degree_attained = hr_api.g_number) then
2383     p_rec.year_degree_attained :=
2384     ghr_par_shd.g_old_rec.year_degree_attained;
2385   End If;
2386   If (p_rec.first_noa_information1 = hr_api.g_varchar2) then
2387     p_rec.first_noa_information1 :=
2388     ghr_par_shd.g_old_rec.first_noa_information1;
2389   End If;
2390   If (p_rec.first_noa_information2 = hr_api.g_varchar2) then
2391     p_rec.first_noa_information2 :=
2392     ghr_par_shd.g_old_rec.first_noa_information2;
2393   End If;
2394   If (p_rec.first_noa_information3 = hr_api.g_varchar2) then
2395     p_rec.first_noa_information3 :=
2396     ghr_par_shd.g_old_rec.first_noa_information3;
2397   End If;
2398   If (p_rec.first_noa_information4 = hr_api.g_varchar2) then
2399     p_rec.first_noa_information4 :=
2400     ghr_par_shd.g_old_rec.first_noa_information4;
2401   End If;
2402   If (p_rec.first_noa_information5 = hr_api.g_varchar2) then
2403     p_rec.first_noa_information5 :=
2404     ghr_par_shd.g_old_rec.first_noa_information5;
2405   End If;
2406   If (p_rec.second_lac1_information1 = hr_api.g_varchar2) then
2407     p_rec.second_lac1_information1 :=
2408     ghr_par_shd.g_old_rec.second_lac1_information1;
2409   End If;
2410   If (p_rec.second_lac1_information2 = hr_api.g_varchar2) then
2411     p_rec.second_lac1_information2 :=
2412     ghr_par_shd.g_old_rec.second_lac1_information2;
2413   End If;
2414   If (p_rec.second_lac1_information3 = hr_api.g_varchar2) then
2415     p_rec.second_lac1_information3 :=
2416     ghr_par_shd.g_old_rec.second_lac1_information3;
2417   End If;
2418   If (p_rec.second_lac1_information4 = hr_api.g_varchar2) then
2419     p_rec.second_lac1_information4 :=
2420     ghr_par_shd.g_old_rec.second_lac1_information4;
2421   End If;
2422   If (p_rec.second_lac1_information5 = hr_api.g_varchar2) then
2423     p_rec.second_lac1_information5 :=
2424     ghr_par_shd.g_old_rec.second_lac1_information5;
2425   End If;
2426   If (p_rec.second_lac2_information1 = hr_api.g_varchar2) then
2427     p_rec.second_lac2_information1 :=
2428     ghr_par_shd.g_old_rec.second_lac2_information1;
2429   End If;
2430   If (p_rec.second_lac2_information2 = hr_api.g_varchar2) then
2431     p_rec.second_lac2_information2 :=
2432     ghr_par_shd.g_old_rec.second_lac2_information2;
2433   End If;
2434   If (p_rec.second_lac2_information3 = hr_api.g_varchar2) then
2435     p_rec.second_lac2_information3 :=
2436     ghr_par_shd.g_old_rec.second_lac2_information3;
2437   End If;
2438   If (p_rec.second_lac2_information4 = hr_api.g_varchar2) then
2439     p_rec.second_lac2_information4 :=
2440     ghr_par_shd.g_old_rec.second_lac2_information4;
2441   End If;
2442   If (p_rec.second_lac2_information5 = hr_api.g_varchar2) then
2443     p_rec.second_lac2_information5 :=
2444     ghr_par_shd.g_old_rec.second_lac2_information5;
2445   End If;
2446   If (p_rec.second_noa_information1 = hr_api.g_varchar2) then
2447     p_rec.second_noa_information1 :=
2448     ghr_par_shd.g_old_rec.second_noa_information1;
2449   End If;
2450   If (p_rec.second_noa_information2 = hr_api.g_varchar2) then
2451     p_rec.second_noa_information2 :=
2452     ghr_par_shd.g_old_rec.second_noa_information2;
2453   End If;
2454   If (p_rec.second_noa_information3 = hr_api.g_varchar2) then
2455     p_rec.second_noa_information3 :=
2456     ghr_par_shd.g_old_rec.second_noa_information3;
2457   End If;
2458   If (p_rec.second_noa_information4 = hr_api.g_varchar2) then
2459     p_rec.second_noa_information4 :=
2460     ghr_par_shd.g_old_rec.second_noa_information4;
2461   End If;
2462   If (p_rec.second_noa_information5 = hr_api.g_varchar2) then
2463     p_rec.second_noa_information5 :=
2464     ghr_par_shd.g_old_rec.second_noa_information5;
2465   End If;
2466   If (p_rec.first_lac1_information1 = hr_api.g_varchar2) then
2467     p_rec.first_lac1_information1 :=
2468     ghr_par_shd.g_old_rec.first_lac1_information1;
2469   End If;
2470   If (p_rec.first_lac1_information2 = hr_api.g_varchar2) then
2471     p_rec.first_lac1_information2 :=
2472     ghr_par_shd.g_old_rec.first_lac1_information2;
2473   End If;
2474   If (p_rec.first_lac1_information3 = hr_api.g_varchar2) then
2475     p_rec.first_lac1_information3 :=
2476     ghr_par_shd.g_old_rec.first_lac1_information3;
2477   End If;
2478   If (p_rec.first_lac1_information4 = hr_api.g_varchar2) then
2479     p_rec.first_lac1_information4 :=
2480     ghr_par_shd.g_old_rec.first_lac1_information4;
2481   End If;
2485   End If;
2482   If (p_rec.first_lac1_information5 = hr_api.g_varchar2) then
2483     p_rec.first_lac1_information5 :=
2484     ghr_par_shd.g_old_rec.first_lac1_information5;
2486   If (p_rec.first_lac2_information1 = hr_api.g_varchar2) then
2487     p_rec.first_lac2_information1 :=
2488     ghr_par_shd.g_old_rec.first_lac2_information1;
2489   End If;
2490   If (p_rec.first_lac2_information2 = hr_api.g_varchar2) then
2491     p_rec.first_lac2_information2 :=
2492     ghr_par_shd.g_old_rec.first_lac2_information2;
2493   End If;
2494   If (p_rec.first_lac2_information3 = hr_api.g_varchar2) then
2495     p_rec.first_lac2_information3 :=
2496     ghr_par_shd.g_old_rec.first_lac2_information3;
2497   End If;
2498   If (p_rec.first_lac2_information4 = hr_api.g_varchar2) then
2499     p_rec.first_lac2_information4 :=
2500     ghr_par_shd.g_old_rec.first_lac2_information4;
2501   End If;
2502   If (p_rec.first_lac2_information5 = hr_api.g_varchar2) then
2503     p_rec.first_lac2_information5 :=
2504     ghr_par_shd.g_old_rec.first_lac2_information5;
2505   End If;
2506   If (p_rec.attribute_category = hr_api.g_varchar2) then
2507     p_rec.attribute_category :=
2508     ghr_par_shd.g_old_rec.attribute_category;
2509   End If;
2510   If (p_rec.attribute1 = hr_api.g_varchar2) then
2511     p_rec.attribute1 :=
2512     ghr_par_shd.g_old_rec.attribute1;
2513   End If;
2514   If (p_rec.attribute2 = hr_api.g_varchar2) then
2515     p_rec.attribute2 :=
2516     ghr_par_shd.g_old_rec.attribute2;
2517   End If;
2518   If (p_rec.attribute3 = hr_api.g_varchar2) then
2519     p_rec.attribute3 :=
2520     ghr_par_shd.g_old_rec.attribute3;
2521   End If;
2522   If (p_rec.attribute4 = hr_api.g_varchar2) then
2523     p_rec.attribute4 :=
2524     ghr_par_shd.g_old_rec.attribute4;
2525   End If;
2526   If (p_rec.attribute5 = hr_api.g_varchar2) then
2527     p_rec.attribute5 :=
2528     ghr_par_shd.g_old_rec.attribute5;
2529   End If;
2530   If (p_rec.attribute6 = hr_api.g_varchar2) then
2531     p_rec.attribute6 :=
2532     ghr_par_shd.g_old_rec.attribute6;
2533   End If;
2534   If (p_rec.attribute7 = hr_api.g_varchar2) then
2535     p_rec.attribute7 :=
2536     ghr_par_shd.g_old_rec.attribute7;
2537   End If;
2538   If (p_rec.attribute8 = hr_api.g_varchar2) then
2539     p_rec.attribute8 :=
2540     ghr_par_shd.g_old_rec.attribute8;
2541   End If;
2542   If (p_rec.attribute9 = hr_api.g_varchar2) then
2543     p_rec.attribute9 :=
2544     ghr_par_shd.g_old_rec.attribute9;
2545   End If;
2546   If (p_rec.attribute10 = hr_api.g_varchar2) then
2547     p_rec.attribute10 :=
2548     ghr_par_shd.g_old_rec.attribute10;
2549   End If;
2550   If (p_rec.attribute11 = hr_api.g_varchar2) then
2551     p_rec.attribute11 :=
2552     ghr_par_shd.g_old_rec.attribute11;
2553   End If;
2554   If (p_rec.attribute12 = hr_api.g_varchar2) then
2555     p_rec.attribute12 :=
2556     ghr_par_shd.g_old_rec.attribute12;
2557   End If;
2558   If (p_rec.attribute13 = hr_api.g_varchar2) then
2559     p_rec.attribute13 :=
2560     ghr_par_shd.g_old_rec.attribute13;
2561   End If;
2562   If (p_rec.attribute14 = hr_api.g_varchar2) then
2563     p_rec.attribute14 :=
2564     ghr_par_shd.g_old_rec.attribute14;
2565   End If;
2566   If (p_rec.attribute15 = hr_api.g_varchar2) then
2567     p_rec.attribute15 :=
2568     ghr_par_shd.g_old_rec.attribute15;
2569   End If;
2570   If (p_rec.attribute16 = hr_api.g_varchar2) then
2571     p_rec.attribute16 :=
2572     ghr_par_shd.g_old_rec.attribute16;
2573   End If;
2574   If (p_rec.attribute17 = hr_api.g_varchar2) then
2575     p_rec.attribute17 :=
2576     ghr_par_shd.g_old_rec.attribute17;
2577   End If;
2578   If (p_rec.attribute18 = hr_api.g_varchar2) then
2579     p_rec.attribute18 :=
2580     ghr_par_shd.g_old_rec.attribute18;
2581   End If;
2582   If (p_rec.attribute19 = hr_api.g_varchar2) then
2583     p_rec.attribute19 :=
2584     ghr_par_shd.g_old_rec.attribute19;
2585   End If;
2586   If (p_rec.attribute20 = hr_api.g_varchar2) then
2587     p_rec.attribute20 :=
2588     ghr_par_shd.g_old_rec.attribute20;
2589   End If;
2590   If (p_rec.first_noa_canc_pa_request_id = hr_api.g_number) then
2591     p_rec.first_noa_canc_pa_request_id :=
2592           ghr_par_shd.g_old_rec.first_noa_canc_pa_request_id;
2593   End If;
2594   If (p_rec.second_noa_canc_pa_request_id = hr_api.g_number) then
2595     p_rec.second_noa_canc_pa_request_id :=
2596           ghr_par_shd.g_old_rec.second_noa_canc_pa_request_id;
2597   End If;
2598   If (p_rec.to_retention_allow_percentage = hr_api.g_number) then
2599       p_rec.to_retention_allow_percentage :=
2600           ghr_par_shd.g_old_rec.to_retention_allow_percentage;
2601   End If;
2602   If (p_rec.to_supervisory_diff_percentage = hr_api.g_number) then
2603       p_rec.to_supervisory_diff_percentage :=
2604           ghr_par_shd.g_old_rec.to_supervisory_diff_percentage;
2605   End If;
2606   If (p_rec.to_staffing_diff_percentage = hr_api.g_number) then
2607       p_rec.to_staffing_diff_percentage :=
2608           ghr_par_shd.g_old_rec.to_staffing_diff_percentage;
2609   End If;
2610   If (p_rec.award_percentage = hr_api.g_number) then
2611       p_rec.award_percentage :=
2612           ghr_par_shd.g_old_rec.award_percentage;
2613   End If;
2614   If (p_rec.rpa_type    = hr_api.g_varchar2) then
2615     p_rec.rpa_type :=
2616     ghr_par_shd.g_old_rec.rpa_type;
2617   End If;
2618   If (p_rec.mass_action_id   = hr_api.g_number) then
2619       p_rec.mass_action_id   :=
2620           ghr_par_shd.g_old_rec.mass_action_id;
2621   End If;
2622   If (p_rec.mass_action_eligible_flag = hr_api.g_varchar2) then
2623     p_rec.mass_action_eligible_flag  :=
2624     ghr_par_shd.g_old_rec.mass_action_eligible_flag;
2625   End If;
2626   If (p_rec.mass_action_select_flag = hr_api.g_varchar2) then
2627     p_rec.mass_action_select_flag  :=
2628     ghr_par_shd.g_old_rec.mass_action_select_flag;
2629   End If;
2630   If (p_rec.mass_action_comments = hr_api.g_varchar2) then
2631     p_rec.mass_action_comments  :=
2632     ghr_par_shd.g_old_rec.mass_action_comments;
2633   End If;
2634 
2635   -- Bug#4486823 RRR Changes
2636   If (p_rec.pa_incentive_payment_option = hr_api.g_varchar2) then
2637     p_rec.pa_incentive_payment_option  :=
2638     ghr_par_shd.g_old_rec.payment_option;
2639   End If;
2640   If (p_rec.award_salary = hr_api.g_number) then
2641     p_rec.award_salary  :=
2642     ghr_par_shd.g_old_rec.award_salary;
2643   End If;
2644   -- Bug#    RRR Changes
2645  end convert_defaults;
2646 
2647 end ghr_par_bus;