DBA Data[Home] [Help]

PACKAGE BODY: APPS.PAY_PL_PAYE_SWI

Source


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