DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_US_ORG_INFO_LEG_HOOK

Source


1 PACKAGE BODY PER_US_ORG_INFO_LEG_HOOK AS
2 /* $Header: peusvald.pkb 120.0.12010000.3 2009/04/01 19:42:09 rnestor noship $ */
3 
4  PROCEDURE UPDATE_US_ORG_INFO
5          (P_ORG_INFORMATION_ID          IN     NUMBER
6          ,p_org_info_type_code          IN     VARCHAR2
7          ,p_org_information1            IN     VARCHAR2
8          ,p_org_information2            IN     VARCHAR2
9         )
10 IS
11   --
12   CURSOR csr_tax_rules
13     (p_organization_id              IN     NUMBER
14     ,p_org_info_type_code           IN     VARCHAR2
15     ,p_org_information1             IN     VARCHAR2
16 
17     )
18   IS
19     select 'Y'
20     from hr_organization_information
21         where ORG_INFORMATION_CONTEXT like p_org_info_type_code
22         and ORG_INFORMATION_CONTEXT in
23                ( 'State Tax Rules', 'State Tax Rules 2', 'Local Tax Rules')  --RLN 7421633
24          and org_information1 = p_org_information1
25          and organization_id = p_organization_id
26          and org_information_id <> P_ORG_INFORMATION_ID
27       ;
28 
29    l_found    varchar2(1);
30    l_org_id   number;
31 --
32 
33 BEGIN
34   --
35   --
36   --
37     l_found := 'N';
38     --
39     -- Check tax rule does not exist elsewhere
40     --
41     l_org_id := -99999;
42     begin
43         select hoi.organization_id
44         into   l_org_id
45         from hr_organization_information hoi
46         where P_ORG_INFORMATION_ID = hoi.org_information_id
47 --        and   ORG_INFORMATION_CONTEXT = p_org_info_type_code
48         and rownum = 1;
49 
50     exception
51         when others then
52            l_org_id := -99999;
53     end;
54 
55     if l_org_id <> -99999 THEN
56 
57 
58         OPEN csr_tax_rules(l_org_id
59                            ,p_org_info_type_code
60                            ,p_org_information1
61 
62                          );
63         FETCH csr_tax_rules INTO l_found;
64         IF (csr_tax_rules%FOUND) THEN
65           CLOSE csr_tax_rules;
66           fnd_message.set_name  ('PAY','PAY_US_TAX_RULES_EXIST');
67           fnd_message.raise_error;
68         ELSE
69           CLOSE csr_tax_rules;
70         END IF;
71     end if;
72   --
73 
74 --
75 END UPDATE_US_ORG_INFO;
76 
77 
78 
79 PROCEDURE INSERT_US_ORG_INFO
80          (p_organization_id             IN     NUMBER
81          ,p_org_info_type_code         IN     VARCHAR2
82          ,p_org_information1            IN     VARCHAR2
83          ,p_org_information2            IN     VARCHAR2
84         )
85 IS
86   --
87   CURSOR csr_tax_rules
88     (p_organization_id              IN     NUMBER
89     ,p_org_info_type_code           IN     VARCHAR2
90     ,p_org_information1             IN     VARCHAR2
91 
92     )
93   IS
94     select 'Y'
95     from hr_organization_information
96         where ORG_INFORMATION_CONTEXT like p_org_info_type_code
97         and ORG_INFORMATION_CONTEXT in
98                ( 'State Tax Rules', 'State Tax Rules 2', 'Local Tax Rules') --RLN 7421633
99          and org_information1 = p_org_information1
100          and organization_id = p_organization_id
101       ;
102 
103    l_found    varchar2(1);
104 --
105 
106 BEGIN
107   --
108   --
109   --
110     l_found := 'N';
111     --
112     -- Check tax rule does not exist elsewhere
113     --
114     OPEN csr_tax_rules(p_organization_id
115                        ,p_org_info_type_code
116                        ,p_org_information1
117                        );
118     FETCH csr_tax_rules INTO l_found;
119     IF (csr_tax_rules%FOUND) THEN
120       CLOSE csr_tax_rules;
121       fnd_message.set_name  ('PAY','PAY_US_TAX_RULES_EXIST');
122       fnd_message.raise_error;
123     ELSE
124       CLOSE csr_tax_rules;
125     END IF;
126   --
127 
128 --
129 
130 END INSERT_US_ORG_INFO;
131 
132 
133 /**PROCEDURE check_duplicate_tax_rules
134   (p_organization_id             IN     NUMBER
135   ,p_org_information_context     IN     VARCHAR2
136   ,p_org_information1            IN     VARCHAR2
137 
138   )
139 IS
140   --
141   CURSOR csr_tax_rules
142     (p_organization_id              IN     NUMBER
143     ,p_org_information_context      IN     VARCHAR2
144     ,p_org_information1             IN     VARCHAR2
145 
146     )
147   IS
148     select 'Y'
149     from hr_organization_information
150         where ORG_INFORMATION_CONTEXT like p_org_information_context
151          and org_information1 = p_org_information1
152          and organization_id = p_organization_id
153       ;
154 
155    l_found    varchar2(1);
156 --
157 
158 BEGIN
159   --
160   --
161   --
162     l_found = 'N';
163     --
164     -- Check tax rule does not exist elsewhere
165     --
166     OPEN csr_tax_rules(p_organization_id
167                        ,p_org_information_context
168                        ,p_org_information1
169 
170                      );
171     FETCH csr_tax_rules INTO l_found;
172     IF (csr_tax_rules%FOUND) THEN
173       CLOSE csr_business_group_name;
174       fnd_message.set_name  ('PAY','PAY_US_TAX_RULES_EXIST');
175       fnd_message.raise_error;
176     ELSE
177       CLOSE csr_tax_rules;
178     END IF;
179   --
180 
181 --
182 END check_duplicate_tax_rules;**/
183 
184 END PER_US_ORG_INFO_LEG_HOOK;
185