DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQP_ATD_BUS

Source


1 PACKAGE BODY pqp_atd_bus as
2 /* $Header: pqatdrhi.pkb 115.10 2003/02/17 22:13:56 tmehra ship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- |                     Private Global Definitions                           |
6 -- ----------------------------------------------------------------------------
7 --
8 g_package  VARCHAR2(33)  := '  pqp_atd_bus.';  -- Global package name
9 --
10 -- ----------------------------------------------------------------------------
11 -- |------< chk_alien_transaction_id >------|
12 -- ----------------------------------------------------------------------------
13 --
14 -- Description
15 --   This procedure is used to check that the primary key for the table
16 --   is created properly. It should be null on insert and
17 --   should not be able to be updated.
18 --
19 -- Pre Conditions
20 --   None.
21 --
22 -- In Parameters
23 --   alien_transaction_id PK of record being inserted or updated.
24 --   object_version_number Object version number of record being
25 --                         inserted or updated.
26 --
27 -- Post Success
28 --   Processing continues
29 --
30 -- Post Failure
31 --   Errors handled by the procedure
32 --
33 -- Access Status
34 --   Internal table handler use only.
35 --
36 PROCEDURE chk_alien_transaction_id(p_alien_transaction_id  IN NUMBER ,
37                                    p_object_version_number IN NUMBER ) IS
38   --
39   l_proc         VARCHAR2(72) := g_package || 'chk_alien_transaction_id';
40   l_api_updating BOOLEAN;
41   --
42 BEGIN
43   --
44   hr_utility.set_location('Entering:'||l_proc, 5);
45   --
46   l_api_updating := pqp_atd_shd.api_updating
47     (p_alien_transaction_id        => p_alien_transaction_id,
48      p_object_version_number       => p_object_version_number);
49   --
50   if (l_api_updating
51      and nvl(p_alien_transaction_id,hr_api.g_number)
52      <>  pqp_atd_shd.g_old_rec.alien_transaction_id) then
53     --
54     -- raise error as PK has changed
55     --
56     pqp_atd_shd.constraint_error('PQP_ALIEN_TRANSACTION_DATA_PK');
57     --
58   elsif not l_api_updating then
59     --
60     -- check if PK is null
61     --
62     if p_alien_transaction_id is not null then
63       --
64       -- raise error as PK is not null
65       --
66       pqp_atd_shd.constraint_error('PQP_ALIEN_TRANSACTION_DATA_PK');
67       --
68     end if;
69     --
70   end if;
71   --
72   hr_utility.set_location('Leaving:'||l_proc, 10);
73   --
74 End chk_alien_transaction_id;
75 --
76 -- ----------------------------------------------------------------------------
77 -- |------< chk_treaty_ben_allowed_flag >------|
78 -- ----------------------------------------------------------------------------
79 --
80 -- Description
81 --   This procedure is used to check that the lookup value is valid.
82 --
83 -- Pre Conditions
84 --   None.
85 --
86 -- In Parameters
87 --   alien_transaction_id PK of record being inserted or updated.
88 --   treaty_ben_allowed_flag Value of lookup code.
89 --   effective_date effective date
90 --   object_version_number Object version number of record being
91 --                         inserted or updated.
92 --
93 -- Post Success
94 --   Processing continues
95 --
96 -- Post Failure
97 --   Error handled by procedure
98 --
99 -- Access Status
100 --   Internal table handler use only.
101 --
102 PROCEDURE chk_treaty_ben_allowed_flag(p_alien_transaction_id    in number   ,
103                                       p_treaty_ben_allowed_flag in varchar2 ,
104                                       p_effective_date          in date     ,
105                                       p_object_version_number   in number   ) IS
106   --
107   l_proc         VARCHAR2(72) := g_package||'chk_treaty_ben_allowed_flag';
108   l_api_updating BOOLEAN;
109   --
110 BEGIN
111   --
112     hr_utility.set_location('Entering:'||l_proc, 5);
113   --
114     l_api_updating := pqp_atd_shd.api_updating
115                         (p_alien_transaction_id   => p_alien_transaction_id,
116                          p_object_version_number  => p_object_version_number);
117   --
118     IF (l_api_updating            AND
119         p_treaty_ben_allowed_flag
120          <> NVL(pqp_atd_shd.g_old_rec.treaty_ben_allowed_flag,hr_api.g_varchar2)
121        OR NOT l_api_updating)
122        AND p_treaty_ben_allowed_flag IS NOT NULL THEN
123     --
124     -- check if value of lookup falls within lookup type.
125     --
126         IF hr_api.not_exists_in_hr_lookups
127             (p_lookup_type    => 'PQH_YES_NO'               ,
128              p_lookup_code    => p_treaty_ben_allowed_flag ,
129              p_effective_date => p_effective_date          ) THEN
130 /*      --
131       -- raise error as does not exist as lookup
132       --
133           hr_utility.set_message(801,'HR_LOOKUP_DOES_NOT_EXIST');
134           hr_utility.raise_error;  */
135 
136       -- Append the error message to the g_error_message
137 
138         g_error_message := g_error_message || '(' ||
139                                'treaty_ben_allowed_flag = ' ||
140                                p_treaty_ben_allowed_flag || ' is invalid )';
141 
142       --
143         END IF;
144     --
145     END IF;
146   --
147   hr_utility.set_location('Leaving:'||l_proc,10);
148   --
149 END chk_treaty_ben_allowed_flag;
150 --
151 -- ----------------------------------------------------------------------------
152 -- |------< chk_wthldg_allow_eligible_flag >------|
153 -- ----------------------------------------------------------------------------
154 --
155 -- Description
156 --   This procedure is used to check that the lookup value is valid.
157 --
158 -- Pre Conditions
159 --   None.
160 --
161 -- In Parameters
162 --   alien_transaction_id PK of record being inserted or updated.
163 --   wthldg_allow_eligible_flag Value of lookup code.
164 --   effective_date effective date
165 --   object_version_number Object version number of record being
166 --                         inserted or updated.
167 --
168 -- Post Success
169 --   Processing continues
170 --
171 -- Post Failure
172 --   Error handled by procedure
173 --
174 -- Access Status
175 --   Internal table handler use only.
176 --
177 PROCEDURE chk_wthldg_allow_eligible_flag(p_alien_transaction_id     IN NUMBER  ,
178                                        p_wthldg_allow_eligible_flag IN VARCHAR2,
179                                        p_effective_date             IN DATE    ,
180                                        p_object_version_number      IN NUMBER  )
181                                                                             IS
182   --
183   l_proc         VARCHAR2(72) := g_package||'chk_wthldg_allow_eligible_flag';
184   l_api_updating BOOLEAN;
185   --
186 BEGIN
187   --
188     hr_utility.set_location('Entering:'||l_proc, 5);
189   --
190     l_api_updating := pqp_atd_shd.api_updating
191                       (p_alien_transaction_id   => p_alien_transaction_id ,
192                        p_object_version_number  => p_object_version_number);
193   --
194     IF (l_api_updating AND
195         p_wthldg_allow_eligible_flag
196           <> nvl(pqp_atd_shd.g_old_rec.wthldg_allow_eligible_flag,hr_api.g_varchar2)
197         OR NOT l_api_updating)
198         AND p_wthldg_allow_eligible_flag IS NOT NULL THEN
199     --
200     -- check if value of lookup falls within lookup type.
201     --
202     if hr_api.not_exists_in_hr_lookups
203           (p_lookup_type    => 'PQH_YES_NO'                 ,
204            p_lookup_code    => p_wthldg_allow_eligible_flag,
205            p_effective_date => p_effective_date) then
206 /*      --
207       -- raise error as does not exist as lookup
208       --
209             hr_utility.set_message(801,'HR_LOOKUP_DOES_NOT_EXIST');
210             hr_utility.raise_error;  */
211 
212       -- Append the error message to the g_error_message
213 
214         g_error_message := g_error_message || '(' ||
215                                'wthldg_allow_eligible_flag = ' ||
216                                p_wthldg_allow_eligible_flag || ' is invalid )';
217       --
218         END IF;
219     --
220     END IF;
221   --
222     hr_utility.set_location('Leaving:'||l_proc,10);
223   --
224 END chk_wthldg_allow_eligible_flag;
225 --
226 -- ----------------------------------------------------------------------------
227 -- |------< chk_addl_withholding_flag >------|
228 -- ----------------------------------------------------------------------------
229 --
230 -- Description
231 --   This procedure is used to check that the lookup value is valid.
232 --
233 -- Pre Conditions
234 --   None.
235 --
236 -- In Parameters
237 --   alien_transaction_id PK of record being inserted or updated.
238 --   addl_withholding_flag Value of lookup code.
239 --   effective_date effective date
240 --   object_version_number Object version number of record being
241 --                         inserted or updated.
242 --
243 -- Post Success
244 --   Processing continues
245 --
246 -- Post Failure
247 --   Error handled by procedure
248 --
249 -- Access Status
250 --   Internal table handler use only.
251 --
252 Procedure chk_addl_withholding_flag(p_alien_transaction_id                in number,
253                             p_addl_withholding_flag               in varchar2,
254                             p_effective_date              in date,
255                             p_object_version_number       in number) is
256   --
257   l_proc         varchar2(72) := g_package||'chk_addl_withholding_flag';
258   l_api_updating boolean;
259   --
260 Begin
261   --
262   hr_utility.set_location('Entering:'||l_proc, 5);
263   --
264   l_api_updating := pqp_atd_shd.api_updating
265     (p_alien_transaction_id                => p_alien_transaction_id,
266      p_object_version_number       => p_object_version_number);
267   --
268   if (l_api_updating
269       and p_addl_withholding_flag
270       <> nvl(pqp_atd_shd.g_old_rec.addl_withholding_flag,hr_api.g_varchar2)
271       or not l_api_updating)
272       and p_addl_withholding_flag is not null then
273     --
274     -- check if value of lookup falls within lookup type.
275     --
276     if hr_api.not_exists_in_hr_lookups
277           (p_lookup_type    => 'PQH_YES_NO'            ,
278            p_lookup_code    => p_addl_withholding_flag,
279            p_effective_date => p_effective_date) then
280 /*      --
281       -- raise error as does not exist as lookup
282       --
283       hr_utility.set_message(801,'HR_LOOKUP_DOES_NOT_EXIST');
284       hr_utility.raise_error;
285       --  */
286 
287       -- Append the error message to the g_error_message
288 
289         g_error_message := g_error_message || '(' ||
290                                'addl_withholding_flag = ' ||
291                                p_addl_withholding_flag || ' is invalid )';
292     end if;
293     --
294   end if;
295   --
296   hr_utility.set_location('Leaving:'||l_proc,10);
297   --
298 end chk_addl_withholding_flag;
299 --
300 -- ----------------------------------------------------------------------------
301 -- |------< chk_retro_lose_ben_date_flag >------|
302 -- ----------------------------------------------------------------------------
303 --
304 -- Description
305 --   This procedure is used to check that the lookup value is valid.
306 --
307 -- Pre Conditions
308 --   None.
309 --
310 -- In Parameters
311 --   alien_transaction_id PK of record being inserted or updated.
312 --   retro_lose_ben_date_flag Value of lookup code.
313 --   effective_date effective date
314 --   object_version_number Object version number of record being
315 --                         inserted or updated.
316 --
317 -- Post Success
318 --   Processing continues
319 --
320 -- Post Failure
321 --   Error handled by procedure
322 --
323 -- Access Status
324 --   Internal table handler use only.
325 --
326 Procedure chk_retro_lose_ben_date_flag(p_alien_transaction_id                in number,
327                             p_retro_lose_ben_date_flag               in varchar2,
328                             p_effective_date              in date,
329                             p_object_version_number       in number) is
330   --
331   l_proc         varchar2(72) := g_package||'chk_retro_lose_ben_date_flag';
332   l_api_updating boolean;
333   --
334 Begin
335   --
336   hr_utility.set_location('Entering:'||l_proc, 5);
337   --
338   l_api_updating := pqp_atd_shd.api_updating
339     (p_alien_transaction_id                => p_alien_transaction_id,
340      p_object_version_number       => p_object_version_number);
341   --
342   if (l_api_updating
343       and p_retro_lose_ben_date_flag
344       <> nvl(pqp_atd_shd.g_old_rec.retro_lose_ben_date_flag,hr_api.g_varchar2)
345       or not l_api_updating)
346       and p_retro_lose_ben_date_flag is not null then
347     --
348     -- check if value of lookup falls within lookup type.
349     --
350     if hr_api.not_exists_in_hr_lookups
351           (p_lookup_type    => 'PQH_YES_NO'               ,
352            p_lookup_code    => p_retro_lose_ben_date_flag,
353            p_effective_date => p_effective_date) then
354 /*      --
355       -- raise error as does not exist as lookup
356       --
357       hr_utility.set_message(801,'HR_LOOKUP_DOES_NOT_EXIST');
358       hr_utility.raise_error;
359       --  */
360 
361       -- Append the error message to the g_error_message
362 
363         g_error_message := g_error_message || '(' ||
364                                'retro_lose_ben_date_flag  = ' ||
365                                p_retro_lose_ben_date_flag || ' is invalid )';
366     end if;
367     --
368   end if;
369   --
370   hr_utility.set_location('Leaving:'||l_proc,10);
371   --
372 end chk_retro_lose_ben_date_flag;
373 --
374 -- ----------------------------------------------------------------------------
375 -- |------< chk_retro_lose_ben_amt_flag >------|
376 -- ----------------------------------------------------------------------------
377 --
378 -- Description
379 --   This procedure is used to check that the lookup value is valid.
380 --
381 -- Pre Conditions
382 --   None.
383 --
384 -- In Parameters
385 --   alien_transaction_id PK of record being inserted or updated.
386 --   retro_lose_ben_amt_flag Value of lookup code.
387 --   effective_date effective date
391 -- Post Success
388 --   object_version_number Object version number of record being
389 --                         inserted or updated.
390 --
392 --   Processing continues
393 --
394 -- Post Failure
395 --   Error handled by procedure
396 --
397 -- Access Status
398 --   Internal table handler use only.
399 --
400 Procedure chk_retro_lose_ben_amt_flag(p_alien_transaction_id                in number,
401                             p_retro_lose_ben_amt_flag               in varchar2,
402                             p_effective_date              in date,
403                             p_object_version_number       in number) is
404   --
405   l_proc         varchar2(72) := g_package||'chk_retro_lose_ben_amt_flag';
406   l_api_updating boolean;
407   --
408 Begin
409   --
410   hr_utility.set_location('Entering:'||l_proc, 5);
411   --
412   l_api_updating := pqp_atd_shd.api_updating
413     (p_alien_transaction_id                => p_alien_transaction_id,
414      p_object_version_number       => p_object_version_number);
415   --
416   if (l_api_updating
417       and p_retro_lose_ben_amt_flag
418       <> nvl(pqp_atd_shd.g_old_rec.retro_lose_ben_amt_flag,hr_api.g_varchar2)
419       or not l_api_updating)
420       and p_retro_lose_ben_amt_flag is not null then
421     --
422     -- check if value of lookup falls within lookup type.
423     --
424     if hr_api.not_exists_in_hr_lookups
425           (p_lookup_type    => 'PQH_YES_NO'              ,
426            p_lookup_code    => p_retro_lose_ben_amt_flag,
427            p_effective_date => p_effective_date) then
428 /*      --
429       -- raise error as does not exist as lookup
430       --
431       hr_utility.set_message(801,'HR_LOOKUP_DOES_NOT_EXIST');
432       hr_utility.raise_error;
433       --  */
434 
435       -- Append the error message to the g_error_message
436 
437         g_error_message := g_error_message || '(' ||
438                                'retro_lose_ben_amt_flag  = ' ||
439                                p_retro_lose_ben_amt_flag || ' is invalid )';
440     end if;
441     --
442   end if;
443   --
444   hr_utility.set_location('Leaving:'||l_proc,10);
445   --
446 end chk_retro_lose_ben_amt_flag;
447 --
448 -- ----------------------------------------------------------------------------
449 -- |------< chk_state_honors_treaty_flag >------|
450 -- ----------------------------------------------------------------------------
451 --
452 -- Description
453 --   This procedure is used to check that the lookup value is valid.
454 --
455 -- Pre Conditions
456 --   None.
457 --
458 -- In Parameters
459 --   alien_transaction_id PK of record being inserted or updated.
460 --   state_honors_treaty_flag Value of lookup code.
461 --   effective_date effective date
462 --   object_version_number Object version number of record being
463 --                         inserted or updated.
464 --
465 -- Post Success
466 --   Processing continues
467 --
468 -- Post Failure
469 --   Error handled by procedure
470 --
471 -- Access Status
472 --   Internal table handler use only.
473 --
474 Procedure chk_state_honors_treaty_flag(p_alien_transaction_id                in number,
475                             p_state_honors_treaty_flag               in varchar2,
476                             p_effective_date              in date,
477                             p_object_version_number       in number) is
478   --
479   l_proc         varchar2(72) := g_package||'chk_state_honors_treaty_flag';
480   l_api_updating boolean;
481   --
482 Begin
483   --
484   hr_utility.set_location('Entering:'||l_proc, 5);
485   --
486   l_api_updating := pqp_atd_shd.api_updating
487     (p_alien_transaction_id                => p_alien_transaction_id,
488      p_object_version_number       => p_object_version_number);
489   --
490   if (l_api_updating
491       and p_state_honors_treaty_flag
492       <> nvl(pqp_atd_shd.g_old_rec.state_honors_treaty_flag,hr_api.g_varchar2)
493       or not l_api_updating)
494       and p_state_honors_treaty_flag is not null then
495     --
496     -- check if value of lookup falls within lookup type.
497     --
498     if hr_api.not_exists_in_hr_lookups
499           (p_lookup_type    => 'PQH_YES_NO'               ,
500            p_lookup_code    => p_state_honors_treaty_flag,
501            p_effective_date => p_effective_date) then
502 /*      --
503       -- raise error as does not exist as lookup
504       --
505       hr_utility.set_message(801,'HR_LOOKUP_DOES_NOT_EXIST');
506       hr_utility.raise_error;
507       --  */
508       -- Append the error message to the g_error_message
509 
510         g_error_message := g_error_message || '(' ||
511                                'state_honors_treaty_flag  = ' ||
512                                p_state_honors_treaty_flag || ' is invalid )';
513     end if;
514     --
515   end if;
516   --
517   hr_utility.set_location('Leaving:'||l_proc,10);
518   --
519 end chk_state_honors_treaty_flag;
520 --
521 -- ----------------------------------------------------------------------------
522 -- |------< chk_student_exempt_from_fica >------|
526 --   This procedure is used to check that the lookup value is valid.
523 -- ----------------------------------------------------------------------------
524 --
525 -- Description
527 --
528 -- Pre Conditions
529 --   None.
530 --
531 -- In Parameters
532 --   alien_transaction_id PK of record being inserted or updated.
533 --   student_exempt_from_fica Value of lookup code.
534 --   effective_date effective date
535 --   object_version_number Object version number of record being
536 --                         inserted or updated.
537 --
538 -- Post Success
539 --   Processing continues
540 --
541 -- Post Failure
542 --   Error handled by procedure
543 --
544 -- Access Status
545 --   Internal table handler use only.
546 --
547 PROCEDURE chk_student_exempt_from_fica(p_alien_transaction_id    in number   ,
548                                       p_student_exempt_from_fica in varchar2 ,
549                                       p_effective_date          in date     ,
550                                       p_object_version_number   in number   ) IS
551   --
552   l_proc         VARCHAR2(72) := g_package||'chk_student_exempt_from_fica';
553   l_api_updating BOOLEAN;
554   --
555 BEGIN
556   --
557     hr_utility.set_location('Entering:'||l_proc, 5);
558   --
559     l_api_updating := pqp_atd_shd.api_updating
560                         (p_alien_transaction_id   => p_alien_transaction_id,
561                          p_object_version_number  => p_object_version_number);
562   --
563     IF (l_api_updating            AND
564         p_student_exempt_from_fica
565          <> NVL(pqp_atd_shd.g_old_rec.student_exempt_from_fica,hr_api.g_varchar2)
566        OR NOT l_api_updating)
567        AND p_student_exempt_from_fica IS NOT NULL THEN
568     --
569     -- check if value of lookup falls within lookup type.
570     --
571         IF hr_api.not_exists_in_hr_lookups
572             (p_lookup_type    => 'PQH_YES_NO'                ,
573              p_lookup_code    => p_student_exempt_from_fica ,
574              p_effective_date => p_effective_date          ) THEN
575 /*      --
576       -- raise error as does not exist as lookup
577       --
578           hr_utility.set_message(801,'HR_LOOKUP_DOES_NOT_EXIST');
579           hr_utility.raise_error;
580       --  */
581       -- Append the error message to the g_error_message
582 
583         g_error_message := g_error_message || '(' ||
584                                'student_exempt_from_fica  = ' ||
585                                p_student_exempt_from_fica || ' is invalid )';
586         END IF;
587     --
588     END IF;
589   --
590   hr_utility.set_location('Leaving:'||l_proc,10);
591   --
592 END chk_student_exempt_from_fica;
593 --
594 -- |------< chk_nra_exempt_from_fica >------|
595 -- ----------------------------------------------------------------------------
596 --
597 -- Description
598 --   This procedure is used to check that the lookup value is valid.
599 --
600 -- Pre Conditions
601 --   None.
602 --
603 -- In Parameters
604 --   alien_transaction_id PK of record being inserted or updated.
605 --   nra_exempt_from_fica Value of lookup code.
606 --   effective_date effective date
607 --   object_version_number Object version number of record being
608 --                         inserted or updated.
609 --
610 -- Post Success
611 --   Processing continues
612 --
613 -- Post Failure
614 --   Error handled by procedure
615 --
616 -- Access Status
617 --   Internal table handler use only.
618 --
619 PROCEDURE chk_nra_exempt_from_fica(p_alien_transaction_id    in number ,
620                                    p_nra_exempt_from_fica in varchar2  ,
621                                    p_effective_date          in date   ,
622                                    p_object_version_number   in number ) IS
623   --
624   l_proc         VARCHAR2(72) := g_package||'chk_nra_exempt_from_fica';
625   l_api_updating BOOLEAN;
626   --
627 BEGIN
628   --
629     hr_utility.set_location('Entering:'||l_proc, 5);
630   --
631     l_api_updating := pqp_atd_shd.api_updating
632                         (p_alien_transaction_id   => p_alien_transaction_id,
633                          p_object_version_number  => p_object_version_number);
634   --
635     IF (l_api_updating            AND
636         p_nra_exempt_from_fica
637          <> NVL(pqp_atd_shd.g_old_rec.nra_exempt_from_fica,hr_api.g_varchar2)
638        OR NOT l_api_updating)
639        AND p_nra_exempt_from_fica IS NOT NULL THEN
640     --
641     -- check if value of lookup falls within lookup type.
642     --
643         IF hr_api.not_exists_in_hr_lookups
644             (p_lookup_type    => 'PQH_YES_NO'            ,
645              p_lookup_code    => p_nra_exempt_from_fica ,
646              p_effective_date => p_effective_date       ) THEN
647 /*      --
648       -- raise error as does not exist as lookup
649       --
650           hr_utility.set_message(801,'HR_LOOKUP_DOES_NOT_EXIST');
651           hr_utility.raise_error;
652       --  */
653 
654       -- Append the error message to the g_error_message
655 
656         g_error_message := g_error_message || '(' ||
660     --
657                                'nra_exempt_from_fica = ' ||
658                                p_nra_exempt_from_fica || ' is invalid )';
659         END IF;
661     END IF;
662   --
663   hr_utility.set_location('Leaving:'||l_proc,10);
664   --
665 END chk_nra_exempt_from_fica;
666 -- ----------------------------------------------------------------------------
667 -- |------< chk_income_code >------|
668 -- ----------------------------------------------------------------------------
669 --
670 -- Description
671 --   This procedure is used to check that the lookup value is valid.
672 --
673 -- Pre Conditions
674 --   None.
675 --
676 -- In Parameters
677 --   alien_transaction_id PK of record being inserted or updated.
678 --   wthldg_allow_eligible_flag Value of lookup code.
679 --   effective_date effective date
680 --   object_version_number Object version number of record being
681 --                         inserted or updated.
682 --
683 -- Post Success
684 --   Processing continues
685 --
686 -- Post Failure
687 --   Error handled by procedure
688 --
689 -- Access Status
690 --   Internal table handler use only.
691 --
692 PROCEDURE chk_income_code(p_alien_transaction_id     IN NUMBER   ,
693                           p_income_code              IN VARCHAR2 ,
694                           p_effective_date           IN DATE     ,
695                           p_object_version_number    IN NUMBER   ) IS
696   --
697   l_proc         VARCHAR2(72) := g_package||'chk_income_code';
698   l_api_updating BOOLEAN;
699   --
700 BEGIN
701   --
702     hr_utility.set_location('Entering:'||l_proc, 5);
703   --
704     l_api_updating := pqp_atd_shd.api_updating
705                       (p_alien_transaction_id   => p_alien_transaction_id ,
706                        p_object_version_number  => p_object_version_number);
707   --
708     IF (l_api_updating AND
709         p_income_code
710           <> nvl(pqp_atd_shd.g_old_rec.income_code, hr_api.g_varchar2)
711         OR NOT l_api_updating)
712         AND p_income_code IS NOT NULL THEN
713     --
714     -- check if value of lookup falls within lookup type.
715     --
716         IF hr_api.not_exists_in_hr_lookups
717             (p_lookup_type    => 'PER_US_INCOME_TYPES' ,
718              p_lookup_code    => p_income_code         ,
719              p_effective_date => p_effective_date      )  THEN
720 /*      --
721       -- raise error as does not exist as lookup
722       --
723             hr_utility.set_message(801,'HR_LOOKUP_DOES_NOT_EXIST');
724             hr_utility.raise_error;
725       --  */
726       -- Append the error message to the g_error_message
727 
728         g_error_message := g_error_message || '(' ||
729                                'income_code = ' ||
730                                p_income_code || ' is invalid )';
731         END IF;
732     --
733     END IF;
734   --
735     hr_utility.set_location('Leaving:'||l_proc,10);
736   --
737 END chk_income_code;
738 --
739 -- ----------------------------------------------------------------------------
740 -- |------< chk_income_code_sub_type >------|
741 -- ----------------------------------------------------------------------------
742 --
743 -- Description
744 --   This procedure is used to check that the lookup value is valid.
745 --
746 -- Pre Conditions
747 --   None.
748 --
749 -- In Parameters
750 --   alien_transaction_id PK of record being inserted or updated.
751 --   wthldg_allow_eligible_flag Value of lookup code.
752 --   effective_date effective date
753 --   object_version_number Object version number of record being
754 --                         inserted or updated.
755 --
756 -- Post Success
757 --   Processing continues
758 --
759 -- Post Failure
760 --   Error handled by procedure
761 --
762 -- Access Status
763 --   Internal table handler use only.
764 --
765 PROCEDURE chk_income_code_sub_type(p_alien_transaction_id  IN NUMBER   ,
766                                    p_income_code_sub_type  IN VARCHAR2 ,
767                                    p_effective_date        IN DATE     ,
768                                    p_object_version_number IN NUMBER   ) IS
769   --
770   l_proc         VARCHAR2(72) := g_package||'chk_income_code_sub_type';
771   l_api_updating BOOLEAN;
772   --
773 BEGIN
774   --
775     hr_utility.set_location('Entering:'||l_proc, 5);
776   --
777     l_api_updating := pqp_atd_shd.api_updating
778                       (p_alien_transaction_id   => p_alien_transaction_id ,
779                        p_object_version_number  => p_object_version_number);
780   --
781     IF (l_api_updating AND
782         p_income_code_sub_type
783           <> nvl(pqp_atd_shd.g_old_rec.income_code_sub_type, hr_api.g_varchar2)
784         OR NOT l_api_updating)
785         AND p_income_code_sub_type IS NOT NULL THEN
786     --
787     -- check if value of lookup falls within lookup type.
788     --
789         IF hr_api.not_exists_in_hr_lookups
790             (p_lookup_type    => 'PQP_US_INCOME_CODE_SUB_TYPE',
791              p_lookup_code    => p_income_code_sub_type       ,
795       --
792              p_effective_date => p_effective_date             ) THEN
793 /*      --
794       -- raise error as does not exist as lookup
796             hr_utility.set_message(801,'HR_LOOKUP_DOES_NOT_EXIST');
797             hr_utility.raise_error;
798       --  */
799 
800       -- Append the error message to the g_error_message
801 
802         g_error_message := g_error_message || '(' ||
803                                'income_code_sub_type = ' ||
804                                p_income_code_sub_type || ' is invalid )';
805         END IF;
806     --
807     END IF;
808   --
809     hr_utility.set_location('Leaving:'||l_proc,10);
810   --
811 END chk_income_code_sub_type;
812 --
813 -- ----------------------------------------------------------------------------
814 -- |------< chk_exemption_code >------|
815 -- ----------------------------------------------------------------------------
816 --
817 -- Description
818 --   This procedure is used to check that the lookup value is valid.
819 --
820 -- Pre Conditions
821 --   None.
822 --
823 -- In Parameters
824 --   alien_transaction_id PK of record being inserted or updated.
825 --   wthldg_allow_eligible_flag Value of lookup code.
826 --   effective_date effective date
827 --   object_version_number Object version number of record being
828 --                         inserted or updated.
829 --
830 -- Post Success
831 --   Processing continues
832 --
833 -- Post Failure
834 --   Error handled by procedure
835 --
836 -- Access Status
837 --   Internal table handler use only.
838 --
839 PROCEDURE chk_exemption_code(p_alien_transaction_id  IN NUMBER   ,
840                              p_exemption_code        IN VARCHAR2 ,
841                              p_effective_date        IN DATE     ,
842                              p_object_version_number IN NUMBER   ) IS
843   --
844   l_proc         VARCHAR2(72) := g_package||'chk_exemption_code';
845   l_api_updating BOOLEAN;
846   --
847 BEGIN
848   --
849     hr_utility.set_location('Entering:'||l_proc, 5);
850   --
851     l_api_updating := pqp_atd_shd.api_updating
852                       (p_alien_transaction_id   => p_alien_transaction_id ,
853                        p_object_version_number  => p_object_version_number);
854   --
855     IF (l_api_updating AND
856         p_exemption_code
857           <> nvl(pqp_atd_shd.g_old_rec.exemption_code, hr_api.g_varchar2)
858         OR NOT l_api_updating)
859         AND p_exemption_code IS NOT NULL THEN
860     --
861     -- check if value of lookup falls within lookup type.
862     --
863         IF hr_api.not_exists_in_hr_lookups
864             (p_lookup_type    => 'PQP_US_EXEMPTION_CODE' ,
865              p_lookup_code    => p_exemption_code        ,
866              p_effective_date => p_effective_date        ) THEN
867 /*      --
868       -- raise error as does not exist as lookup
869       --
870             hr_utility.set_message(801,'HR_LOOKUP_DOES_NOT_EXIST');
871             --app_exception.raise_exception;
872             hr_utility.raise_error;
873       --  */
874 
875       -- Append the error message to the g_error_message
876 
877         g_error_message := g_error_message || '(' ||
878                                'exemption_code = ' ||
879                                p_exemption_code || ' is invalid )';
880         END IF;
881     --
882     END IF;
883   --
884     hr_utility.set_location('Leaving:'||l_proc,10);
885   --
886 END chk_exemption_code;
887 --
888 -- ----------------------------------------------------------------------------
889 -- |------< chk_current_residency_status >------|
890 -- ----------------------------------------------------------------------------
891 --
892 -- Description
893 --   This procedure is used to check that the lookup value is valid.
894 --
895 -- Pre Conditions
896 --   None.
897 --
898 -- In Parameters
899 --   alien_transaction_id PK of record being inserted or updated.
900 --   wthldg_allow_eligible_flag Value of lookup code.
901 --   effective_date effective date
902 --   object_version_number Object version number of record being
903 --                         inserted or updated.
904 --
905 -- Post Success
906 --   Processing continues
907 --
908 -- Post Failure
909 --   Error handled by procedure
910 --
911 -- Access Status
912 --   Internal table handler use only.
913 --
914 PROCEDURE chk_current_residency_status(p_alien_transaction_id     IN NUMBER   ,
915                                        p_current_residency_status IN VARCHAR2 ,
916                                        p_effective_date           IN DATE     ,
917                                        p_object_version_number    IN NUMBER   ) IS
918   --
919   l_proc         VARCHAR2(72) := g_package||'chk_current_residency_status';
920   l_api_updating BOOLEAN;
921   --
922 BEGIN
923   --
924     hr_utility.set_location('Entering:'||l_proc, 5);
925   --
926     l_api_updating := pqp_atd_shd.api_updating
927                       (p_alien_transaction_id   => p_alien_transaction_id ,
928                        p_object_version_number  => p_object_version_number);
929   --
933         OR NOT l_api_updating)
930     IF (l_api_updating AND
931         p_current_residency_status
932           <> nvl(pqp_atd_shd.g_old_rec.current_residency_status, hr_api.g_varchar2)
934         AND p_current_residency_status IS NOT NULL THEN
935     --
936     -- check if value of lookup falls within lookup type.
937     --
938         IF hr_api.not_exists_in_hr_lookups
939             (p_lookup_type    => 'PER_US_RES_STATUS'         ,
940              p_lookup_code    => p_current_residency_status  ,
941              p_effective_date => p_effective_date            ) THEN
942 /*      --
943       -- raise error as does not exist as lookup
944       --
945             hr_utility.set_message(801,'HR_LOOKUP_DOES_NOT_EXIST');
946             hr_utility.raise_error;
947       --  */
948 
949       -- Append the error message to the g_error_message
950 
951         g_error_message := g_error_message || '(' ||
952                                'current_residency_status = ' ||
953                                p_current_residency_status || ' is invalid )';
954         END IF;
955     --
956     END IF;
957   --
958     hr_utility.set_location('Leaving:'||l_proc,10);
959   --
960 END chk_current_residency_status;
961 --
962 -- ----------------------------------------------------------------------------
963 -- |------< chk_tax_residence_country_code >------|
964 -- ----------------------------------------------------------------------------
965 --
966 -- Description
967 --   This procedure is used to check that the lookup value is valid.
968 --
969 -- Pre Conditions
970 --   None.
971 --
972 -- In Parameters
973 --   alien_transaction_id PK of record being inserted or updated.
974 --   wthldg_allow_eligible_flag Value of lookup code.
975 --   effective_date effective date
976 --   object_version_number Object version number of record being
977 --                         inserted or updated.
978 --
979 -- Post Success
980 --   Processing continues
981 --
982 -- Post Failure
983 --   Error handled by procedure
984 --
985 -- Access Status
986 --   Internal table handler use only.
987 --
988 PROCEDURE chk_tax_residence_country_code(p_alien_transaction_id       IN NUMBER,
989                                          p_tax_residence_country_code IN VARCHAR2 ,
990                                          p_effective_date             IN DATE  ,
991                                          p_object_version_number      IN NUMBER) IS
992   --
993   l_proc         VARCHAR2(72) := g_package||'chk_tax_residence_country_code';
994   l_api_updating BOOLEAN;
995   --
996 BEGIN
997   --
998     hr_utility.set_location('Entering:'||l_proc, 5);
999   --
1000     l_api_updating := pqp_atd_shd.api_updating
1001                       (p_alien_transaction_id   => p_alien_transaction_id ,
1002                        p_object_version_number  => p_object_version_number);
1003   --
1004     IF (l_api_updating AND
1005         p_tax_residence_country_code
1006           <> nvl(pqp_atd_shd.g_old_rec.tax_residence_country_code, hr_api.g_varchar2)
1007         OR NOT l_api_updating)
1008         AND p_tax_residence_country_code IS NOT NULL THEN
1009     --
1010     -- check if value of lookup falls within lookup type.
1011     --
1012         IF hr_api.not_exists_in_hr_lookups
1013             (p_lookup_type    => 'PER_US_COUNTRY_CODE'         ,
1014              p_lookup_code    => p_tax_residence_country_code  ,
1015              p_effective_date => p_effective_date              ) THEN
1016 /*      --
1017       -- raise error as does not exist as lookup
1018       --
1019             hr_utility.set_message(801,'HR_LOOKUP_DOES_NOT_EXIST');
1020             hr_utility.raise_error;
1021       --  */
1022 
1023       -- Append the error message to the g_error_message
1024 
1025         g_error_message := g_error_message || '(' ||
1026                                'tax_residence_country_code = ' ||
1027                                p_tax_residence_country_code || ' is invalid )';
1028         END IF;
1029     --
1030     END IF;
1031   --
1032     hr_utility.set_location('Leaving:'||l_proc,10);
1033   --
1034 END chk_tax_residence_country_code;
1035 --
1036 -- ----------------------------------------------------------------------------
1037 -- |------< chk_addl_wthldng_amt_period >------|
1038 -- ----------------------------------------------------------------------------
1039 --
1040 -- Description
1041 --   This procedure is used to check that the lookup value is valid.
1042 --
1043 -- Pre Conditions
1044 --   None.
1045 --
1046 -- In Parameters
1047 --   alien_transaction_id PK of record being inserted or updated.
1048 --   wthldg_allow_eligible_flag Value of lookup code.
1049 --   effective_date effective date
1050 --   object_version_number Object version number of record being
1051 --                         inserted or updated.
1052 --
1053 -- Post Success
1054 --   Processing continues
1055 --
1056 -- Post Failure
1057 --   Error handled by procedure
1058 --
1059 -- Access Status
1060 --   Internal table handler use only.
1061 --
1062 PROCEDURE chk_addtnl_wthldng_amt_period(p_alien_transaction_id      IN NUMBER  ,
1063                                         p_addtnl_wthldng_amt_period IN VARCHAR2,
1067   l_proc         VARCHAR2(72) := g_package||'chk_addtnl_wthldng_amt_period';
1064                                         p_effective_date            IN DATE    ,
1065                                         p_object_version_number     IN NUMBER  ) IS
1066   --
1068   l_api_updating BOOLEAN;
1069   --
1070 BEGIN
1071   --
1072     hr_utility.set_location('Entering:'||l_proc, 5);
1073   --
1074     l_api_updating := pqp_atd_shd.api_updating
1075                       (p_alien_transaction_id   => p_alien_transaction_id ,
1076                        p_object_version_number  => p_object_version_number);
1077   --
1078     IF (l_api_updating AND
1079         p_addtnl_wthldng_amt_period
1080           <> nvl(pqp_atd_shd.g_old_rec.addl_wthldng_amt_period_type, hr_api.g_varchar2)
1081         OR NOT l_api_updating)
1082         AND p_addtnl_wthldng_amt_period IS NOT NULL THEN
1083     --
1084     -- check if value of lookup falls within lookup type.
1085     --
1086         IF hr_api.not_exists_in_hr_lookups
1087             (p_lookup_type    => 'PROC_PERIOD_TYPE'          ,
1088              p_lookup_code    => p_addtnl_wthldng_amt_period ,
1089              p_effective_date => p_effective_date            ) THEN
1090 /*      --
1091       -- raise error as does not exist as lookup
1092       --
1093             hr_utility.set_message(801,'HR_LOOKUP_DOES_NOT_EXIST');
1094             hr_utility.raise_error;
1095       --  */
1096 
1097       -- Append the error message to the g_error_message
1098 
1099         g_error_message := g_error_message || '(' ||
1100                                'addl_wthldng_amt_period_type = ' ||
1101                                p_addtnl_wthldng_amt_period || ' is invalid )';
1102         END IF;
1103     --
1104     END IF;
1105   --
1106     hr_utility.set_location('Leaving:'||l_proc,10);
1107   --
1108 END chk_addtnl_wthldng_amt_period;
1109 -- ----------------------------------------------------------------------------
1110 -- |------< chk_state_code >------|
1111 -- ----------------------------------------------------------------------------
1112 --
1113 -- Description
1114 --   This procedure is used to check that the lookup value is valid.
1115 --
1116 -- Pre Conditions
1117 --   None.
1118 --
1119 -- In Parameters
1120 --   alien_transaction_id PK of record being inserted or updated.
1121 --   wthldg_allow_eligible_flag Value of lookup code.
1122 --   effective_date effective date
1123 --   object_version_number Object version number of record being
1124 --                         inserted or updated.
1125 --
1126 -- Post Success
1127 --   Processing continues
1128 --
1129 -- Post Failure
1130 --   Error handled by procedure
1131 --
1132 -- Access Status
1133 --   Internal table handler use only.
1134 --
1135 PROCEDURE chk_state_code(p_alien_transaction_id     IN NUMBER   ,
1136                          p_state_code               IN VARCHAR2 ,
1137                          p_effective_date           IN DATE     ,
1138                          p_object_version_number    IN NUMBER   ) IS
1139   --
1140   l_proc         VARCHAR2(72) := g_package||'chk_state_code';
1141   l_api_updating BOOLEAN;
1142   --
1143 BEGIN
1144   --
1145     hr_utility.set_location('Entering:'||l_proc, 5);
1146   --
1147     l_api_updating := pqp_atd_shd.api_updating
1148                       (p_alien_transaction_id   => p_alien_transaction_id ,
1149                        p_object_version_number  => p_object_version_number);
1150   --
1151     IF (l_api_updating AND
1152         p_state_code
1153           <> nvl(pqp_atd_shd.g_old_rec.state_code, hr_api.g_varchar2)
1154         OR NOT l_api_updating)
1155         AND p_state_code IS NOT NULL THEN
1156     --
1157     -- check if value of lookup falls within lookup type.
1158     --
1159         IF hr_api.not_exists_in_hr_lookups
1160             (p_lookup_type    => 'US_STATE'        ,
1161              p_lookup_code    => p_state_code      ,
1162              p_effective_date => p_effective_date  ) THEN
1163 /*      --
1164       -- raise error as does not exist as lookup
1165       --
1166             hr_utility.set_message(801,'HR_LOOKUP_DOES_NOT_EXIST');
1167             hr_utility.raise_error;
1168       --  */
1169       -- Append the error message to the g_error_message
1170 
1171         g_error_message := g_error_message || '(' ||
1172                                'state_code = ' ||
1173                                p_state_code || ' is invalid )';
1174         END IF;
1175     --
1176     END IF;
1177   --
1178     hr_utility.set_location('Leaving:'||l_proc,10);
1179   --
1180 END chk_state_code;
1181 --
1182 -- ----------------------------------------------------------------------------
1183 -- |------< chk_record_source >------|
1184 -- ----------------------------------------------------------------------------
1185 --
1186 -- Description
1187 --   This procedure is used to check that the lookup value is valid.
1188 --
1189 -- Pre Conditions
1190 --   None.
1191 --
1192 -- In Parameters
1193 --   alien_transaction_id PK of record being inserted or updated.
1194 --   wthldg_allow_eligible_flag Value of lookup code.
1195 --   effective_date effective date
1196 --   object_version_number Object version number of record being
1197 --                         inserted or updated.
1201 --
1198 --
1199 -- Post Success
1200 --   Processing continues
1202 -- Post Failure
1203 --   Error handled by procedure
1204 --
1205 -- Access Status
1206 --   Internal table handler use only.
1207 --
1208 PROCEDURE chk_record_source(p_alien_transaction_id   IN NUMBER   ,
1209                             p_record_source          IN VARCHAR2 ,
1210                             p_effective_date         IN DATE     ,
1211                             p_object_version_number  IN NUMBER   ) IS
1212   --
1213   l_proc         VARCHAR2(72) := g_package||'chk_record_source';
1214   l_api_updating BOOLEAN;
1215   --
1216 BEGIN
1217   --
1218     hr_utility.set_location('Entering:'||l_proc, 5);
1219   --
1220     l_api_updating := pqp_atd_shd.api_updating
1221                       (p_alien_transaction_id   => p_alien_transaction_id ,
1222                        p_object_version_number  => p_object_version_number);
1223   --
1224     IF (l_api_updating AND
1225         p_record_source
1226          <> nvl(pqp_atd_shd.g_old_rec.record_source, hr_api.g_varchar2)
1227         OR NOT l_api_updating)
1228         AND p_record_source IS NOT NULL THEN
1229     --
1230     -- check if value of lookup falls within lookup type.
1231     --
1232         IF hr_api.not_exists_in_hr_lookups
1233             (p_lookup_type    => 'PQP_US_RECORD_SOURCE' ,
1234              p_lookup_code    => p_record_source        ,
1235              p_effective_date => p_effective_date       ) THEN
1236 /*      --
1237       -- raise error as does not exist as lookup
1238       --
1239             hr_utility.set_message(801,'HR_LOOKUP_DOES_NOT_EXIST');
1240             hr_utility.raise_error;
1241       --  */
1242 
1243       -- Append the error message to the g_error_message
1244 
1245         g_error_message := g_error_message || '(' ||
1246                                'record_source = ' ||
1247                                p_record_source || ' is invalid )';
1248         END IF;
1249     --
1250     END IF;
1251   --
1252     hr_utility.set_location('Leaving:'||l_proc,10);
1253   --
1254 END chk_record_source;
1255 --
1256 -- ----------------------------------------------------------------------------
1257 -- |------< chk_visa_type >------|
1258 -- ----------------------------------------------------------------------------
1259 --
1260 -- Description
1261 --   This procedure is used to check that the lookup value is valid.
1262 --
1263 -- Pre Conditions
1264 --   None.
1265 --
1266 -- In Parameters
1267 --   alien_transaction_id PK of record being inserted or updated.
1268 --   wthldg_allow_eligible_flag Value of lookup code.
1269 --   effective_date effective date
1270 --   object_version_number Object version number of record being
1271 --                         inserted or updated.
1272 --
1273 -- Post Success
1274 --   Processing continues
1275 --
1276 -- Post Failure
1277 --   Error handled by procedure
1278 --
1279 -- Access Status
1280 --   Internal table handler use only.
1281 --
1282 PROCEDURE chk_visa_type(p_alien_transaction_id  IN NUMBER   ,
1283                         p_visa_type             IN VARCHAR2 ,
1284                         p_effective_date        IN DATE     ,
1285                         p_object_version_number IN NUMBER   ) IS
1286   --
1287   l_proc         VARCHAR2(72) := g_package||'chk_visa_type';
1288   l_api_updating BOOLEAN;
1289   --
1290 BEGIN
1291   --
1292     hr_utility.set_location('Entering:'||l_proc, 5);
1293   --
1294     l_api_updating := pqp_atd_shd.api_updating
1295                       (p_alien_transaction_id   => p_alien_transaction_id ,
1296                        p_object_version_number  => p_object_version_number);
1297   --
1298     IF (l_api_updating AND
1299         p_visa_type
1300           <> nvl(pqp_atd_shd.g_old_rec.visa_type, hr_api.g_varchar2)
1301         OR NOT l_api_updating)
1302         AND p_visa_type IS NOT NULL THEN
1303     --
1304     -- check if value of lookup falls within lookup type.
1305     --
1306         IF hr_api.not_exists_in_hr_lookups
1307             (p_lookup_type    => 'PER_US_VISA_TYPES' ,
1308              p_lookup_code    => p_visa_type         ,
1309              p_effective_date => p_effective_date    ) THEN
1310 /*      --
1311       -- raise error as does not exist as lookup
1312       --
1313             hr_utility.set_message(801,'HR_LOOKUP_DOES_NOT_EXIST');
1314             hr_utility.raise_error;
1315       --  */
1316 
1317       -- Append the error message to the g_error_message
1318 
1319         g_error_message := g_error_message || '(' ||
1320                                'visa_type = ' ||
1321                                p_visa_type || ' is invalid )';
1322         END IF;
1323     --
1324     END IF;
1325   --
1326     hr_utility.set_location('Leaving:'||l_proc,10);
1327   --
1328 END chk_visa_type;
1329 --
1330 -- ----------------------------------------------------------------------------
1331 -- |------< chk_j_sub_type >------|
1332 -- ----------------------------------------------------------------------------
1333 --
1334 -- Description
1335 --   This procedure is used to check that the lookup value is valid.
1336 --
1337 -- Pre Conditions
1338 --   None.
1339 --
1340 -- In Parameters
1344 --   object_version_number Object version number of record being
1341 --   alien_transaction_id PK of record being inserted or updated.
1342 --   wthldg_allow_eligible_flag Value of lookup code.
1343 --   effective_date effective date
1345 --                         inserted or updated.
1346 --
1347 -- Post Success
1348 --   Processing continues
1349 --
1350 -- Post Failure
1351 --   Error handled by procedure
1352 --
1353 -- Access Status
1354 --   Internal table handler use only.
1355 --
1356 PROCEDURE chk_j_sub_type(p_alien_transaction_id   IN NUMBER   ,
1357                          p_j_sub_type             IN VARCHAR2 ,
1358                          p_effective_date         IN DATE     ,
1359                          p_object_version_number  IN NUMBER   ) IS
1360   --
1361   l_proc         VARCHAR2(72) := g_package||'chk_j_sub_type';
1362   l_api_updating BOOLEAN;
1363   --
1364 BEGIN
1365   --
1366     hr_utility.set_location('Entering:'||l_proc, 5);
1367   --
1368     l_api_updating := pqp_atd_shd.api_updating
1369                       (p_alien_transaction_id   => p_alien_transaction_id ,
1370                        p_object_version_number  => p_object_version_number);
1371   --
1372     IF (l_api_updating AND
1373         p_j_sub_type
1374           <> nvl(pqp_atd_shd.g_old_rec.j_sub_type, hr_api.g_varchar2)
1375         OR NOT l_api_updating)
1376         AND p_j_sub_type IS NOT NULL THEN
1377     --
1378     -- check if value of lookup falls within lookup type.
1379     --
1380         IF hr_api.not_exists_in_hr_lookups
1381             (p_lookup_type    => 'PER_US_VISA_CATEGORIES' ,
1382              p_lookup_code    => p_j_sub_type             ,
1383              p_effective_date => p_effective_date         ) THEN
1384 /*      --
1385       -- raise error as does not exist as lookup
1386       --
1387             hr_utility.set_message(801,'HR_LOOKUP_DOES_NOT_EXIST');
1388             hr_utility.raise_error;
1389       --  */
1390       -- Append the error message to the g_error_message
1391 
1392         g_error_message := g_error_message || '(' ||
1393                                'j_sub_type = ' ||
1394                                p_j_sub_type || ' is invalid )';
1395         END IF;
1396     --
1397     END IF;
1398   --
1399     hr_utility.set_location('Leaving:'||l_proc,10);
1400   --
1401 END chk_j_sub_type;
1402 --
1403 -- ----------------------------------------------------------------------------
1404 -- |------< chk_primary_activity >------|
1405 -- ----------------------------------------------------------------------------
1406 --
1407 -- Description
1408 --   This procedure is used to check that the lookup value is valid.
1409 --
1410 -- Pre Conditions
1411 --   None.
1412 --
1413 -- In Parameters
1414 --   alien_transaction_id PK of record being inserted or updated.
1415 --   wthldg_allow_eligible_flag Value of lookup code.
1416 --   effective_date effective date
1417 --   object_version_number Object version number of record being
1418 --                         inserted or updated.
1419 --
1420 -- Post Success
1421 --   Processing continues
1422 --
1423 -- Post Failure
1424 --   Error handled by procedure
1425 --
1426 -- Access Status
1427 --   Internal table handler use only.
1428 --
1429 PROCEDURE chk_primary_activity(p_alien_transaction_id  IN NUMBER   ,
1430                                p_primary_activity      IN VARCHAR2 ,
1431                                p_effective_date        IN DATE     ,
1432                                p_object_version_number IN NUMBER   ) IS
1433   --
1434   l_proc         VARCHAR2(72) := g_package||'chk_primary_activity';
1435   l_api_updating BOOLEAN;
1436   --
1437 BEGIN
1438   --
1439     hr_utility.set_location('Entering:'||l_proc, 5);
1440   --
1441     l_api_updating := pqp_atd_shd.api_updating
1442                       (p_alien_transaction_id   => p_alien_transaction_id ,
1443                        p_object_version_number  => p_object_version_number);
1444   --
1445     IF (l_api_updating AND
1446         p_primary_activity
1447           <> nvl(pqp_atd_shd.g_old_rec.primary_activity, hr_api.g_varchar2)
1448         OR NOT l_api_updating)
1449         AND p_primary_activity IS NOT NULL THEN
1450     --
1451     -- check if value of lookup falls within lookup type.
1452     --
1453         IF hr_api.not_exists_in_hr_lookups
1454             (p_lookup_type    => 'PQP_US_PRIMARY_ACTIVITY' ,
1455              p_lookup_code    => p_primary_activity        ,
1456              p_effective_date => p_effective_date          ) THEN
1457 /*      --
1458       -- raise error as does not exist as lookup
1459       --
1460             hr_utility.set_message(801,'HR_LOOKUP_DOES_NOT_EXIST');
1461             hr_utility.raise_error;
1462       --  */
1463       -- Append the error message to the g_error_message
1464 
1465         g_error_message := g_error_message || '(' ||
1466                                'primary_activity = ' ||
1467                                p_primary_activity || ' is invalid )';
1468         END IF;
1469 
1470     END IF;
1471   --
1472     hr_utility.set_location('Leaving:'||l_proc,10);
1473   --
1474 END chk_primary_activity;
1475 --
1476 -- ----------------------------------------------------------------------------
1480 -- Description
1477 -- |------< chk_non_us_country_code >------|
1478 -- ----------------------------------------------------------------------------
1479 --
1481 --   This procedure is used to check that the lookup value is valid.
1482 --
1483 -- Pre Conditions
1484 --   None.
1485 --
1486 -- In Parameters
1487 --   alien_transaction_id PK of record being inserted or updated.
1488 --   wthldg_allow_eligible_flag Value of lookup code.
1489 --   effective_date effective date
1490 --   object_version_number Object version number of record being
1491 --                         inserted or updated.
1492 --
1493 -- Post Success
1494 --   Processing continues
1495 --
1496 -- Post Failure
1497 --   Error handled by procedure
1498 --
1499 -- Access Status
1500 --   Internal table handler use only.
1501 --
1502 PROCEDURE chk_non_us_country_code(p_alien_transaction_id  IN NUMBER   ,
1503                                   p_non_us_country_code   IN VARCHAR2 ,
1504                                   p_effective_date        IN DATE     ,
1505                                   p_object_version_number IN NUMBER   ) IS
1506   --
1507   l_proc         VARCHAR2(72) := g_package||'chk_non_us_country_code';
1508   l_api_updating BOOLEAN;
1509   --
1510 BEGIN
1511   --
1512     hr_utility.set_location('Entering:'||l_proc, 5);
1513   --
1514     l_api_updating := pqp_atd_shd.api_updating
1515                       (p_alien_transaction_id   => p_alien_transaction_id ,
1516                        p_object_version_number  => p_object_version_number);
1517   --
1518     IF (l_api_updating AND
1519         p_non_us_country_code
1520           <> nvl(pqp_atd_shd.g_old_rec.non_us_country_code, hr_api.g_varchar2)
1521         OR NOT l_api_updating)
1522         AND p_non_us_country_code IS NOT NULL THEN
1523     --
1524     -- check if value of lookup falls within lookup type.
1525     --
1526         IF hr_api.not_exists_in_hr_lookups
1527             (p_lookup_type    => 'FND_TERRITORIES_VL'   ,
1528              p_lookup_code    => p_non_us_country_code  ,
1529              p_effective_date => p_effective_date       ) THEN
1530 /*      --
1531       -- raise error as does not exist as lookup
1532       --
1533             hr_utility.set_message(801,'HR_LOOKUP_DOES_NOT_EXIST');
1534             hr_utility.raise_error;
1535       --  */
1536       -- Append the error message to the g_error_message
1537 
1538         g_error_message := g_error_message || '(' ||
1539                                'non_us_country_code = ' ||
1540                                p_non_us_country_code || ' is invalid )';
1541         END IF;
1542     --
1543     END IF;
1544   --
1545     hr_utility.set_location('Leaving:'||l_proc,10);
1546   --
1547 END chk_non_us_country_code;
1548 --
1549 -- ----------------------------------------------------------------------------
1550 -- |------< chk_citizenship_country_code >------|
1551 -- ----------------------------------------------------------------------------
1552 --
1553 -- Description
1554 --   This procedure is used to check that the lookup value is valid.
1555 --
1556 -- Pre Conditions
1557 --   None.
1558 --
1559 -- In Parameters
1560 --   alien_transaction_id PK of record being inserted or updated.
1561 --   wthldg_allow_eligible_flag Value of lookup code.
1562 --   effective_date effective date
1563 --   object_version_number Object version number of record being
1564 --                         inserted or updated.
1565 --
1566 -- Post Success
1567 --   Processing continues
1568 --
1569 -- Post Failure
1570 --   Error handled by procedure
1571 --
1572 -- Access Status
1573 --   Internal table handler use only.
1574 --
1575 PROCEDURE chk_citizenship_country_code(p_alien_transaction_id     IN NUMBER   ,
1576                                        p_citizenship_country_code IN VARCHAR2 ,
1577                                        p_effective_date           IN DATE     ,
1578                                        p_object_version_number    IN NUMBER   ) IS
1579   --
1580   l_proc         VARCHAR2(72) := g_package||'chk_citizenship_country_code';
1581   l_api_updating BOOLEAN;
1582   --
1583 BEGIN
1584   --
1585     hr_utility.set_location('Entering:'||l_proc, 5);
1586   --
1587     l_api_updating := pqp_atd_shd.api_updating
1588                       (p_alien_transaction_id   => p_alien_transaction_id ,
1589                        p_object_version_number  => p_object_version_number);
1590   --
1591     IF (l_api_updating AND
1592         p_citizenship_country_code
1593           <> nvl(pqp_atd_shd.g_old_rec.citizenship_country_code, hr_api.g_varchar2)
1594         OR NOT l_api_updating)
1595         AND p_citizenship_country_code IS NOT NULL THEN
1596     --
1597     -- check if value of lookup falls within lookup type.
1598     --
1599         IF hr_api.not_exists_in_hr_lookups
1600             (p_lookup_type    => 'FND_TERRITORIES_VL'        ,
1601              p_lookup_code    => p_citizenship_country_code  ,
1602              p_effective_date => p_effective_date            ) THEN
1603 /*      --
1604       -- raise error as does not exist as lookup
1605       --
1606             hr_utility.set_message(801,'HR_LOOKUP_DOES_NOT_EXIST');
1607             hr_utility.raise_error;
1608       --  */
1609 
1610       -- Append the error message to the g_error_message
1611 
1612         g_error_message := g_error_message || '(' ||
1613                                'citizenship_country_code = ' ||
1614                                p_citizenship_country_code || ' is invalid )';
1618   --
1615         END IF;
1616     --
1617     END IF;
1619     hr_utility.set_location('Leaving:'||l_proc,10);
1620   --
1621 END chk_citizenship_country_code;
1622 --
1623 -- ----------------------------------------------------------------------------
1624 -- |------< chk_benefit_amount_percent >------|
1625 -- ----------------------------------------------------------------------------
1626 --
1627 -- Description
1628 --   This procedure is used to check that the both Maximum Benefit amount
1629 --   and Withholding percaentage are not Non Zero.
1630 --   Tmehra added the conditon to check if Maximum Benefit amount is 999999
1631 --   then do not report the error.
1632 -- Pre Conditions
1633 --   None.
1634 --
1635 -- In Parameters
1636 --     p_withholding_rate        Withholding Rate
1637 --     p_maximum_benefit_amount  Maximum Benefit Amount
1638 -- Post Success
1639 --   Processing continues
1640 --
1641 -- Post Failure
1642 --   Error handled by procedure
1643 --
1644 -- Access Status
1645 --   Internal table handler use only.
1646 --
1647 PROCEDURE chk_benefit_amount_percent
1648        (p_withholding_rate        IN NUMBER ,
1649         p_maximum_benefit_amount  IN NUMBER )
1650 IS
1651   --
1652   l_proc         VARCHAR2(72) := g_package||'chk_benefit_amount_percent';
1653   --
1654 BEGIN
1655     hr_utility.set_location('Entering:'||l_proc,10);
1656 
1657     IF (NVL(p_withholding_rate      , 0) > 0  AND
1658         NVL(p_maximum_benefit_amount, 0) > 0  AND
1659         NVL(p_maximum_benefit_amount, 0) <> 999999 ) THEN
1660 
1661       -- Append the error message to the g_error_message
1662 
1663         g_error_message := g_error_message || 'Both Max Benefit Amount and ' ||
1664                               'Withholding Rate cannot be more than 0';
1665     END IF;
1666 
1667     hr_utility.set_location('Leaving:'||l_proc,10);
1668 END chk_benefit_amount_percent;
1669 -- ----------------------------------------------------------------------------
1670 -- |---------------------------< insert_validate >----------------------------|
1671 -- ----------------------------------------------------------------------------
1672 Procedure insert_validate(p_rec in pqp_atd_shd.g_rec_type
1673                          ,p_effective_date in date) is
1674 --
1675   l_proc  varchar2(72) := g_package||'insert_validate';
1676 --
1677 Begin
1678   hr_utility.set_location('Entering:'||l_proc, 5);
1679   --
1680   -- Call all supporting business operations
1681   --
1682   chk_alien_transaction_id
1683   (p_alien_transaction_id          => p_rec.alien_transaction_id  ,
1684    p_object_version_number         => p_rec.object_version_number );
1685  --
1686   chk_treaty_ben_allowed_flag
1687   (p_alien_transaction_id          => p_rec.alien_transaction_id    ,
1688    p_treaty_ben_allowed_flag       => p_rec.treaty_ben_allowed_flag ,
1689    p_effective_date                => p_effective_date              ,
1690    p_object_version_number         => p_rec.object_version_number   );
1691   --
1692   chk_wthldg_allow_eligible_flag
1693   (p_alien_transaction_id          => p_rec.alien_transaction_id       ,
1694    p_wthldg_allow_eligible_flag    => p_rec.wthldg_allow_eligible_flag ,
1695    p_effective_date                => p_effective_date                 ,
1696    p_object_version_number         => p_rec.object_version_number      );
1697   --
1698   chk_addl_withholding_flag
1699   (p_alien_transaction_id          => p_rec.alien_transaction_id  ,
1700    p_addl_withholding_flag         => p_rec.addl_withholding_flag ,
1701    p_effective_date                => p_effective_date            ,
1702    p_object_version_number         => p_rec.object_version_number );
1703   --
1704   chk_retro_lose_ben_date_flag
1705   (p_alien_transaction_id          => p_rec.alien_transaction_id     ,
1706    p_retro_lose_ben_date_flag      => p_rec.retro_lose_ben_date_flag ,
1707    p_effective_date                => p_effective_date               ,
1708    p_object_version_number         => p_rec.object_version_number    );
1709   --
1710   chk_retro_lose_ben_amt_flag
1711   (p_alien_transaction_id          => p_rec.alien_transaction_id    ,
1712    p_retro_lose_ben_amt_flag       => p_rec.retro_lose_ben_amt_flag ,
1713    p_effective_date                => p_effective_date              ,
1714    p_object_version_number         => p_rec.object_version_number   );
1715   --
1716   chk_state_honors_treaty_flag
1717   (p_alien_transaction_id          => p_rec.alien_transaction_id     ,
1718    p_state_honors_treaty_flag      => p_rec.state_honors_treaty_flag ,
1719    p_effective_date                => p_effective_date               ,
1720    p_object_version_number         => p_rec.object_version_number    );
1721   --
1722   chk_student_exempt_from_fica
1723   (p_alien_transaction_id          => p_rec.alien_transaction_id     ,
1724    p_student_exempt_from_fica      => p_rec.student_exempt_from_fica ,
1725    p_effective_date                => p_effective_date               ,
1726    p_object_version_number         => p_rec.object_version_number    );
1727  --
1728   chk_nra_exempt_from_fica
1729   (p_alien_transaction_id          => p_rec.alien_transaction_id    ,
1730    p_nra_exempt_from_fica          => p_rec.nra_exempt_from_fica    ,
1731    p_effective_date                => p_effective_date              ,
1732    p_object_version_number         => p_rec.object_version_number   );
1733   --
1734   chk_income_code
1735   (p_alien_transaction_id          => p_rec.alien_transaction_id    ,
1739  --
1736    p_income_code                   => p_rec.income_code             ,
1737    p_effective_date                => p_effective_date              ,
1738    p_object_version_number         => p_rec.object_version_number   );
1740   chk_income_code_sub_type
1741   (p_alien_transaction_id          => p_rec.alien_transaction_id    ,
1742    p_income_code_sub_type          => p_rec.income_code_sub_type    ,
1743    p_effective_date                => p_effective_date              ,
1744    p_object_version_number         => p_rec.object_version_number  );
1745  --
1746   chk_exemption_code
1747   (p_alien_transaction_id          => p_rec.alien_transaction_id    ,
1748    p_exemption_code                => p_rec.exemption_code          ,
1749    p_effective_date                => p_effective_date              ,
1750    p_object_version_number         => p_rec.object_version_number   );
1751  --
1752   chk_current_residency_status
1753   (p_alien_transaction_id          => p_rec.alien_transaction_id    ,
1754    p_current_residency_status      => p_rec.current_residency_status,
1755    p_effective_date                => p_effective_date              ,
1756    p_object_version_number         => p_rec.object_version_number   );
1757  --
1758   chk_tax_residence_country_code
1759   (p_alien_transaction_id          => p_rec.alien_transaction_id      ,
1760    p_tax_residence_country_code    => p_rec.tax_residence_country_code,
1761    p_effective_date                => p_effective_date                ,
1762    p_object_version_number         => p_rec.object_version_number     );
1763  --
1764   chk_addtnl_wthldng_amt_period
1765   (p_alien_transaction_id          => p_rec.alien_transaction_id         ,
1766    p_addtnl_wthldng_amt_period     => p_rec.addl_wthldng_amt_period_type ,
1767    p_effective_date                => p_effective_date                   ,
1768    p_object_version_number         => p_rec.object_version_number        );
1769  --
1770   chk_state_code
1771   (p_alien_transaction_id          => p_rec.alien_transaction_id      ,
1772    p_state_code                    => p_rec.state_code                ,
1773    p_effective_date                => p_effective_date                ,
1774    p_object_version_number         => p_rec.object_version_number     );
1775  --
1776 --  chk_record_source
1777 --  (p_alien_transaction_id          => p_rec.alien_transaction_id      ,
1778 --   p_record_source                 => p_rec.record_source             ,
1779 --   p_effective_date                => p_effective_date                ,
1780 --   p_object_version_number         => p_rec.object_version_number     );
1781  --
1782   chk_visa_type
1783   (p_alien_transaction_id          => p_rec.alien_transaction_id      ,
1784    p_visa_type                     => p_rec.visa_type                 ,
1785    p_effective_date                => p_effective_date                ,
1786    p_object_version_number         => p_rec.object_version_number     );
1787  --
1788   IF (p_rec.visa_type = 'J-1' OR
1789       p_rec.visa_type = 'J-2' ) THEN
1790       chk_j_sub_type
1791       (  p_alien_transaction_id          => p_rec.alien_transaction_id      ,
1792          p_j_sub_type                    => p_rec.j_sub_type                ,
1793          p_effective_date                => p_effective_date                ,
1794          p_object_version_number         => p_rec.object_version_number
1795       );
1796   END IF;
1797  --
1798   chk_primary_activity
1799   (p_alien_transaction_id          => p_rec.alien_transaction_id      ,
1800    p_primary_activity              => p_rec.primary_activity          ,
1801    p_effective_date                => p_effective_date                ,
1802    p_object_version_number         => p_rec.object_version_number     );
1803  --
1804   chk_benefit_amount_percent
1805   ( p_withholding_rate             => p_rec.withholding_rate        ,
1806    p_maximum_benefit_amount        => p_rec.maximum_benefit_amount  );
1807 --
1808 --  chk_non_us_country_code
1809 --  (p_alien_transaction_id          => p_rec.alien_transaction_id      ,
1810 --   p_non_us_country_code           => p_rec.non_us_country_code       ,
1811 --   p_effective_date                => p_effective_date                ,
1812 --   p_object_version_number         => p_rec.object_version_number     ) ;
1813  --
1814 --  chk_citizenship_country_code
1815 --  (p_alien_transaction_id          => p_rec.alien_transaction_id     ,
1816 --   p_citizenship_country_code      => p_rec.citizenship_country_code ,
1817 --   p_effective_date                => p_effective_date               ,
1818 --   p_object_version_number         => p_rec.object_version_number    );
1819   --
1820   --
1821   --
1822   hr_utility.set_location(' Leaving:'||l_proc, 10);
1823 End insert_validate;
1824 --
1825 -- ----------------------------------------------------------------------------
1826 -- |---------------------------< update_validate >----------------------------|
1827 -- ----------------------------------------------------------------------------
1828 Procedure update_validate(p_rec in pqp_atd_shd.g_rec_type
1829                          ,p_effective_date in date) is
1830 --
1831   l_proc  varchar2(72) := g_package||'update_validate';
1832 --
1833 Begin
1834   hr_utility.set_location('Entering:'||l_proc, 5);
1835   --
1836   -- Call all supporting business operations
1837   --
1838   chk_alien_transaction_id
1839   (p_alien_transaction_id          => p_rec.alien_transaction_id,
1840    p_object_version_number => p_rec.object_version_number);
1841   --
1842   chk_treaty_ben_allowed_flag
1846    p_object_version_number => p_rec.object_version_number);
1843   (p_alien_transaction_id          => p_rec.alien_transaction_id,
1844    p_treaty_ben_allowed_flag         => p_rec.treaty_ben_allowed_flag,
1845    p_effective_date        => p_effective_date,
1847   --
1848   chk_wthldg_allow_eligible_flag
1849   (p_alien_transaction_id          => p_rec.alien_transaction_id,
1850    p_wthldg_allow_eligible_flag         => p_rec.wthldg_allow_eligible_flag,
1851    p_effective_date        => p_effective_date,
1852    p_object_version_number => p_rec.object_version_number);
1853   --
1854   chk_addl_withholding_flag
1855   (p_alien_transaction_id          => p_rec.alien_transaction_id,
1856    p_addl_withholding_flag         => p_rec.addl_withholding_flag,
1857    p_effective_date        => p_effective_date,
1858    p_object_version_number => p_rec.object_version_number);
1859   --
1860   chk_retro_lose_ben_date_flag
1861   (p_alien_transaction_id          => p_rec.alien_transaction_id,
1862    p_retro_lose_ben_date_flag         => p_rec.retro_lose_ben_date_flag,
1863    p_effective_date        => p_effective_date,
1864    p_object_version_number => p_rec.object_version_number);
1865   --
1866   chk_retro_lose_ben_amt_flag
1867   (p_alien_transaction_id          => p_rec.alien_transaction_id,
1868    p_retro_lose_ben_amt_flag         => p_rec.retro_lose_ben_amt_flag,
1869    p_effective_date        => p_effective_date,
1870    p_object_version_number => p_rec.object_version_number);
1871   --
1872   chk_state_honors_treaty_flag
1873   (p_alien_transaction_id          => p_rec.alien_transaction_id,
1874    p_state_honors_treaty_flag         => p_rec.state_honors_treaty_flag,
1875    p_effective_date        => p_effective_date,
1876    p_object_version_number => p_rec.object_version_number);
1877  --
1878   chk_student_exempt_from_fica
1879   (p_alien_transaction_id          => p_rec.alien_transaction_id     ,
1880    p_student_exempt_from_fica      => p_rec.student_exempt_from_fica ,
1881    p_effective_date                => p_effective_date               ,
1882    p_object_version_number         => p_rec.object_version_number    );
1883  --
1884   chk_nra_exempt_from_fica
1885   (p_alien_transaction_id          => p_rec.alien_transaction_id    ,
1886    p_nra_exempt_from_fica          => p_rec.nra_exempt_from_fica    ,
1887    p_effective_date                => p_effective_date              ,
1888    p_object_version_number         => p_rec.object_version_number   );
1889   --
1890   chk_income_code
1891   (p_alien_transaction_id          => p_rec.alien_transaction_id    ,
1892    p_income_code                   => p_rec.income_code             ,
1893    p_effective_date                => p_effective_date              ,
1894    p_object_version_number         => p_rec.object_version_number   );
1895  --
1896   chk_income_code_sub_type
1897   (p_alien_transaction_id          => p_rec.alien_transaction_id    ,
1898    p_income_code_sub_type          => p_rec.income_code_sub_type    ,
1899    p_effective_date                => p_effective_date              ,
1900    p_object_version_number         => p_rec.object_version_number  );
1901  --
1902   chk_exemption_code
1903   (p_alien_transaction_id          => p_rec.alien_transaction_id    ,
1904    p_exemption_code                => p_rec.exemption_code          ,
1905    p_effective_date                => p_effective_date              ,
1906    p_object_version_number         => p_rec.object_version_number   );
1907  --
1908   chk_current_residency_status
1909   (p_alien_transaction_id          => p_rec.alien_transaction_id     ,
1910    p_current_residency_status      => p_rec.current_residency_status ,
1911    p_effective_date                => p_effective_date               ,
1912    p_object_version_number         => p_rec.object_version_number    );
1913  --
1914   chk_tax_residence_country_code
1915   (p_alien_transaction_id          => p_rec.alien_transaction_id       ,
1916    p_tax_residence_country_code    => p_rec.tax_residence_country_code ,
1917    p_effective_date                => p_effective_date                 ,
1918    p_object_version_number         => p_rec.object_version_number      );
1919  --
1920   chk_addtnl_wthldng_amt_period
1921   (p_alien_transaction_id          => p_rec.alien_transaction_id         ,
1922    p_addtnl_wthldng_amt_period     => p_rec.addl_wthldng_amt_period_type ,
1923    p_effective_date                => p_effective_date                   ,
1924    p_object_version_number         => p_rec.object_version_number        );
1925  --
1926   chk_state_code
1927   (p_alien_transaction_id          => p_rec.alien_transaction_id      ,
1928    p_state_code                    => p_rec.state_code                ,
1929    p_effective_date                => p_effective_date                ,
1930    p_object_version_number         => p_rec.object_version_number     );
1931  --
1932 --  chk_record_source
1933 --  (p_alien_transaction_id          => p_rec.alien_transaction_id      ,
1934 --   p_record_source                 => p_rec.record_source             ,
1935 --   p_effective_date                => p_effective_date                ,
1936 --   p_object_version_number         => p_rec.object_version_number     );
1937  --
1938   chk_visa_type
1939   (p_alien_transaction_id          => p_rec.alien_transaction_id      ,
1940    p_visa_type                     => p_rec.visa_type                 ,
1941    p_effective_date                => p_effective_date                ,
1942    p_object_version_number         => p_rec.object_version_number     );
1943  --
1944   IF (p_rec.visa_type = 'J-1' OR
1945       p_rec.visa_type = 'J-2' ) THEN
1949          p_effective_date                => p_effective_date                ,
1946       chk_j_sub_type
1947       (  p_alien_transaction_id          => p_rec.alien_transaction_id      ,
1948          p_j_sub_type                    => p_rec.j_sub_type                ,
1950          p_object_version_number         => p_rec.object_version_number
1951       );
1952   END IF;
1953  --
1954   chk_primary_activity
1955   (p_alien_transaction_id          => p_rec.alien_transaction_id      ,
1956    p_primary_activity              => p_rec.primary_activity          ,
1957    p_effective_date                => p_effective_date                ,
1958    p_object_version_number         => p_rec.object_version_number     );
1959  --
1960   chk_benefit_amount_percent
1961   ( p_withholding_rate             => p_rec.withholding_rate        ,
1962    p_maximum_benefit_amount       =>  p_rec.maximum_benefit_amount  );
1963 --
1964 --  chk_non_us_country_code
1965 --  (p_alien_transaction_id          => p_rec.alien_transaction_id      ,
1966 --   p_non_us_country_code           => p_rec.non_us_country_code       ,
1967 --   p_effective_date                => p_effective_date                ,
1968 --   p_object_version_number         => p_rec.object_version_number     );
1969  --
1970 --  chk_citizenship_country_code
1971 --  (p_alien_transaction_id          => p_rec.alien_transaction_id     ,
1972 --   p_citizenship_country_code      => p_rec.citizenship_country_code ,
1973 --   p_effective_date                => p_effective_date               ,
1974 --   p_object_version_number         => p_rec.object_version_number    );
1975   --
1976   --
1977   --
1978   hr_utility.set_location(' Leaving:'||l_proc, 10);
1979 End update_validate;
1980 --
1981 -- ----------------------------------------------------------------------------
1982 -- |---------------------------< delete_validate >----------------------------|
1983 -- ----------------------------------------------------------------------------
1984 Procedure delete_validate(p_rec in pqp_atd_shd.g_rec_type
1985                          ,p_effective_date in date) is
1986 --
1987   l_proc  varchar2(72) := g_package||'delete_validate';
1988 --
1989 Begin
1990   hr_utility.set_location('Entering:'||l_proc, 5);
1991   --
1992   -- Call all supporting business operations
1993   --
1994   hr_utility.set_location(' Leaving:'||l_proc, 10);
1995 End delete_validate;
1996 --
1997 end pqp_atd_bus;