DBA Data[Home] [Help]

PACKAGE BODY: APPS.PER_BF_PAYROLL_RUNS_API

Source


1 Package Body PER_BF_PAYROLL_RUNS_API as
2 /* $Header: pebprapi.pkb 115.8 2002/12/02 13:06:45 apholt noship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := '  PER_BF_PAYROLL_RUNS_API.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |--------------------------< <create_payroll_run> >-------------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_payroll_run
13   (p_validate                      in boolean          default false
14   ,p_effective_date                in date
15   ,p_business_group_id             in number
16   ,p_payroll_id                    in number
17   ,p_payroll_identifier            in varchar2
18   ,p_period_start_date             in date             default null
19   ,p_period_end_date               in date             default null
20   ,p_processing_date               in date             default null
21   ,p_bpr_attribute_category        in varchar2         default null
22   ,p_bpr_attribute1                in varchar2         default null
23   ,p_bpr_attribute2                in varchar2         default null
24   ,p_bpr_attribute3                in varchar2         default null
25   ,p_bpr_attribute4                in varchar2         default null
26   ,p_bpr_attribute5                in varchar2         default null
27   ,p_bpr_attribute6                in varchar2         default null
28   ,p_bpr_attribute7                in varchar2         default null
29   ,p_bpr_attribute8                in varchar2         default null
30   ,p_bpr_attribute9                in varchar2         default null
31   ,p_bpr_attribute10               in varchar2         default null
32   ,p_bpr_attribute11               in varchar2         default null
33   ,p_bpr_attribute12               in varchar2         default null
34   ,p_bpr_attribute13               in varchar2         default null
35   ,p_bpr_attribute14               in varchar2         default null
36   ,p_bpr_attribute15               in varchar2         default null
37   ,p_bpr_attribute16               in varchar2         default null
38   ,p_bpr_attribute17               in varchar2         default null
39   ,p_bpr_attribute18               in varchar2         default null
40   ,p_bpr_attribute19               in varchar2         default null
41   ,p_bpr_attribute20               in varchar2         default null
42   ,p_bpr_attribute21               in varchar2         default null
43   ,p_bpr_attribute22               in varchar2         default null
44   ,p_bpr_attribute23               in varchar2         default null
45   ,p_bpr_attribute24               in varchar2         default null
46   ,p_bpr_attribute25               in varchar2         default null
47   ,p_bpr_attribute26               in varchar2         default null
48   ,p_bpr_attribute27               in varchar2         default null
49   ,p_bpr_attribute28               in varchar2         default null
50   ,p_bpr_attribute29               in varchar2         default null
51   ,p_bpr_attribute30               in varchar2     default null
52   --
53   ,p_payroll_run_id                   out nocopy number
54   ,p_object_version_number            out nocopy number
55   )
56 IS
57 --
58   --
59   -- Declare cursors and local variables
60   --
61   l_payroll_run_id        PER_BF_PAYROLL_RUNS.PAYROLL_RUN_ID%TYPE;
62   l_object_version_number PER_BF_PAYROLL_RUNS.OBJECT_VERSION_NUMBER%TYPE;
63   --
64   l_proc                varchar2(72) := g_package||'create_payroll_run';
65 begin
66   hr_utility.set_location('Entering:'|| l_proc, 10);
67   --
68   -- Issue a savepoint
69   --
70   savepoint create_payroll_run;
71   hr_utility.set_location(l_proc, 20);
72   --
73   -- Truncate the time portion from all IN date parameters
74   --
75 
76   --
77   -- Call Before Process User Hook
78   --
79   begin
80     PER_BF_PAYROLL_RUNS_BK1.create_payroll_run_b
81       (p_effective_date                => p_effective_date
82       ,p_business_group_id             => p_business_group_id
83       ,p_payroll_id                    => p_payroll_id
84       ,p_payroll_identifier            => p_payroll_identifier
85       ,p_period_start_date             => p_period_start_date
86       ,p_period_end_date               => p_period_end_date
87       ,p_processing_date               => p_processing_date
88       ,p_bpr_attribute_category        => p_bpr_attribute_category
89       ,p_bpr_attribute1                => p_bpr_attribute1
90       ,p_bpr_attribute2                => p_bpr_attribute2
91       ,p_bpr_attribute3                => p_bpr_attribute3
92       ,p_bpr_attribute4                => p_bpr_attribute4
93       ,p_bpr_attribute5                => p_bpr_attribute5
94       ,p_bpr_attribute6                => p_bpr_attribute6
95       ,p_bpr_attribute7                => p_bpr_attribute7
96       ,p_bpr_attribute8                => p_bpr_attribute8
97       ,p_bpr_attribute9                => p_bpr_attribute9
98       ,p_bpr_attribute10               => p_bpr_attribute10
99       ,p_bpr_attribute11               => p_bpr_attribute11
100       ,p_bpr_attribute12               => p_bpr_attribute12
101       ,p_bpr_attribute13               => p_bpr_attribute13
102       ,p_bpr_attribute14               => p_bpr_attribute14
103       ,p_bpr_attribute15               => p_bpr_attribute15
104       ,p_bpr_attribute16               => p_bpr_attribute16
105       ,p_bpr_attribute17               => p_bpr_attribute17
106       ,p_bpr_attribute18               => p_bpr_attribute18
107       ,p_bpr_attribute19               => p_bpr_attribute19
108       ,p_bpr_attribute20               => p_bpr_attribute20
109       ,p_bpr_attribute21               => p_bpr_attribute21
110       ,p_bpr_attribute22               => p_bpr_attribute22
111       ,p_bpr_attribute23               => p_bpr_attribute23
112       ,p_bpr_attribute24               => p_bpr_attribute24
113       ,p_bpr_attribute25               => p_bpr_attribute25
114       ,p_bpr_attribute26               => p_bpr_attribute26
115       ,p_bpr_attribute27               => p_bpr_attribute27
116       ,p_bpr_attribute28               => p_bpr_attribute28
117       ,p_bpr_attribute29               => p_bpr_attribute29
118       ,p_bpr_attribute30               => p_bpr_attribute30
119       );
120   exception
121     when hr_api.cannot_find_prog_unit then
122       hr_api.cannot_find_prog_unit_error
123         (p_module_name => 'create_payroll_run'
124         ,p_hook_type   => 'BP'
125         );
126   end;
127   hr_utility.set_location(l_proc, 30);
128   --
129   -- Validation in addition to Row Handlers
130   --
131   hr_utility.set_location(l_proc, 40);
132   --
133   -- Process Logic
134   --
135   per_bpr_ins.ins
136     (
137      p_effective_date         => p_effective_date
138     ,p_payroll_id             => p_payroll_id
139     ,p_business_group_id      => p_business_group_id
140     ,p_payroll_identifier     => p_payroll_identifier
141     ,p_period_start_date      => p_period_start_date
142     ,p_period_end_date        => p_period_end_date
143     ,p_processing_date        => p_processing_date
144     ,p_bpr_attribute_category     => p_bpr_attribute_category
145     ,p_bpr_attribute1            => p_bpr_attribute1
146     ,p_bpr_attribute2             => p_bpr_attribute2
147     ,p_bpr_attribute3             => p_bpr_attribute3
148     ,p_bpr_attribute4             => p_bpr_attribute4
149     ,p_bpr_attribute5             => p_bpr_attribute5
150     ,p_bpr_attribute6             => p_bpr_attribute6
151     ,p_bpr_attribute7             => p_bpr_attribute7
152     ,p_bpr_attribute8             => p_bpr_attribute8
153     ,p_bpr_attribute9             => p_bpr_attribute9
154     ,p_bpr_attribute10            => p_bpr_attribute10
155     ,p_bpr_attribute11            => p_bpr_attribute11
156     ,p_bpr_attribute12            => p_bpr_attribute12
157     ,p_bpr_attribute13            => p_bpr_attribute13
158     ,p_bpr_attribute14            => p_bpr_attribute14
159     ,p_bpr_attribute15            => p_bpr_attribute15
160     ,p_bpr_attribute16            => p_bpr_attribute16
161     ,p_bpr_attribute17            => p_bpr_attribute17
162     ,p_bpr_attribute18            => p_bpr_attribute18
163     ,p_bpr_attribute19            => p_bpr_attribute19
164     ,p_bpr_attribute20            => p_bpr_attribute20
165     ,p_bpr_attribute21            => p_bpr_attribute21
166     ,p_bpr_attribute22            => p_bpr_attribute22
167     ,p_bpr_attribute23            => p_bpr_attribute23
168     ,p_bpr_attribute24            => p_bpr_attribute24
169     ,p_bpr_attribute25            => p_bpr_attribute25
170     ,p_bpr_attribute26            => p_bpr_attribute26
171     ,p_bpr_attribute27            => p_bpr_attribute27
172     ,p_bpr_attribute28            => p_bpr_attribute28
173     ,p_bpr_attribute29            => p_bpr_attribute29
174     ,p_bpr_attribute30            => p_bpr_attribute30
175     ,p_payroll_run_id         => l_payroll_run_id -- Out
176     ,p_object_version_number  => l_object_version_number -- Out
177     );
178   --
179   hr_utility.set_location(l_proc, 50);
180   --
181   -- Call After Process User Hook
182   --
183   begin
184     PER_BF_PAYROLL_RUNS_BK1.create_payroll_run_a
185       (p_effective_date                => p_effective_date
186       ,p_business_group_id             => p_business_group_id
187       ,p_payroll_id                    => p_payroll_id
188       ,p_payroll_identifier            => p_payroll_identifier
189       ,p_period_start_date             => p_period_start_date
190       ,p_period_end_date               => p_period_end_date
191       ,p_processing_date               => p_processing_date
192       ,p_payroll_run_id                => l_payroll_run_id
193       ,p_object_version_number         => l_object_version_number
194       ,p_bpr_attribute_category        => p_bpr_attribute_category
195       ,p_bpr_attribute1                => p_bpr_attribute1
196       ,p_bpr_attribute2                => p_bpr_attribute2
197       ,p_bpr_attribute3                => p_bpr_attribute3
198       ,p_bpr_attribute4                => p_bpr_attribute4
199       ,p_bpr_attribute5                => p_bpr_attribute5
200       ,p_bpr_attribute6                => p_bpr_attribute6
201       ,p_bpr_attribute7                => p_bpr_attribute7
202       ,p_bpr_attribute8                => p_bpr_attribute8
203       ,p_bpr_attribute9                => p_bpr_attribute9
204       ,p_bpr_attribute10               => p_bpr_attribute10
205       ,p_bpr_attribute11               => p_bpr_attribute11
206       ,p_bpr_attribute12               => p_bpr_attribute12
207       ,p_bpr_attribute13               => p_bpr_attribute13
208       ,p_bpr_attribute14               => p_bpr_attribute14
209       ,p_bpr_attribute15               => p_bpr_attribute15
210       ,p_bpr_attribute16               => p_bpr_attribute16
211       ,p_bpr_attribute17               => p_bpr_attribute17
212       ,p_bpr_attribute18               => p_bpr_attribute18
213       ,p_bpr_attribute19               => p_bpr_attribute19
214       ,p_bpr_attribute20               => p_bpr_attribute20
215       ,p_bpr_attribute21               => p_bpr_attribute21
216       ,p_bpr_attribute22               => p_bpr_attribute22
217       ,p_bpr_attribute23               => p_bpr_attribute23
218       ,p_bpr_attribute24               => p_bpr_attribute24
219       ,p_bpr_attribute25               => p_bpr_attribute25
220       ,p_bpr_attribute26               => p_bpr_attribute26
221       ,p_bpr_attribute27               => p_bpr_attribute27
222       ,p_bpr_attribute28               => p_bpr_attribute28
223       ,p_bpr_attribute29               => p_bpr_attribute29
224       ,p_bpr_attribute30               => p_bpr_attribute30
225       );
226   exception
227     when hr_api.cannot_find_prog_unit then
228       hr_api.cannot_find_prog_unit_error
229         (p_module_name => 'create_payroll_run'
230         ,p_hook_type   => 'AP'
231         );
232   end;
233   hr_utility.set_location(l_proc, 60);
234   --
235   -- When in validation only mode raise the Validate_Enabled exception
236   --
237   if p_validate then
238     raise hr_api.validate_enabled;
239   end if;
240   --
241   -- Set all output arguments
242   --
243   p_payroll_run_id         := l_payroll_run_id;
244   p_object_version_number  := l_object_version_number;
245   --
246   hr_utility.set_location(' Leaving:'||l_proc, 70);
247 exception
248   when hr_api.validate_enabled then
249     --
250     -- As the Validate_Enabled exception has been raised
251     -- we must rollback to the savepoint
252     --
253     rollback to create_payroll_run;
254     --
255     -- Only set output warning arguments
256     -- (Any key or derived arguments must be set to null
257     -- when validation only mode is being used.)
258     --
259     p_payroll_run_id         := null;
260     p_object_version_number  := null;
261     hr_utility.set_location(' Leaving:'||l_proc, 80);
262   when others then
263     --
264     -- A validation or unexpected error has occured
265     --
266     rollback to create_payroll_run;
267     --set out NOCOPY variables
268     p_payroll_run_id         := null;
269     p_object_version_number  := null;
270     hr_utility.set_location(' Leaving:'||l_proc, 90);
271     raise;
272 end create_payroll_run;
273 --
274 -- ----------------------------------------------------------------------------
275 -- |---------------------------< update_payroll_run >-------------------------|
276 -- ----------------------------------------------------------------------------
277 --
278 procedure update_payroll_run
279   (p_payroll_run_id                in number
280   ,p_payroll_identifier            in varchar2         default hr_api.g_varchar2
281   ,p_period_start_date             in date             default hr_api.g_date
282   ,p_period_end_date               in date             default hr_api.g_date
283   ,p_processing_date               in date             default hr_api.g_date
284   ,p_bpr_attribute_category        in varchar2         default hr_api.g_varchar2
285   ,p_bpr_attribute1                in varchar2         default hr_api.g_varchar2
286   ,p_bpr_attribute2                in varchar2         default hr_api.g_varchar2
287   ,p_bpr_attribute3                in varchar2         default hr_api.g_varchar2
288   ,p_bpr_attribute4                in varchar2         default hr_api.g_varchar2
289   ,p_bpr_attribute5                in varchar2         default hr_api.g_varchar2
290   ,p_bpr_attribute6                in varchar2         default hr_api.g_varchar2
291   ,p_bpr_attribute7                in varchar2         default hr_api.g_varchar2
292   ,p_bpr_attribute8                in varchar2         default hr_api.g_varchar2
293   ,p_bpr_attribute9                in varchar2         default hr_api.g_varchar2
294   ,p_bpr_attribute10               in varchar2         default hr_api.g_varchar2
295   ,p_bpr_attribute11               in varchar2         default hr_api.g_varchar2
296   ,p_bpr_attribute12               in varchar2         default hr_api.g_varchar2
297   ,p_bpr_attribute13               in varchar2         default hr_api.g_varchar2
298   ,p_bpr_attribute14               in varchar2         default hr_api.g_varchar2
299   ,p_bpr_attribute15               in varchar2         default hr_api.g_varchar2
300   ,p_bpr_attribute16               in varchar2         default hr_api.g_varchar2
301   ,p_bpr_attribute17               in varchar2         default hr_api.g_varchar2
302   ,p_bpr_attribute18               in varchar2         default hr_api.g_varchar2
303   ,p_bpr_attribute19               in varchar2         default hr_api.g_varchar2
304   ,p_bpr_attribute20               in varchar2         default hr_api.g_varchar2
305   ,p_bpr_attribute21               in varchar2         default hr_api.g_varchar2
306   ,p_bpr_attribute22               in varchar2         default hr_api.g_varchar2
307   ,p_bpr_attribute23               in varchar2         default hr_api.g_varchar2
308   ,p_bpr_attribute24               in varchar2         default hr_api.g_varchar2
309   ,p_bpr_attribute25               in varchar2         default hr_api.g_varchar2
310   ,p_bpr_attribute26               in varchar2         default hr_api.g_varchar2
311   ,p_bpr_attribute27               in varchar2         default hr_api.g_varchar2
312   ,p_bpr_attribute28               in varchar2         default hr_api.g_varchar2
313   ,p_bpr_attribute29               in varchar2         default hr_api.g_varchar2
314   ,p_bpr_attribute30               in varchar2         default hr_api.g_varchar2
318   )
315   ,p_validate                      in boolean          default false
316   ,p_effective_date                in date
317   ,p_object_version_number         in out nocopy number
319 IS
320 --
321   --
322   -- Declare cursors and local variables
323   --
324   l_object_version_number   NUMBER;
325   l_proc                varchar2(72) := g_package||'update_payroll_run';
326 begin
327   hr_utility.set_location('Entering:'|| l_proc, 10);
328   --
329   -- Issue a savepoint
330   --
331   savepoint update_payroll_run;
332   hr_utility.set_location(l_proc, 20);
333   --
334   -- Truncate the time portion from all IN date parameters
335   --
336 
337   --
338   -- Call Before Process User Hook
339   --
340   begin
341     PER_BF_PAYROLL_RUNS_BK2.update_payroll_run_b
342       (p_effective_date                => p_effective_date
343       ,p_payroll_identifier            => p_payroll_identifier
344       ,p_period_start_date             => p_period_start_date
345       ,p_period_end_date               => p_period_end_date
346       ,p_processing_date               => p_processing_date
347       ,p_bpr_attribute_category        => p_bpr_attribute_category
348       ,p_bpr_attribute1                => p_bpr_attribute1
349       ,p_bpr_attribute2                => p_bpr_attribute2
350       ,p_bpr_attribute3                => p_bpr_attribute3
351       ,p_bpr_attribute4                => p_bpr_attribute4
352       ,p_bpr_attribute5                => p_bpr_attribute5
353       ,p_bpr_attribute6                => p_bpr_attribute6
354       ,p_bpr_attribute7                => p_bpr_attribute7
355       ,p_bpr_attribute8                => p_bpr_attribute8
356       ,p_bpr_attribute9                => p_bpr_attribute9
357       ,p_bpr_attribute10               => p_bpr_attribute10
358       ,p_bpr_attribute11               => p_bpr_attribute11
359       ,p_bpr_attribute12               => p_bpr_attribute12
360       ,p_bpr_attribute13               => p_bpr_attribute13
361       ,p_bpr_attribute14               => p_bpr_attribute14
362       ,p_bpr_attribute15               => p_bpr_attribute15
363       ,p_bpr_attribute16               => p_bpr_attribute16
364       ,p_bpr_attribute17               => p_bpr_attribute17
365       ,p_bpr_attribute18               => p_bpr_attribute18
366       ,p_bpr_attribute19               => p_bpr_attribute19
367       ,p_bpr_attribute20               => p_bpr_attribute20
368       ,p_bpr_attribute21               => p_bpr_attribute21
369       ,p_bpr_attribute22               => p_bpr_attribute22
370       ,p_bpr_attribute23               => p_bpr_attribute23
371       ,p_bpr_attribute24               => p_bpr_attribute24
372       ,p_bpr_attribute25               => p_bpr_attribute25
373       ,p_bpr_attribute26               => p_bpr_attribute26
374       ,p_bpr_attribute27               => p_bpr_attribute27
375       ,p_bpr_attribute28               => p_bpr_attribute28
376       ,p_bpr_attribute29               => p_bpr_attribute29
377       ,p_bpr_attribute30               => p_bpr_attribute30
378       ,p_payroll_run_id                => p_payroll_run_id
379       ,p_object_version_number         => p_object_version_number
380       );
381   exception
382     when hr_api.cannot_find_prog_unit then
383       hr_api.cannot_find_prog_unit_error
384         (p_module_name => 'update_payroll_run'
385         ,p_hook_type   => 'BP'
386         );
387   end;
388   hr_utility.set_location(l_proc, 30);
389   --
390   -- Validation in addition to Row Handlers
391   --
392   hr_utility.set_location(l_proc, 40);
393   --
394   -- Process Logic
395   --
396   l_object_version_number   := p_object_version_number;
397   --
398   per_bpr_upd.upd
399     (
400      p_effective_date         => p_effective_date
401     ,p_payroll_run_id         => p_payroll_run_id
402     ,p_payroll_identifier     => p_payroll_identifier
403     ,p_period_start_date      => p_period_start_date
404     ,p_period_end_date        => p_period_end_date
405     ,p_processing_date        => p_processing_date
406     ,p_bpr_attribute_category     => p_bpr_attribute_category
407     ,p_bpr_attribute1            => p_bpr_attribute1
408     ,p_bpr_attribute2             => p_bpr_attribute2
409     ,p_bpr_attribute3             => p_bpr_attribute3
410     ,p_bpr_attribute4             => p_bpr_attribute4
411     ,p_bpr_attribute5             => p_bpr_attribute5
412     ,p_bpr_attribute6             => p_bpr_attribute6
413     ,p_bpr_attribute7             => p_bpr_attribute7
414     ,p_bpr_attribute8             => p_bpr_attribute8
415     ,p_bpr_attribute9             => p_bpr_attribute9
416     ,p_bpr_attribute10            => p_bpr_attribute10
417     ,p_bpr_attribute11            => p_bpr_attribute11
418     ,p_bpr_attribute12            => p_bpr_attribute12
419     ,p_bpr_attribute13            => p_bpr_attribute13
420     ,p_bpr_attribute14            => p_bpr_attribute14
421     ,p_bpr_attribute15            => p_bpr_attribute15
422     ,p_bpr_attribute16            => p_bpr_attribute16
423     ,p_bpr_attribute17            => p_bpr_attribute17
424     ,p_bpr_attribute18            => p_bpr_attribute18
425     ,p_bpr_attribute19            => p_bpr_attribute19
426     ,p_bpr_attribute20            => p_bpr_attribute20
427     ,p_bpr_attribute21            => p_bpr_attribute21
428     ,p_bpr_attribute22            => p_bpr_attribute22
429     ,p_bpr_attribute23            => p_bpr_attribute23
430     ,p_bpr_attribute24            => p_bpr_attribute24
434     ,p_bpr_attribute28            => p_bpr_attribute28
431     ,p_bpr_attribute25            => p_bpr_attribute25
432     ,p_bpr_attribute26            => p_bpr_attribute26
433     ,p_bpr_attribute27            => p_bpr_attribute27
435     ,p_bpr_attribute29            => p_bpr_attribute29
436     ,p_bpr_attribute30            => p_bpr_attribute30
437     ,p_object_version_number  => l_object_version_number -- Out
438     );
439   --
440   hr_utility.set_location(l_proc, 50);
441   --
442   -- Call After Process User Hook
443   --
444   begin
445     PER_BF_PAYROLL_RUNS_BK2.update_payroll_run_a
446       (p_effective_date                => p_effective_date
447       ,p_payroll_identifier            => p_payroll_identifier
448       ,p_period_start_date             => p_period_start_date
449       ,p_period_end_date               => p_period_end_date
450       ,p_processing_date               => p_processing_date
451       ,p_payroll_run_id                => p_payroll_run_id
452       ,p_object_version_number         => p_object_version_number
453       ,p_bpr_attribute_category        => p_bpr_attribute_category
454       ,p_bpr_attribute1                => p_bpr_attribute1
455       ,p_bpr_attribute2                => p_bpr_attribute2
456       ,p_bpr_attribute3                => p_bpr_attribute3
457       ,p_bpr_attribute4                => p_bpr_attribute4
458       ,p_bpr_attribute5                => p_bpr_attribute5
459       ,p_bpr_attribute6                => p_bpr_attribute6
460       ,p_bpr_attribute7                => p_bpr_attribute7
461       ,p_bpr_attribute8                => p_bpr_attribute8
462       ,p_bpr_attribute9                => p_bpr_attribute9
463       ,p_bpr_attribute10               => p_bpr_attribute10
464       ,p_bpr_attribute11               => p_bpr_attribute11
465       ,p_bpr_attribute12               => p_bpr_attribute12
466       ,p_bpr_attribute13               => p_bpr_attribute13
467       ,p_bpr_attribute14               => p_bpr_attribute14
468       ,p_bpr_attribute15               => p_bpr_attribute15
469       ,p_bpr_attribute16               => p_bpr_attribute16
470       ,p_bpr_attribute17               => p_bpr_attribute17
471       ,p_bpr_attribute18               => p_bpr_attribute18
472       ,p_bpr_attribute19               => p_bpr_attribute19
473       ,p_bpr_attribute20               => p_bpr_attribute20
474       ,p_bpr_attribute21               => p_bpr_attribute21
475       ,p_bpr_attribute22               => p_bpr_attribute22
476       ,p_bpr_attribute23               => p_bpr_attribute23
477       ,p_bpr_attribute24               => p_bpr_attribute24
478       ,p_bpr_attribute25               => p_bpr_attribute25
479       ,p_bpr_attribute26               => p_bpr_attribute26
480       ,p_bpr_attribute27               => p_bpr_attribute27
481       ,p_bpr_attribute28               => p_bpr_attribute28
482       ,p_bpr_attribute29               => p_bpr_attribute29
483       ,p_bpr_attribute30               => p_bpr_attribute30
484       );
485   exception
486     when hr_api.cannot_find_prog_unit then
487       hr_api.cannot_find_prog_unit_error
488         (p_module_name => 'update_payroll_run'
489         ,p_hook_type   => 'AP'
490         );
491   end;
492   hr_utility.set_location(l_proc, 60);
493   --
494   -- When in validation only mode raise the Validate_Enabled exception
495   --
496   if p_validate then
497     raise hr_api.validate_enabled;
498   end if;
499   --
500   -- Set all output arguments
501   --
502   p_object_version_number  := l_object_version_number;
503   --
504   hr_utility.set_location(' Leaving:'||l_proc, 70);
505 exception
506   when hr_api.validate_enabled then
507     --
508     -- As the Validate_Enabled exception has been raised
509     -- we must rollback to the savepoint
510     --
511     rollback to update_payroll_run;
512     --
513     -- Only set output warning arguments
514     -- (Any key or derived arguments must be set to null
515     -- when validation only mode is being used.)
516     --
517     p_object_version_number  := null;
518     hr_utility.set_location(' Leaving:'||l_proc, 80);
519   when others then
520     --
521     -- A validation or unexpected error has occured
522     --
523     rollback to update_payroll_run;
524     hr_utility.set_location(' Leaving:'||l_proc, 90);
525     raise;
526 end update_payroll_run;
527 --
528 -- ----------------------------------------------------------------------------
529 -- |---------------------------< delete_payroll_run >-------------------------|
530 -- ----------------------------------------------------------------------------
531 --
532 procedure delete_payroll_run
533   (p_payroll_run_id                in number
534   ,p_validate                      in boolean          default false
535   ,p_object_version_number         in number
536   )
537 IS
538 --
539   --
540   -- Declare cursors and local variables
541   --
542   l_proc                varchar2(72) := g_package||'delete_payroll_run';
543 begin
544   hr_utility.set_location('Entering:'|| l_proc, 10);
545   --
546   -- Issue a savepoint
547   --
548   savepoint delete_payroll_run;
549   hr_utility.set_location(l_proc, 20);
550   --
551   -- Truncate the time portion from all IN date parameters
552   --
553 
554   --
555   -- Call Before Process User Hook
556   --
557   begin
561       ,p_object_version_number         => p_object_version_number
558     PER_BF_PAYROLL_RUNS_BK3.delete_payroll_run_b
559       (
560        p_payroll_run_id                => p_payroll_run_id
562       );
563   exception
564     when hr_api.cannot_find_prog_unit then
565       hr_api.cannot_find_prog_unit_error
566         (p_module_name => 'delete_payroll_run'
567         ,p_hook_type   => 'BP'
568         );
569   end;
570   hr_utility.set_location(l_proc, 30);
571   --
572   -- Validation in addition to Row Handlers
573   --
574   hr_utility.set_location(l_proc, 40);
575   --
576   -- Process Logic
577   --
578   per_bpr_del.del
579     (
580      p_payroll_run_id         => p_payroll_run_id
581     ,p_object_version_number  => p_object_version_number
582     );
583   --
584   hr_utility.set_location(l_proc, 50);
585   --
586   -- Call After Process User Hook
587   --
588   begin
589     PER_BF_PAYROLL_RUNS_BK3.delete_payroll_run_a
590       (
591        p_payroll_run_id                => p_payroll_run_id
592       ,p_object_version_number         => p_object_version_number
593       );
594   exception
595     when hr_api.cannot_find_prog_unit then
596       hr_api.cannot_find_prog_unit_error
597         (p_module_name => 'delete_payroll_run'
598         ,p_hook_type   => 'AP'
599         );
600   end;
601   hr_utility.set_location(l_proc, 60);
602   --
603   -- When in validation only mode raise the Validate_Enabled exception
604   --
605   if p_validate then
606     raise hr_api.validate_enabled;
607   end if;
608   --
609   -- Set all output arguments
610   --
611   hr_utility.set_location(' Leaving:'||l_proc, 70);
612 exception
613   when hr_api.validate_enabled then
614     --
615     -- As the Validate_Enabled exception has been raised
616     -- we must rollback to the savepoint
617     --
618     rollback to delete_payroll_run;
619     --
620     -- Only set output warning arguments
621     -- (Any key or derived arguments must be set to null
622     -- when validation only mode is being used.)
623     --
624     hr_utility.set_location(' Leaving:'||l_proc, 80);
625   when others then
626     --
627     -- A validation or unexpected error has occured
628     --
629     rollback to delete_payroll_run;
630     hr_utility.set_location(' Leaving:'||l_proc, 90);
631     raise;
632 end delete_payroll_run;
633 end PER_BF_PAYROLL_RUNS_API;