DBA Data[Home] [Help]

PACKAGE BODY: APPS.PAY_PL_SII_SWI

Source


1 Package Body pay_pl_sii_swi As
2 /* $Header: pypsdswi.pkb 120.0 2005/10/16 22:24 mseshadr noship $ */
3 --
4 -- Package variables
5 --
6 g_package  varchar2(33) := 'pay_pl_sii_swi.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |-------------------------< create_pl_sii_details >------------------------|
10 -- ----------------------------------------------------------------------------
11 PROCEDURE create_pl_sii_details
12   (p_validate                     in     number    default hr_api.g_false_num
13   ,p_effective_date               in     date
14   ,p_contract_category            in     varchar2
15   ,p_per_or_asg_id                in     number
16   ,p_business_group_id            in     number
17   ,p_emp_social_security_info     in     varchar2
18   ,p_old_age_contribution         in     varchar2  default null
19   ,p_pension_contribution         in     varchar2  default null
20   ,p_sickness_contribution        in     varchar2  default null
21   ,p_work_injury_contribution     in     varchar2  default null
22   ,p_labor_contribution           in     varchar2  default null
23   ,p_health_contribution          in     varchar2  default null
24   ,p_unemployment_contribution    in     varchar2  default null
25   ,p_old_age_cont_end_reason      in     varchar2  default null
26   ,p_pension_cont_end_reason      in     varchar2  default null
27   ,p_sickness_cont_end_reason     in     varchar2  default null
28   ,p_work_injury_cont_end_reason  in     varchar2  default null
29   ,p_labor_fund_cont_end_reason   in     varchar2  default null
30   ,p_health_cont_end_reason       in     varchar2  default null
31   ,p_unemployment_cont_end_reason in     varchar2  default null
32   ,p_sii_details_id               in     number
33   ,p_object_version_number           out nocopy number
34   ,p_effective_start_date            out nocopy date
35   ,p_effective_end_date              out nocopy date
36   ,p_return_status                   out nocopy varchar2
37   ,p_effective_date_warning          out nocopy   boolean
38   ) is
39   --
40   -- Variables for API Boolean parameters
41   l_validate                      boolean;
42   --
43   -- Other variables
44   l_sii_details_id               number;
45   l_effective_date_warning       boolean;
46   l_proc    varchar2(72) := g_package ||'create_pl_sii_details';
47 Begin
48   hr_utility.set_location(' Entering:' || l_proc,10);
49   --
50   -- Issue a savepoint
51   --
52   savepoint create_pl_sii_details_swi;
53   --
54   -- Initialise Multiple Message Detection
55   --
56   hr_multi_message.enable_message_list;
57   --
58   --
59   -- Convert constant values to their corresponding boolean value
60   --
61   l_validate :=
62     hr_api.constant_to_boolean
63       (p_constant_value => p_validate);
64   --
65   -- Register Surrogate ID or user key values
66   --
67   pay_psd_ins.set_base_key_value
68     (p_sii_details_id => p_sii_details_id
69     );
70   --
71   -- Call API
72   --
73   pay_pl_sii_api.create_pl_sii_details
74     (p_validate                     => l_validate
75     ,p_effective_date               => p_effective_date
76     ,p_contract_category            => p_contract_category
77     ,p_per_or_asg_id                => p_per_or_asg_id
78     ,p_business_group_id            => p_business_group_id
79     ,p_emp_social_security_info     => p_emp_social_security_info
80     ,p_old_age_contribution         => p_old_age_contribution
81     ,p_pension_contribution         => p_pension_contribution
82     ,p_sickness_contribution        => p_sickness_contribution
83     ,p_work_injury_contribution     => p_work_injury_contribution
84     ,p_labor_contribution           => p_labor_contribution
85     ,p_health_contribution          => p_health_contribution
86     ,p_unemployment_contribution    => p_unemployment_contribution
87     ,p_old_age_cont_end_reason      => p_old_age_cont_end_reason
88     ,p_pension_cont_end_reason      => p_pension_cont_end_reason
89     ,p_sickness_cont_end_reason     => p_sickness_cont_end_reason
90     ,p_work_injury_cont_end_reason  => p_work_injury_cont_end_reason
91     ,p_labor_fund_cont_end_reason   => p_labor_fund_cont_end_reason
92     ,p_health_cont_end_reason       => p_health_cont_end_reason
93     ,p_unemployment_cont_end_reason => p_unemployment_cont_end_reason
94     ,p_sii_details_id               => l_sii_details_id
95     ,p_object_version_number        => p_object_version_number
96     ,p_effective_start_date         => p_effective_start_date
97     ,p_effective_end_date           => p_effective_end_date
98     ,p_effective_date_warning       => l_effective_date_warning
99     );
100   --
101   -- Convert API warning boolean parameter values to specific
102   -- messages and add them to Multiple Message List
103   --
104   --
105   -- Convert API non-warning boolean parameter values
106   --
107   --
108   -- Derive the API return status value based on whether
109   -- messages of any type exist in the Multiple Message List.
110   -- Also disable Multiple Message Detection.
111   --
112   p_return_status := hr_multi_message.get_return_status_disable;
113   hr_utility.set_location(' Leaving:' || l_proc,20);
114   --
115 exception
116   when hr_multi_message.error_message_exist then
117     --
118     -- Catch the Multiple Message List exception which
119     -- indicates API processing has been aborted because
120     -- at least one message exists in the list.
121     --
122     rollback to create_pl_sii_details_swi;
123     --
124     -- Reset IN OUT parameters and set OUT parameters
125     --
126     p_object_version_number        := null;
127     p_effective_start_date         := null;
128     p_effective_end_date           := null;
129     p_effective_date_warning       := null;
130     p_return_status := hr_multi_message.get_return_status_disable;
131     hr_utility.set_location(' Leaving:' || l_proc, 30);
132   when others then
133     --
134     -- When Multiple Message Detection is enabled catch
135     -- any Application specific or other unexpected
136     -- exceptions.  Adding appropriate details to the
137     -- Multiple Message List.  Otherwise re-raise the
138     -- error.
139     --
140     rollback to create_pl_sii_details_swi;
141     if hr_multi_message.unexpected_error_add(l_proc) then
142        hr_utility.set_location(' Leaving:' || l_proc,40);
143        raise;
144     end if;
145     --
146     -- Reset IN OUT and set OUT parameters
147     --
148     p_object_version_number        := null;
149     p_effective_start_date         := null;
150     p_effective_end_date           := null;
151     p_effective_date_warning       := null;
152     p_return_status := hr_multi_message.get_return_status_disable;
153     hr_utility.set_location(' Leaving:' || l_proc,50);
154 end create_pl_sii_details;
155 -- ----------------------------------------------------------------------------
156 -- |-------------------------< update_pl_sii_details >------------------------|
157 -- ----------------------------------------------------------------------------
158 PROCEDURE update_pl_sii_details
159   (p_validate                     in     number    default hr_api.g_false_num
160   ,p_effective_date               in     date
161   ,p_datetrack_update_mode        in     varchar2
162   ,p_sii_details_id               in     number
163   ,p_object_version_number        in out nocopy number
164   ,p_emp_social_security_info     in     varchar2  default hr_api.g_varchar2
165   ,p_old_age_contribution         in     varchar2  default hr_api.g_varchar2
166   ,p_pension_contribution         in     varchar2  default hr_api.g_varchar2
167   ,p_sickness_contribution        in     varchar2  default hr_api.g_varchar2
168   ,p_work_injury_contribution     in     varchar2  default hr_api.g_varchar2
169   ,p_labor_contribution           in     varchar2  default hr_api.g_varchar2
170   ,p_health_contribution          in     varchar2  default hr_api.g_varchar2
171   ,p_unemployment_contribution    in     varchar2  default hr_api.g_varchar2
172   ,p_old_age_cont_end_reason      in     varchar2  default hr_api.g_varchar2
173   ,p_pension_cont_end_reason      in     varchar2  default hr_api.g_varchar2
174   ,p_sickness_cont_end_reason     in     varchar2  default hr_api.g_varchar2
175   ,p_work_injury_cont_end_reason  in     varchar2  default hr_api.g_varchar2
176   ,p_labor_fund_cont_end_reason   in     varchar2  default hr_api.g_varchar2
177   ,p_health_cont_end_reason       in     varchar2  default hr_api.g_varchar2
178   ,p_unemployment_cont_end_reason in     varchar2  default hr_api.g_varchar2
179   ,p_effective_start_date            out nocopy date
180   ,p_effective_end_date              out nocopy date
181   ,p_return_status                   out nocopy varchar2
182   ) is
183   --
184   -- Variables for API Boolean parameters
185   l_validate                      boolean;
186   --
187   -- Variables for IN/OUT parameters
188   l_object_version_number         number;
189   --
190   -- Other variables
191   l_proc    varchar2(72) := g_package ||'update_pl_sii_details';
192 Begin
193   hr_utility.set_location(' Entering:' || l_proc,10);
194   --
195   -- Issue a savepoint
196   --
197   savepoint update_pl_sii_details_swi;
198   --
199   -- Initialise Multiple Message Detection
200   --
201   hr_multi_message.enable_message_list;
202   --
203   -- Remember IN OUT parameter IN values
204   --
205   l_object_version_number         := p_object_version_number;
206   --
207   -- Convert constant values to their corresponding boolean value
208   --
209   l_validate :=
210     hr_api.constant_to_boolean
211       (p_constant_value => p_validate);
212   --
213   -- Register Surrogate ID or user key values
214   --
215   --
216   -- Call API
217   --
218   pay_pl_sii_api.update_pl_sii_details
219     (p_validate                     => l_validate
220     ,p_effective_date               => p_effective_date
221     ,p_datetrack_update_mode        => p_datetrack_update_mode
222     ,p_sii_details_id               => p_sii_details_id
223     ,p_object_version_number        => p_object_version_number
224     ,p_emp_social_security_info     => p_emp_social_security_info
225     ,p_old_age_contribution         => p_old_age_contribution
226     ,p_pension_contribution         => p_pension_contribution
227     ,p_sickness_contribution        => p_sickness_contribution
228     ,p_work_injury_contribution     => p_work_injury_contribution
229     ,p_labor_contribution           => p_labor_contribution
230     ,p_health_contribution          => p_health_contribution
231     ,p_unemployment_contribution    => p_unemployment_contribution
232     ,p_old_age_cont_end_reason      => p_old_age_cont_end_reason
233     ,p_pension_cont_end_reason      => p_pension_cont_end_reason
234     ,p_sickness_cont_end_reason     => p_sickness_cont_end_reason
235     ,p_work_injury_cont_end_reason  => p_work_injury_cont_end_reason
236     ,p_labor_fund_cont_end_reason   => p_labor_fund_cont_end_reason
237     ,p_health_cont_end_reason       => p_health_cont_end_reason
238     ,p_unemployment_cont_end_reason => p_unemployment_cont_end_reason
239     ,p_effective_start_date         => p_effective_start_date
240     ,p_effective_end_date           => p_effective_end_date
241     );
242   --
243   -- Convert API warning boolean parameter values to specific
244   -- messages and add them to Multiple Message List
245   --
246   --
247   -- Convert API non-warning boolean parameter values
248   --
249   --
250   -- Derive the API return status value based on whether
251   -- messages of any type exist in the Multiple Message List.
252   -- Also disable Multiple Message Detection.
253   --
254   p_return_status := hr_multi_message.get_return_status_disable;
255   hr_utility.set_location(' Leaving:' || l_proc,20);
256   --
257 exception
258   when hr_multi_message.error_message_exist then
259     --
260     -- Catch the Multiple Message List exception which
261     -- indicates API processing has been aborted because
262     -- at least one message exists in the list.
263     --
264     rollback to update_pl_sii_details_swi;
265     --
266     -- Reset IN OUT parameters and set OUT parameters
267     --
268     p_object_version_number        := l_object_version_number;
269     p_effective_start_date         := null;
270     p_effective_end_date           := null;
271     p_return_status := hr_multi_message.get_return_status_disable;
272     hr_utility.set_location(' Leaving:' || l_proc, 30);
273   when others then
274     --
275     -- When Multiple Message Detection is enabled catch
276     -- any Application specific or other unexpected
277     -- exceptions.  Adding appropriate details to the
278     -- Multiple Message List.  Otherwise re-raise the
279     -- error.
280     --
281     rollback to update_pl_sii_details_swi;
282     if hr_multi_message.unexpected_error_add(l_proc) then
283        hr_utility.set_location(' Leaving:' || l_proc,40);
284        raise;
285     end if;
286     --
287     -- Reset IN OUT and set OUT parameters
288     --
289     p_object_version_number        := l_object_version_number;
290     p_effective_start_date         := null;
291     p_effective_end_date           := null;
292     p_return_status := hr_multi_message.get_return_status_disable;
293     hr_utility.set_location(' Leaving:' || l_proc,50);
294 end update_pl_sii_details;
295 -- ----------------------------------------------------------------------------
296 -- |-------------------------< delete_pl_sii_details >------------------------|
297 -- ----------------------------------------------------------------------------
298 PROCEDURE delete_pl_sii_details
299   (p_validate                     in     number    default hr_api.g_false_num
300   ,p_effective_date               in     date
301   ,p_datetrack_delete_mode        in     varchar2
302   ,p_sii_details_id               in     number
303   ,p_object_version_number        in out nocopy number
304   ,p_effective_start_date            out nocopy date
305   ,p_effective_end_date              out nocopy date
306   ,p_return_status                   out nocopy varchar2
307   ) is
308   --
309   -- Variables for API Boolean parameters
310   l_validate                      boolean;
311   --
312   -- Variables for IN/OUT parameters
313   l_object_version_number         number;
314   --
315   -- Other variables
316   l_proc    varchar2(72) := g_package ||'delete_pl_sii_details';
317 Begin
318   hr_utility.set_location(' Entering:' || l_proc,10);
319   --
320   -- Issue a savepoint
321   --
322   savepoint delete_pl_sii_details_swi;
323   --
324   -- Initialise Multiple Message Detection
325   --
326   hr_multi_message.enable_message_list;
327   --
328   -- Remember IN OUT parameter IN values
329   --
330   l_object_version_number         := p_object_version_number;
331   --
332   -- Convert constant values to their corresponding boolean value
333   --
334   l_validate :=
335     hr_api.constant_to_boolean
336       (p_constant_value => p_validate);
337   --
338   -- Register Surrogate ID or user key values
339   --
340   --
341   -- Call API
342   --
343   pay_pl_sii_api.delete_pl_sii_details
344     (p_validate                     => l_validate
345     ,p_effective_date               => p_effective_date
346     ,p_datetrack_delete_mode        => p_datetrack_delete_mode
347     ,p_sii_details_id               => p_sii_details_id
348     ,p_object_version_number        => p_object_version_number
349     ,p_effective_start_date         => p_effective_start_date
350     ,p_effective_end_date           => p_effective_end_date
351     );
352   --
353   -- Convert API warning boolean parameter values to specific
354   -- messages and add them to Multiple Message List
355   --
356   --
357   -- Convert API non-warning boolean parameter values
358   --
359   --
360   -- Derive the API return status value based on whether
361   -- messages of any type exist in the Multiple Message List.
362   -- Also disable Multiple Message Detection.
363   --
364   p_return_status := hr_multi_message.get_return_status_disable;
365   hr_utility.set_location(' Leaving:' || l_proc,20);
366   --
367 exception
368   when hr_multi_message.error_message_exist then
369     --
370     -- Catch the Multiple Message List exception which
371     -- indicates API processing has been aborted because
372     -- at least one message exists in the list.
373     --
374     rollback to delete_pl_sii_details_swi;
375     --
376     -- Reset IN OUT parameters and set OUT parameters
377     --
378     p_object_version_number        := l_object_version_number;
379     p_effective_start_date         := null;
380     p_effective_end_date           := null;
381     p_return_status := hr_multi_message.get_return_status_disable;
382     hr_utility.set_location(' Leaving:' || l_proc, 30);
383   when others then
384     --
385     -- When Multiple Message Detection is enabled catch
386     -- any Application specific or other unexpected
387     -- exceptions.  Adding appropriate details to the
388     -- Multiple Message List.  Otherwise re-raise the
389     -- error.
390     --
391     rollback to delete_pl_sii_details_swi;
392     if hr_multi_message.unexpected_error_add(l_proc) then
393        hr_utility.set_location(' Leaving:' || l_proc,40);
394        raise;
395     end if;
396     --
397     -- Reset IN OUT and set OUT parameters
398     --
399     p_object_version_number        := l_object_version_number;
400     p_effective_start_date         := null;
401     p_effective_end_date           := null;
402     p_return_status := hr_multi_message.get_return_status_disable;
403     hr_utility.set_location(' Leaving:' || l_proc,50);
404 end delete_pl_sii_details;
405 end pay_pl_sii_swi;