DBA Data[Home] [Help]

PACKAGE BODY: APPS.PQH_BDGT_POOL_REALLOCTIONS_API

Source


1 Package Body pqh_bdgt_pool_realloctions_api as
2 /* $Header: pqbreapi.pkb 115.7 2003/04/02 13:22:47 ggnanagu noship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := '  pqh_bdgt_pool_realloctions_api.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |------------------------< create_realloc_txn_dtl >----------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 procedure create_realloc_txn_dtl
13 (
14    p_validate                       in  boolean
15   ,p_effective_date                 in  date
16   ,p_transaction_id                 in  number
17   ,p_transaction_type               in  varchar2
18   ,p_entity_id                      in  number
19   ,p_budget_detail_id               in  number
20   ,p_txn_detail_id            out nocopy number
21   ,p_object_version_number          out nocopy number
22 ) is
23   --
24   -- Declare cursors and local variables
25   --
26   l_txn_detail_id pqh_bdgt_pool_realloctions.reallocation_id%TYPE;
27   l_proc varchar2(72) := g_package||'create_realloc_txn_dtl';
28   l_object_version_number pqh_bdgt_pool_realloctions.object_version_number%TYPE;
29   --
30 begin
31   --
32     hr_utility.set_location('Entering:'|| l_proc, 10);
33   --
34   -- Issue a savepoint if operating in validation only mode
35   --
36   savepoint create_realloc_txn_dtl;
37   --
38   hr_utility.set_location(l_proc, 20);
39   --
40   -- Process Logic
41   --
42   begin
43     --
44     -- Start of API User Hook for the before hook of create_realloc_txn_dtl
45     --
46     pqh_bdgt_pool_realloctions_bk1.create_realloc_txn_dtl_b
47       (
48        p_transaction_id              =>  p_transaction_id
49       ,p_transaction_type            =>  p_transaction_type
50       ,p_entity_id                   =>  p_entity_id
51       ,p_budget_detail_id            =>  p_budget_detail_id
52       );
53   exception
54     when hr_api.cannot_find_prog_unit then
55       hr_api.cannot_find_prog_unit_error
56         (
57          p_module_name => 'CREATE_REALLOC_TXN_DTL'
58         ,p_hook_type   => 'BP'
59         );
60     --
61     -- End of API User Hook for the before hook of create_realloc_txn_dtl
62     --
63   end;
64   --
65   pqh_bre_ins.ins
66     (
67      p_reallocation_id             => l_txn_detail_id
68     ,p_effective_date              => p_effective_date
69     ,p_entity_id                   => p_entity_id
70     ,p_pool_id                     => p_transaction_id
71     ,p_budget_detail_id            => p_budget_detail_id
72     ,p_transaction_type              => p_transaction_type
73     ,p_object_version_number         => l_object_version_number
74     );
75   --
76   begin
77     --
78     -- Start of API User Hook for the after hook of create_realloc_txn_dtl
79     --
80     pqh_bdgt_pool_realloctions_bk1.create_realloc_txn_dtl_a
81       (
82        p_txn_detail_id            =>  l_txn_detail_id
83       ,p_transaction_id                 =>  p_transaction_id
84       ,p_transaction_type                       =>  p_transaction_type
85       ,p_budget_detail_id                   =>  p_budget_detail_id
86       ,p_entity_id               =>  p_entity_id
87       ,p_object_version_number          =>  l_object_version_number
88       );
89   exception
90     when hr_api.cannot_find_prog_unit then
91       hr_api.cannot_find_prog_unit_error
92         (p_module_name => 'CREATE_REALLOC_TXN_DTL'
93         ,p_hook_type   => 'AP'
94         );
95     --
96     -- End of API User Hook for the after hook of create_realloc_txn_dtl
97     --
98   end;
99   --
100     hr_utility.set_location(l_proc, 60);
101   --
102   -- When in validation only mode raise the Validate_Enabled exception
103   --
104   if p_validate then
105     raise hr_api.validate_enabled;
106   end if;
107   --
108   -- Set all output arguments
109   --
110   p_txn_detail_id := l_txn_detail_id;
111   p_object_version_number := l_object_version_number;
112   --
113     hr_utility.set_location(' Leaving:'||l_proc, 70);
114   --
115 exception
116   --
117   when hr_api.validate_enabled then
118     --
119     -- As the Validate_Enabled exception has been raised
120     -- we must rollback to the savepoint
121     --
122     ROLLBACK TO create_realloc_txn_dtl;
123     --
124     -- Only set output warning arguments
125     -- (Any key or derived arguments must be set to null
126     -- when validation only mode is being used.)
127     --
128     p_txn_detail_id := null;
129     p_object_version_number  := null;
130       hr_utility.set_location(' Leaving:'||l_proc, 80);
131     --
132   when others then
133     --
134     -- A validation or unexpected error has occured
135     --
136     ROLLBACK TO create_realloc_txn_dtl;
137     raise;
138     --
139 end create_realloc_txn_dtl;
140 -- ----------------------------------------------------------------------------
141 -- |------------------------< update_realloc_txn_dtl >--- ------------------|
142 -- ----------------------------------------------------------------------------
143 --
144 procedure update_realloc_txn_dtl
145 (
146    p_validate                       in  boolean
147   ,p_effective_date                 in  date
148   ,p_transaction_id                 in  number
149   ,p_transaction_type               in  varchar2
150   ,p_entity_id                      in  number
151   ,p_budget_detail_id               in  number
152   ,p_txn_detail_id            in  number
153   ,p_object_version_number          in out nocopy number
154 ) is
155   --
156   -- Declare cursors and local variables
157   --
158   l_proc varchar2(72) := g_package||'update_realloc_txn_dtl';
159   l_object_version_number pqh_bdgt_pool_realloctions.object_version_number%TYPE;
160   --
161 begin
162   --
163     hr_utility.set_location('Entering:'|| l_proc, 10);
164   --
165   -- Issue a savepoint if operating in validation only mode
166   --
167   savepoint update_realloc_txn_dtl;
168   --
169     hr_utility.set_location(l_proc, 20);
170   --
171   -- Process Logic
172   --
173   l_object_version_number := p_object_version_number;
174   --
175   begin
176     --
177     -- Start of API User Hook for the before hook of update_realloc_txn_dtl
178     --
179     pqh_bdgt_pool_realloctions_bk2.update_realloc_txn_dtl_b
180       (
181        p_transaction_id                =>  p_transaction_id
182       ,p_transaction_type              =>  p_transaction_type
183       ,p_entity_id                     =>  p_entity_id
184       ,p_budget_detail_id              =>  p_budget_detail_id
185       ,p_txn_detail_id           =>  p_txn_detail_id
186       ,p_object_version_number         =>  l_object_version_number
187       );
188   exception
189     when hr_api.cannot_find_prog_unit then
190       hr_api.cannot_find_prog_unit_error
191         (p_module_name => 'UPDATE_REALLOC_TXN_DTL'
192         ,p_hook_type   => 'BP'
193         );
194     --
195     -- End of API User Hook for the before hook of update_realloc_txn_dtl
196     --
197   end;
198   --
199   pqh_bre_upd.upd
200     (
201      p_pool_id                      => p_transaction_id
202     ,p_effective_date               => p_effective_date
203     ,p_transaction_type             => p_transaction_type
204     ,p_entity_id                    => p_entity_id
205     ,p_budget_detail_id             => p_budget_detail_id
206     ,p_reallocation_id              => p_txn_detail_id
207     ,p_object_version_number        => l_object_version_number
208     );
209   --
210   begin
211     --
212     -- Start of API User Hook for the after hook of update_realloc_txn_dtl
213     --
214     pqh_bdgt_pool_realloctions_bk2.update_realloc_txn_dtl_a
215       (
216      p_transaction_id               => p_transaction_id
217     ,p_transaction_type             => p_transaction_type
218     ,p_entity_id                    => p_entity_id
219     ,p_budget_detail_id             => p_budget_detail_id
220     ,p_txn_detail_id          => p_txn_detail_id
221     ,p_object_version_number        => l_object_version_number
222       );
223   exception
224     when hr_api.cannot_find_prog_unit then
225       hr_api.cannot_find_prog_unit_error
226         (p_module_name => 'UPDATE_REALLOC_TXN_DTL'
227         ,p_hook_type   => 'AP'
228         );
229     --
230     -- End of API User Hook for the after hook of update_realloc_txn_dtl
231     --
232   end;
233   --
234     hr_utility.set_location(l_proc, 60);
235   --
236   -- When in validation only mode raise the Validate_Enabled exception
237   --
238   if p_validate then
239     raise hr_api.validate_enabled;
240   end if;
241   --
242   -- Set all output arguments
243   --
244   p_object_version_number := l_object_version_number;
245   --
246     hr_utility.set_location(' Leaving:'||l_proc, 70);
247   --
248 exception
249   --
250   when hr_api.validate_enabled then
251     --
252     -- As the Validate_Enabled exception has been raised
253     -- we must rollback to the savepoint
254     --
255     ROLLBACK TO update_realloc_txn_dtl;
256     --
257     -- Only set output warning arguments
258     -- (Any key or derived arguments must be set to null
259     -- when validation only mode is being used.)
260     --
261       hr_utility.set_location(' Leaving:'||l_proc, 80);
262     --
263   when others then
264     --
265     -- A validation or unexpected error has occured
266     --
267     ROLLBACK TO update_realloc_txn_dtl;
268     raise;
269     --
270 end update_realloc_txn_dtl;
271 -- ----------------------------------------------------------------------------
272 -- |------------------------< delete_realloc_txn_dtl >----------------------|
273 -- ----------------------------------------------------------------------------
274 --
275 procedure delete_realloc_txn_dtl
276   (p_validate                       in  boolean
277   ,p_txn_detail_id            in  number
278   ,p_object_version_number          in  number
279   ) is
280   --
281   -- Declare cursors and local variables
282   --
283   l_proc varchar2(72) := g_package||'delete_realloc_txn_dtl';
284   l_object_version_number pqh_bdgt_pool_realloctions.object_version_number%TYPE;
285   --
286 begin
287   --
288     hr_utility.set_location('Entering:'|| l_proc, 10);
289   --
290   -- Issue a savepoint if operating in validation only mode
291   --
292   savepoint delete_realloc_txn_dtl;
293   --
294     hr_utility.set_location(l_proc, 20);
295   --
296   -- Process Logic
297   --
298   l_object_version_number := p_object_version_number;
299   --
300   --
301   begin
302     --
303     -- Start of API User Hook for the before hook of delete_realloc_txn_dtl
304     --
305     pqh_bdgt_pool_realloctions_bk3.delete_realloc_txn_dtl_b
306       (
307        p_txn_detail_id            =>  p_txn_detail_id
308       ,p_object_version_number          =>  p_object_version_number
309       );
310   exception
311     when hr_api.cannot_find_prog_unit then
312       hr_api.cannot_find_prog_unit_error
313         (p_module_name => 'DELETE_REALLOC_TXN_DTL'
314         ,p_hook_type   => 'BP'
315         );
316     --
317     -- End of API User Hook for the before hook of delete_realloc_txn_dtl
318     --
319   end;
320   --
321   pqh_bre_del.del
322     (
323      p_reallocation_id               => p_txn_detail_id
324     ,p_object_version_number         => l_object_version_number
325     );
326   --
327   begin
328     --
329     -- Start of API User Hook for the after hook of delete_realloc_txn_dtl
330     --
331     pqh_bdgt_pool_realloctions_bk3.delete_realloc_txn_dtl_a
332       (
333        p_txn_detail_id            =>  p_txn_detail_id
334       ,p_object_version_number          =>  l_object_version_number
335       );
336   exception
337     when hr_api.cannot_find_prog_unit then
338       hr_api.cannot_find_prog_unit_error
339         (p_module_name => 'DELETE_REALLOC_TXN_DTL'
340         ,p_hook_type   => 'AP'
341         );
342     --
343     -- End of API User Hook for the after hook of delete_realloc_txn_dtl
344     --
345   end;
346   --
347     hr_utility.set_location(l_proc, 60);
348   --
349   -- When in validation only mode raise the Validate_Enabled exception
350   --
351   if p_validate then
352     raise hr_api.validate_enabled;
353   end if;
354   --
355     hr_utility.set_location(' Leaving:'||l_proc, 70);
356   --
357 exception
358   --
359   when hr_api.validate_enabled then
360     --
361     -- As the Validate_Enabled exception has been raised
362     -- we must rollback to the savepoint
363     --
364     ROLLBACK TO delete_realloc_txn_dtl;
365     --
366     -- Only set output warning arguments
367     -- (Any key or derived arguments must be set to null
368     -- when validation only mode is being used.)
369     --
370     --
371   when others then
372     --
373     -- A validation or unexpected error has occured
374     --
375     ROLLBACK TO delete_realloc_txn_dtl;
376     raise;
377     --
378 end delete_realloc_txn_dtl;
379 --
380 --
381 -- ----------------------------------------------------------------------------
382 -- |------------------------< create_realloc_txn_period >----------------------|
383 -- ----------------------------------------------------------------------------
384 --
385 procedure create_realloc_txn_period
386 (
387    p_validate                       in  boolean
388   ,p_effective_date                 in  date
389   ,p_txn_detail_id                  in  number
390   ,p_transaction_type               in  varchar2
391   ,p_entity_id                      in  number
392   ,p_budget_period_id               in  number
393   ,p_start_date                     in  date
394   ,p_end_date                       in  date
395   ,p_reallocation_amt               in  number
396   ,p_reserved_amt                   in  number
397   ,p_reallocation_period_id            out nocopy  number
398   ,p_object_version_number          out nocopy  number
399  ) is
400   --
401   -- Declare cursors and local variables
402   --
403   l_reallocation_period_id pqh_bdgt_pool_realloctions.reallocation_id%TYPE;
404   l_proc varchar2(72) := g_package||'create_realloc_txn_period';
405   l_object_version_number pqh_bdgt_pool_realloctions.object_version_number%TYPE;
406   --
407   Cursor csr_prd_txn_id IS
408    SELECT pool_id
409    FROM   pqh_bdgt_pool_realloctions txndtl
410    WHERE  txndtl.reallocation_id = p_txn_detail_id;
411    l_transaction_id NUMBER(15);
412   Cursor csr_dup_rcvr_period(p_transaction_id NUMBER) IS
413    SELECT 1
414    FROM   pqh_budget_pools txn,
415           pqh_bdgt_pool_realloctions txndtl,
416           pqh_bdgt_pool_realloctions txnprd
417    WHERE  txn.pool_id = p_transaction_id
418      AND  txndtl.pool_id = txn.pool_id
419      AND  txndtl.reallocation_id = txnprd.txn_detail_id
420      AND  NVL(txnprd.entity_id,-1) = NVL(p_entity_id,-1)
421  --    AND  NVL(txnprd.start_date,sysdate) = NVL(p_start_date,sysdate)
422  --    AND  NVL(txnprd.end_date,sysdate) = NVL(p_end_date,sysdate);
423   AND NVL(p_end_date,sysdate) >= NVL (txnprd.start_date,sysdate)
424   AND NVL(p_start_date,sysdate) <= NVL(txnprd.end_date,sysdate);
425    l_dup_exist  Varchar2(10);
426 begin
427   --
431   -- Issue a savepoint if operating in validation only mode
428     hr_utility.set_location('Entering:'|| l_proc, 10);
429 
430   --
432   --
433   savepoint create_realloc_txn_period;
434   --Check for duplicate receiver periods
435   IF p_transaction_type = 'RD' THEN
436    OPEN csr_prd_txn_id;
437    FETCH csr_prd_txn_id INTO l_transaction_id;
438    CLOSE csr_prd_txn_id;
439    IF l_transaction_id IS NOT NULL THEN
440      OPEN csr_dup_rcvr_period(l_transaction_id);
441      FETCH csr_dup_rcvr_period INTO l_dup_exist;
442      CLOSE csr_dup_rcvr_period;
443      IF l_dup_exist IS NOT NULL THEN
444         hr_utility.set_message(8302,'PQH_DUP_RCVR_PERIOD');
445         hr_utility.raise_error;
446      END IF;
447    END IF;
448   END IF;
449   --
450   hr_utility.set_location(l_proc, 20);
451   --
452   -- Process Logic
453   --
454   begin
455     --
456     -- Start of API User Hook for the before hook of create_realloc_txn_period
457     --
458     pqh_bdgt_pool_realloctions_bk4.create_realloc_txn_period_b
459       (
460       p_txn_detail_id    => p_txn_detail_id
461       ,p_transaction_type      => p_transaction_type
462       ,p_entity_id             => p_entity_id
463       ,p_budget_period_id      => p_budget_period_id
464       ,p_start_date            => p_start_date
465       ,p_end_date              => p_end_date
466       ,p_reallocation_amt      => p_reallocation_amt
467       ,p_reserved_amt          => p_reserved_amt
468       );
469   exception
470     when hr_api.cannot_find_prog_unit then
471       hr_api.cannot_find_prog_unit_error
472         (
473          p_module_name => 'CREATE_REALLOC_TXN_PERIOD'
474         ,p_hook_type   => 'BP'
475         );
476     --
477     -- End of API User Hook for the before hook of create_realloc_txn_period
478     --
479   end;
480   --
481   pqh_bre_ins.ins
482     (
483        p_txn_detail_id        => p_txn_detail_id
484       ,p_effective_date        => p_effective_date
485       ,p_transaction_type      => p_transaction_type
486       ,p_entity_id             => p_entity_id
487       ,p_budget_period_id      => p_budget_period_id
488       ,p_start_date            => p_start_date
489       ,p_end_date              => p_end_date
490       ,p_reallocation_amt      => p_reallocation_amt
491       ,p_reserved_amt          => p_reserved_amt
492       ,p_reallocation_id       => l_reallocation_period_id
493       ,p_object_version_number => l_object_version_number
494     );
495   --
496   begin
497     --
498     -- Start of API User Hook for the after hook of create_realloc_txn_period
499     --
500     pqh_bdgt_pool_realloctions_bk4.create_realloc_txn_period_a
501       (
502        p_txn_detail_id   => p_txn_detail_id
503       ,p_transaction_type      => p_transaction_type
504       ,p_entity_id             => p_entity_id
505       ,p_budget_period_id      => p_budget_period_id
506       ,p_start_date            => p_start_date
507       ,p_end_date              => p_end_date
508       ,p_reallocation_amt      => p_reallocation_amt
509       ,p_reserved_amt          => p_reserved_amt
510       ,p_reallocation_period_id      => l_reallocation_period_id
511       ,p_object_version_number => l_object_version_number
512       );
513   exception
514     when hr_api.cannot_find_prog_unit then
515       hr_api.cannot_find_prog_unit_error
516         (p_module_name => 'CREATE_REALLOC_TXN_PERIOD'
517         ,p_hook_type   => 'AP'
518         );
519     --
520     -- End of API User Hook for the after hook of create_realloc_txn_period
521     --
522   end;
523   --
524     hr_utility.set_location(l_proc, 60);
525   --
526   -- When in validation only mode raise the Validate_Enabled exception
527   --
528   if p_validate then
529     raise hr_api.validate_enabled;
530   end if;
531   --
532   -- Set all output arguments
533   --
534   p_reallocation_period_id := l_reallocation_period_id;
535   p_object_version_number := l_object_version_number;
536   --
537    hr_utility.set_location(' Leaving:'||l_proc, 70);
538   --
539 exception
540   --
541   when hr_api.validate_enabled then
542     --
543     -- As the Validate_Enabled exception has been raised
544     -- we must rollback to the savepoint
545     --
546     ROLLBACK TO create_realloc_txn_period;
547     --
548     -- Only set output warning arguments
549     -- (Any key or derived arguments must be set to null
550     -- when validation only mode is being used.)
551     --
552     p_reallocation_period_id := null;
553     p_object_version_number  := null;
554       hr_utility.set_location(' Leaving:'||l_proc, 80);
555     --
556   when others then
557     --
558     -- A validation or unexpected error has occured
559     --
560     ROLLBACK TO create_realloc_txn_period;
561     raise;
562     --
563 end create_realloc_txn_period;
564 -- ----------------------------------------------------------------------------
565 -- |------------------------< update_realloc_txn_period >--- ------------------|
566 -- ----------------------------------------------------------------------------
567 --
568 procedure update_realloc_txn_period
569 (
570    p_validate                       in  boolean
571   ,p_effective_date                 in  date
572   ,p_txn_detail_id            in  number
573   ,p_transaction_type               in  varchar2
574   ,p_entity_id                      in  number
575   ,p_budget_period_id               in  number
576   ,p_start_date                     in  date
577   ,p_end_date                       in  date
578   ,p_reallocation_amt               in  number
582 ) is
579   ,p_reserved_amt                   in  number
580   ,p_reallocation_period_id            in  number
581   ,p_object_version_number          in out nocopy number
583   --
584   -- Declare cursors and local variables
585   --
586   l_proc varchar2(72) := g_package||'update_realloc_txn_period';
587   l_object_version_number pqh_bdgt_pool_realloctions.object_version_number%TYPE;
588   --
589   Cursor csr_prd_txn_id IS
590    SELECT pool_id
591    FROM   pqh_bdgt_pool_realloctions txndtl
592    WHERE  txndtl.reallocation_id = p_txn_detail_id;
593    l_transaction_id NUMBER(15);
594   Cursor csr_dup_rcvr_period(p_transaction_id NUMBER) IS
595    SELECT 1
596    FROM   pqh_budget_pools txn,
597           pqh_bdgt_pool_realloctions txndtl,
598           pqh_bdgt_pool_realloctions txnprd
599    WHERE  txn.pool_id = p_transaction_id
600      AND  txndtl.pool_id = txn.pool_id
601      AND  txndtl.reallocation_id = txnprd.txn_detail_id
602      AND  NVL(txnprd.entity_id,-1) = NVL(p_entity_id,-1)
603  --    AND  NVL(txnprd.start_date,sysdate) = NVL(p_start_date,sysdate)
604  --    AND  NVL(txnprd.end_date,sysdate) = NVL(p_end_date,sysdate);
605   AND NVL(p_end_date,sysdate) >= NVL (txnprd.start_date,sysdate)
606   AND NVL(p_start_date,sysdate) <= NVL(txnprd.end_date,sysdate);
607    l_dup_exist varchar2(10);
608 begin
609   --
610     hr_utility.set_location('Entering:'|| l_proc, 10);
611   --
612   -- Issue a savepoint if operating in validation only mode
613   --
614   savepoint update_realloc_txn_period;
615   --
616   --Check for duplicate receiver periods
617   IF p_transaction_type = 'RD' THEN
618    OPEN csr_prd_txn_id;
619    FETCH csr_prd_txn_id INTO l_transaction_id;
620    CLOSE csr_prd_txn_id;
621    IF l_transaction_id IS NOT NULL THEN
622      OPEN csr_dup_rcvr_period(l_transaction_id);
623      FETCH csr_dup_rcvr_period INTO l_dup_exist;
624      CLOSE csr_dup_rcvr_period;
625      IF l_dup_exist IS NOT NULL THEN
626         hr_utility.set_message(8302,'PQH_DUP_RCVR_PERIOD');
627         hr_utility.raise_error;
628      END IF;
629    END IF;
630   END IF;
631   hr_utility.set_location(l_proc, 20);
632   --
633   -- Process Logic
634   --
635   l_object_version_number := p_object_version_number;
636   --
637   begin
638     --
639     -- Start of API User Hook for the before hook of update_realloc_txn_period
640     --
641     pqh_bdgt_pool_realloctions_bk5.update_realloc_txn_period_b
642       (
643        p_txn_detail_id   => p_txn_detail_id
644       ,p_transaction_type      => p_transaction_type
645       ,p_entity_id             => p_entity_id
646       ,p_budget_period_id      => p_budget_period_id
647       ,p_start_date            => p_start_date
648       ,p_end_date              => p_end_date
649       ,p_reallocation_amt      => p_reallocation_amt
650       ,p_reserved_amt          => p_reserved_amt
651       ,p_reallocation_period_id      => p_reallocation_period_id
652       ,p_object_version_number => l_object_version_number
653       );
654   exception
655     when hr_api.cannot_find_prog_unit then
656       hr_api.cannot_find_prog_unit_error
657         (p_module_name => 'UPDATE_REALLOC_TXN_PERIOD'
658         ,p_hook_type   => 'BP'
659         );
660     --
661     -- End of API User Hook for the before hook of update_realloc_txn_period
662     --
663   end;
664   --
665   pqh_bre_upd.upd
666     (
667        p_txn_detail_id        => p_txn_detail_id
668       ,p_effective_date        => p_effective_date
669       ,p_transaction_type      => p_transaction_type
670       ,p_entity_id             => p_entity_id
671       ,p_budget_period_id      => p_budget_period_id
672       ,p_start_date            => p_start_date
673       ,p_end_date              => p_end_date
674       ,p_reallocation_amt      => p_reallocation_amt
675       ,p_reserved_amt          => p_reserved_amt
676       ,p_reallocation_id       => p_reallocation_period_id
677       ,p_object_version_number => l_object_version_number
678     );
679   --
680   begin
681     --
682     -- Start of API User Hook for the after hook of update_realloc_txn_period
683     --
684     pqh_bdgt_pool_realloctions_bk5.update_realloc_txn_period_a
685       (
686        p_txn_detail_id   => p_txn_detail_id
687       ,p_transaction_type      => p_transaction_type
688       ,p_entity_id             => p_entity_id
689       ,p_budget_period_id      => p_budget_period_id
690       ,p_start_date            => p_start_date
691       ,p_end_date              => p_end_date
692       ,p_reallocation_amt      => p_reallocation_amt
693       ,p_reserved_amt          => p_reserved_amt
694       ,p_reallocation_period_id      => p_reallocation_period_id
695       ,p_object_version_number => l_object_version_number
696       );
697   exception
698     when hr_api.cannot_find_prog_unit then
699       hr_api.cannot_find_prog_unit_error
700         (p_module_name => 'UPDATE_REALLOC_TXN_PERIOD'
701         ,p_hook_type   => 'AP'
702         );
703     --
704     -- End of API User Hook for the after hook of update_realloc_txn_period
705     --
706   end;
707   --
708     hr_utility.set_location(l_proc, 60);
709   --
710   -- When in validation only mode raise the Validate_Enabled exception
711   --
712   if p_validate then
713     raise hr_api.validate_enabled;
714   end if;
715   --
716   -- Set all output arguments
717   --
718   p_object_version_number := l_object_version_number;
719   --
720     hr_utility.set_location(' Leaving:'||l_proc, 70);
721   --
722 exception
723   --
724   when hr_api.validate_enabled then
725     --
726     -- As the Validate_Enabled exception has been raised
730     --
727     -- we must rollback to the savepoint
728     --
729     ROLLBACK TO update_realloc_txn_period;
731     -- Only set output warning arguments
732     -- (Any key or derived arguments must be set to null
733     -- when validation only mode is being used.)
734     --
735       hr_utility.set_location(' Leaving:'||l_proc, 80);
736     --
737   when others then
738     --
739     -- A validation or unexpected error has occured
740     --
741     ROLLBACK TO update_realloc_txn_period;
742     raise;
743     --
744 end update_realloc_txn_period;
745 -- ----------------------------------------------------------------------------
746 -- |------------------------< delete_realloc_txn_period >----------------------|
747 -- ----------------------------------------------------------------------------
748 --
749 procedure delete_realloc_txn_period
750   (p_validate                       in  boolean
751   ,p_reallocation_period_id            in  number
752   ,p_object_version_number          in  number
753   ) is
754   --
755   -- Declare cursors and local variables
756   --
757   l_proc varchar2(72) := g_package||'delete_realloc_txn_period';
758   l_object_version_number pqh_bdgt_pool_realloctions.object_version_number%TYPE;
759   --
760 begin
761   --
762     hr_utility.set_location('Entering:'|| l_proc, 10);
763   --
764   -- Issue a savepoint if operating in validation only mode
765   --
766   savepoint delete_realloc_txn_period;
767   --
768     hr_utility.set_location(l_proc, 20);
769   --
770   -- Process Logic
771   --
772   l_object_version_number := p_object_version_number;
773   --
774   --
775   begin
776     --
777     -- Start of API User Hook for the before hook of delete_realloc_txn_period
778     --
779     pqh_bdgt_pool_realloctions_bk6.delete_realloc_txn_period_b
780       (
781        p_reallocation_period_id            =>  p_reallocation_period_id
782       ,p_object_version_number       =>  p_object_version_number
783       );
784   exception
785     when hr_api.cannot_find_prog_unit then
786       hr_api.cannot_find_prog_unit_error
787         (p_module_name => 'DELETE_REALLOC_TXN_PERIOD'
788         ,p_hook_type   => 'BP'
789         );
790     --
791     -- End of API User Hook for the before hook of delete_realloc_txn_period
792     --
793   end;
794   --
795   pqh_bre_del.del
799     );
796     (
797      p_reallocation_id               => p_reallocation_period_id
798     ,p_object_version_number         => l_object_version_number
800   --
801   begin
802     --
803     -- Start of API User Hook for the after hook of delete_realloc_txn_period
804     --
805     pqh_bdgt_pool_realloctions_bk6.delete_realloc_txn_period_a
806       (
807        p_reallocation_period_id                =>  p_reallocation_period_id
808       ,p_object_version_number          =>  l_object_version_number
809       );
810   exception
811     when hr_api.cannot_find_prog_unit then
812       hr_api.cannot_find_prog_unit_error
813         (p_module_name => 'DELETE_REALLOC_TXN_PERIOD'
814         ,p_hook_type   => 'AP'
815         );
816     --
817     -- End of API User Hook for the after hook of delete_realloc_txn_period
818     --
819   end;
820   --
821     hr_utility.set_location(l_proc, 60);
822   --
823   -- When in validation only mode raise the Validate_Enabled exception
824   --
825   if p_validate then
826     raise hr_api.validate_enabled;
827   end if;
828   --
829     hr_utility.set_location(' Leaving:'||l_proc, 70);
830   --
831 exception
832   --
833   when hr_api.validate_enabled then
834     --
835     -- As the Validate_Enabled exception has been raised
836     -- we must rollback to the savepoint
837     --
838     ROLLBACK TO delete_realloc_txn_period;
839     --
840     -- Only set output warning arguments
841     -- (Any key or derived arguments must be set to null
842     -- when validation only mode is being used.)
843     --
844     --
845   when others then
846     --
847     -- A validation or unexpected error has occured
848     --
849     ROLLBACK TO delete_realloc_txn_period;
850     raise;
851     --
852 end delete_realloc_txn_period;
853 --
854 --
855 end pqh_bdgt_pool_realloctions_api;