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.2 2008/10/28 15:54:29 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_information1 = p_org_information1
98          and organization_id = p_organization_id
99       ;
100 
101    l_found    varchar2(1);
102 --
103 
104 BEGIN
105   --
106   --
107   --
108     l_found := 'N';
109     --
110     -- Check tax rule does not exist elsewhere
111     --
112     OPEN csr_tax_rules(p_organization_id
113                        ,p_org_info_type_code
114                        ,p_org_information1
115                        );
116     FETCH csr_tax_rules INTO l_found;
117     IF (csr_tax_rules%FOUND) THEN
118       CLOSE csr_tax_rules;
119       fnd_message.set_name  ('PAY','PAY_US_TAX_RULES_EXIST');
120       fnd_message.raise_error;
121     ELSE
122       CLOSE csr_tax_rules;
123     END IF;
124   --
125 
126 --
127 
128 END INSERT_US_ORG_INFO;
129 
130 
131 /**PROCEDURE check_duplicate_tax_rules
132   (p_organization_id             IN     NUMBER
133   ,p_org_information_context     IN     VARCHAR2
134   ,p_org_information1            IN     VARCHAR2
135 
136   )
137 IS
138   --
139   CURSOR csr_tax_rules
140     (p_organization_id              IN     NUMBER
141     ,p_org_information_context      IN     VARCHAR2
142     ,p_org_information1             IN     VARCHAR2
143 
144     )
145   IS
146     select 'Y'
147     from hr_organization_information
148         where ORG_INFORMATION_CONTEXT like p_org_information_context
149          and org_information1 = p_org_information1
150          and organization_id = p_organization_id
151       ;
152 
153    l_found    varchar2(1);
154 --
155 
156 BEGIN
157   --
158   --
159   --
160     l_found = 'N';
161     --
162     -- Check tax rule does not exist elsewhere
163     --
164     OPEN csr_tax_rules(p_organization_id
165                        ,p_org_information_context
166                        ,p_org_information1
167 
168                      );
169     FETCH csr_tax_rules INTO l_found;
170     IF (csr_tax_rules%FOUND) THEN
171       CLOSE csr_business_group_name;
172       fnd_message.set_name  ('PAY','PAY_US_TAX_RULES_EXIST');
173       fnd_message.raise_error;
174     ELSE
175       CLOSE csr_tax_rules;
176     END IF;
177   --
178 
179 --
180 END check_duplicate_tax_rules;**/
181 
182 END PER_US_ORG_INFO_LEG_HOOK;
183