DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_AU_ADD_LEG_HOOK

Source


1 PACKAGE BODY per_au_add_leg_hook AS
2 /* $Header: peaulhpa.pkb 115.0 2004/01/19 22:29 vgsriniv noship $ */
3 
4 /*--------------------------------------------------------------------------
5 -- Name           : CHECK_ADDRESS                                       --
6 -- Type           : Procedure                                           --
7 -- Access         : Private                                             --
8 -- Description    : Procedure is the driver procedure for the validation--
9 --                  of the address.                                     --
10 --                  This procedure is the hook procedure for the        --
11 --                  address.                                            --
12 -- Parameters     :                                                     --
13 --             IN :       p_style               IN VARCHAR2             --
14 --                        p_region_1            IN VARCHAR2             --
15 --                        p_country             IN VARCHAR2             --
16 --------------------------------------------------------------------------*/
17 
18 PROCEDURE check_address(p_style              IN VARCHAR2
19                        ,p_region_1           IN VARCHAR2
20                        ,p_country            IN VARCHAR2) AS
21 
22      l_proc             VARCHAR2(72) := g_package||'check_address';
23 
24   BEGIN
25 
26   IF NOT hr_utility.chk_product_install('Oracle Human Resources', 'AU') THEN
27        hr_utility.trace ('AU Legislation not installed. Not performing the validations');
28        RETURN;
29   END IF;
30 
31  IF p_style = 'AU_GLB' and p_country = 'AU' THEN
32 --
33 -- Check for the mandatory values
34 --
35   if p_region_1 is null then
36      hr_utility.set_message(800, 'HR_AU_INVALID_STATE');
37      hr_utility.raise_error;
38   end if;
39 
40  END IF;
41 
42 END check_address;
43 
44 /*------------------------------------------------------------------------
45 --                                                                      --
46 -- Name           : CHECK_ADDRESS_INS                                   --
47 -- Type           : Procedure                                           --
48 -- Access         : Public                                              --
49 -- Description    : Procedure is the driver procedure for the validation--
50 --                  of the address.                                     --
51 --                  This procedure is the hook procedure for the        --
52 --                  address when address is inserted.                   --
53 -- Parameters     :                                                     --
54 --             IN :       p_style               IN VARCHAR2             --
55 --                        p_region_1            IN VARCHAR2             --
56 --                        p_country             IN VARCHAR2             --
57 -------------------------------------------------------------------------*/
58 
59 PROCEDURE check_address_ins(p_style              IN VARCHAR2
60                            ,p_region_1           IN VARCHAR2
61                            ,p_country            IN VARCHAR2) AS
62 BEGIN
63 
64      check_address(p_style  =>   p_style
65                   ,p_region_1 => p_region_1
66                   ,p_country => p_country);
67 
68 END check_address_ins;
69 
70 
71 
72 /*------------------------------------------------------------------------
73 --                                                                      --
74 -- Name           : CHECK_ADDRESS_UPD                                   --
75 -- Type           : Procedure                                           --
76 -- Access         : Public                                              --
77 -- Description    : Procedure is the driver procedure for the validation--
78 --                  of the Address.                                     --
79 --                  This procedure is the hook procedure for the        --
80 --                  address when address is updated.                    --
81 -- Parameters     :                                                     --
82 --             IN :       p_address_id          IN NUMBER               --
83 --                        p_region_1            IN VARCHAR2             --
84 --                        p_country             IN VARCHAR2             --
85 ------------------------------------------------------------------------*/
86 
87 PROCEDURE check_address_upd(p_address_id         IN NUMBER
88                            ,p_region_1           IN VARCHAR2
89                            ,p_country            IN VARCHAR2) AS
90 
91   CURSOR get_style(p_address_id number) is
92     SELECT style
93     FROM   per_addresses
94     WHERE  address_id=p_address_id;
95     --
96     l_style     per_addresses.style%TYPE;
97 
98 
99 BEGIN
100 
101    OPEN get_style(p_address_id);
102    FETCH get_style INTO l_style;
103    CLOSE get_style;
104 
105    check_address(p_style  =>   l_style
106                 ,p_region_1 => p_region_1
107                 ,p_country => p_country);
108 
109 END check_address_upd;
110 
111 END per_au_add_leg_hook;