DBA Data[Home] [Help]

PACKAGE BODY: APPS.OTA_FINANCE_HEADER_SWI

Source


1 PACKAGE BODY OTA_FINANCE_HEADER_SWI As
2 /* $Header: ottfhswi.pkb 120.0 2005/05/29 07:41 appldev noship $ */
3 --
4 -- Package variables
5 --
6 g_package  varchar2(33) := 'ota_finance_header_swi.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |-------------------------< create_finance_header >------------------------|
10 -- ----------------------------------------------------------------------------
11 PROCEDURE create_finance_header
12   (p_finance_header_id            in   out nocopy number
13   ,p_object_version_number           out nocopy number
14   ,p_superceding_header_id        in     number
15   ,p_authorizer_person_id         in     number
16   ,p_organization_id              in     number
17   ,p_administrator                in     number
18   ,p_cancelled_flag               in     varchar2
19   ,p_currency_code                in     varchar2
20   ,p_date_raised                  in     date
21   ,p_payment_status_flag          in     varchar2
22   ,p_transfer_status              in     varchar2
23   ,p_type                         in     varchar2
24   ,p_receivable_type              in     varchar2
25   ,p_comments                     in     varchar2
26   ,p_external_reference           in     varchar2
27   ,p_invoice_address              in     varchar2
28   ,p_invoice_contact              in     varchar2
29   ,p_payment_method               in     varchar2
30   ,p_pym_information_category     in     varchar2
31   ,p_pym_attribute1               in     varchar2
32   ,p_pym_attribute2               in     varchar2
33   ,p_pym_attribute3               in     varchar2
34   ,p_pym_attribute4               in     varchar2
35   ,p_pym_attribute5               in     varchar2
36   ,p_pym_attribute6               in     varchar2
37   ,p_pym_attribute7               in     varchar2
38   ,p_pym_attribute8               in     varchar2
39   ,p_pym_attribute9               in     varchar2
40   ,p_pym_attribute10              in     varchar2
41   ,p_pym_attribute11              in     varchar2
42   ,p_pym_attribute12              in     varchar2
43   ,p_pym_attribute13              in     varchar2
44   ,p_pym_attribute14              in     varchar2
45   ,p_pym_attribute15              in     varchar2
46   ,p_pym_attribute16              in     varchar2
47   ,p_pym_attribute17              in     varchar2
48   ,p_pym_attribute18              in     varchar2
49   ,p_pym_attribute19              in     varchar2
50   ,p_pym_attribute20              in     varchar2
51   ,p_transfer_date                in     date
52   ,p_transfer_message             in     varchar2
53   ,p_vendor_id                    in     number
54   ,p_contact_id                   in     number
55   ,p_address_id                   in     number
56   ,p_customer_id                  in     number
57   ,p_tfh_information_category     in     varchar2
58   ,p_tfh_information1             in     varchar2
59   ,p_tfh_information2             in     varchar2
60   ,p_tfh_information3             in     varchar2
61   ,p_tfh_information4             in     varchar2
62   ,p_tfh_information5             in     varchar2
63   ,p_tfh_information6             in     varchar2
64   ,p_tfh_information7             in     varchar2
65   ,p_tfh_information8             in     varchar2
66   ,p_tfh_information9             in     varchar2
67   ,p_tfh_information10            in     varchar2
68   ,p_tfh_information11            in     varchar2
69   ,p_tfh_information12            in     varchar2
70   ,p_tfh_information13            in     varchar2
71   ,p_tfh_information14            in     varchar2
72   ,p_tfh_information15            in     varchar2
73   ,p_tfh_information16            in     varchar2
74   ,p_tfh_information17            in     varchar2
75   ,p_tfh_information18            in     varchar2
76   ,p_tfh_information19            in     varchar2
77   ,p_tfh_information20            in     varchar2
78   ,p_paying_cost_center           in     varchar2
79   ,p_receiving_cost_center        in     varchar2
80   ,p_transfer_from_set_of_book_id in     number
81   ,p_transfer_to_set_of_book_id   in     number
82   ,p_from_segment1                in     varchar2
83   ,p_from_segment2                in     varchar2
84   ,p_from_segment3                in     varchar2
85   ,p_from_segment4                in     varchar2
86   ,p_from_segment5                in     varchar2
87   ,p_from_segment6                in     varchar2
88   ,p_from_segment7                in     varchar2
89   ,p_from_segment8                in     varchar2
90   ,p_from_segment9                in     varchar2
91   ,p_from_segment10               in     varchar2
92   ,p_from_segment11               in     varchar2
93   ,p_from_segment12               in     varchar2
94   ,p_from_segment13               in     varchar2
95   ,p_from_segment14               in     varchar2
96   ,p_from_segment15               in     varchar2
97   ,p_from_segment16               in     varchar2
98   ,p_from_segment17               in     varchar2
99   ,p_from_segment18               in     varchar2
100   ,p_from_segment19               in     varchar2
101   ,p_from_segment20               in     varchar2
102   ,p_from_segment21               in     varchar2
103   ,p_from_segment22               in     varchar2
104   ,p_from_segment23               in     varchar2
105   ,p_from_segment24               in     varchar2
106   ,p_from_segment25               in     varchar2
107   ,p_from_segment26               in     varchar2
108   ,p_from_segment27               in     varchar2
109   ,p_from_segment28               in     varchar2
110   ,p_from_segment29               in     varchar2
111   ,p_from_segment30               in     varchar2
112   ,p_to_segment1                  in     varchar2
113   ,p_to_segment2                  in     varchar2
114   ,p_to_segment3                  in     varchar2
115   ,p_to_segment4                  in     varchar2
116   ,p_to_segment5                  in     varchar2
117   ,p_to_segment6                  in     varchar2
118   ,p_to_segment7                  in     varchar2
119   ,p_to_segment8                  in     varchar2
120   ,p_to_segment9                  in     varchar2
121   ,p_to_segment10                 in     varchar2
122   ,p_to_segment11                 in     varchar2
123   ,p_to_segment12                 in     varchar2
124   ,p_to_segment13                 in     varchar2
125   ,p_to_segment14                 in     varchar2
126   ,p_to_segment15                 in     varchar2
127   ,p_to_segment16                 in     varchar2
128   ,p_to_segment17                 in     varchar2
129   ,p_to_segment18                 in     varchar2
130   ,p_to_segment19                 in     varchar2
131   ,p_to_segment20                 in     varchar2
132   ,p_to_segment21                 in     varchar2
133   ,p_to_segment22                 in     varchar2
134   ,p_to_segment23                 in     varchar2
135   ,p_to_segment24                 in     varchar2
136   ,p_to_segment25                 in     varchar2
137   ,p_to_segment26                 in     varchar2
138   ,p_to_segment27                 in     varchar2
139   ,p_to_segment28                 in     varchar2
140   ,p_to_segment29                 in     varchar2
141   ,p_to_segment30                 in     varchar2
142   ,p_transfer_from_cc_id          in     number
143   ,p_transfer_to_cc_id            in     number
144   ,p_validate                     in     number    default hr_api.g_false_num
145   ,p_effective_date               in     date
146   ,p_return_status                   out nocopy varchar2
147   ) is
148   --
149   -- Variables for API Boolean parameters
150   l_validate                      boolean;
151   --
152   -- Variables for IN/OUT parameters
153   --
154   -- Other variables
155   l_proc    varchar2(72) := g_package ||'create_finance_header';
156 Begin
157   hr_utility.set_location(' Entering:' || l_proc,10);
158   --
159   -- Issue a savepoint
160   --
161   savepoint create_finance_header_swi;
162   --
163   -- Initialise Multiple Message Detection
164   --
165   hr_multi_message.enable_message_list;
166   --
167   -- Remember IN OUT parameter IN values
168   --
169   --
170   -- Convert constant values to their corresponding boolean value
171   --
172   l_validate :=
173     hr_api.constant_to_boolean
174       (p_constant_value => p_validate);
175   --
176   -- Register Surrogate ID or user key values
177   --
178 ota_tfh_api_ins.set_base_key_value(finance_header_id => p_finance_header_id  );
179   --
180   -- Call API
181   --
182   ota_finance_header_api.create_finance_header
183     (p_finance_header_id            => p_finance_header_id
184     ,p_object_version_number        => p_object_version_number
185     ,p_superceding_header_id        => p_superceding_header_id
186     ,p_authorizer_person_id         => p_authorizer_person_id
187     ,p_organization_id              => p_organization_id
188     ,p_administrator                => p_administrator
189     ,p_cancelled_flag               => p_cancelled_flag
190     ,p_currency_code                => p_currency_code
191     ,p_date_raised                  => p_date_raised
192     ,p_payment_status_flag          => p_payment_status_flag
193     ,p_transfer_status              => p_transfer_status
194     ,p_type                         => p_type
195     ,p_receivable_type              => p_receivable_type
196     ,p_comments                     => p_comments
197     ,p_external_reference           => p_external_reference
198     ,p_invoice_address              => p_invoice_address
199     ,p_invoice_contact              => p_invoice_contact
200     ,p_payment_method               => p_payment_method
201     ,p_pym_information_category     => p_pym_information_category
202     ,p_pym_attribute1               => p_pym_attribute1
203     ,p_pym_attribute2               => p_pym_attribute2
204     ,p_pym_attribute3               => p_pym_attribute3
205     ,p_pym_attribute4               => p_pym_attribute4
206     ,p_pym_attribute5               => p_pym_attribute5
207     ,p_pym_attribute6               => p_pym_attribute6
208     ,p_pym_attribute7               => p_pym_attribute7
209     ,p_pym_attribute8               => p_pym_attribute8
210     ,p_pym_attribute9               => p_pym_attribute9
211     ,p_pym_attribute10              => p_pym_attribute10
212     ,p_pym_attribute11              => p_pym_attribute11
213     ,p_pym_attribute12              => p_pym_attribute12
214     ,p_pym_attribute13              => p_pym_attribute13
215     ,p_pym_attribute14              => p_pym_attribute14
216     ,p_pym_attribute15              => p_pym_attribute15
217     ,p_pym_attribute16              => p_pym_attribute16
218     ,p_pym_attribute17              => p_pym_attribute17
219     ,p_pym_attribute18              => p_pym_attribute18
220     ,p_pym_attribute19              => p_pym_attribute19
221     ,p_pym_attribute20              => p_pym_attribute20
222     ,p_transfer_date                => p_transfer_date
223     ,p_transfer_message             => p_transfer_message
224     ,p_vendor_id                    => p_vendor_id
225     ,p_contact_id                   => p_contact_id
226     ,p_address_id                   => p_address_id
227     ,p_customer_id                  => p_customer_id
228     ,p_tfh_information_category     => p_tfh_information_category
229     ,p_tfh_information1             => p_tfh_information1
230     ,p_tfh_information2             => p_tfh_information2
231     ,p_tfh_information3             => p_tfh_information3
232     ,p_tfh_information4             => p_tfh_information4
233     ,p_tfh_information5             => p_tfh_information5
234     ,p_tfh_information6             => p_tfh_information6
235     ,p_tfh_information7             => p_tfh_information7
236     ,p_tfh_information8             => p_tfh_information8
237     ,p_tfh_information9             => p_tfh_information9
238     ,p_tfh_information10            => p_tfh_information10
239     ,p_tfh_information11            => p_tfh_information11
240     ,p_tfh_information12            => p_tfh_information12
241     ,p_tfh_information13            => p_tfh_information13
242     ,p_tfh_information14            => p_tfh_information14
243     ,p_tfh_information15            => p_tfh_information15
244     ,p_tfh_information16            => p_tfh_information16
245     ,p_tfh_information17            => p_tfh_information17
246     ,p_tfh_information18            => p_tfh_information18
247     ,p_tfh_information19            => p_tfh_information19
248     ,p_tfh_information20            => p_tfh_information20
249     ,p_paying_cost_center           => p_paying_cost_center
250     ,p_receiving_cost_center        => p_receiving_cost_center
251     ,p_transfer_from_set_of_book_id => p_transfer_from_set_of_book_id
252     ,p_transfer_to_set_of_book_id   => p_transfer_to_set_of_book_id
253     ,p_from_segment1                => p_from_segment1
254     ,p_from_segment2                => p_from_segment2
255     ,p_from_segment3                => p_from_segment3
256     ,p_from_segment4                => p_from_segment4
257     ,p_from_segment5                => p_from_segment5
258     ,p_from_segment6                => p_from_segment6
259     ,p_from_segment7                => p_from_segment7
260     ,p_from_segment8                => p_from_segment8
261     ,p_from_segment9                => p_from_segment9
262     ,p_from_segment10               => p_from_segment10
263     ,p_from_segment11               => p_from_segment11
264     ,p_from_segment12               => p_from_segment12
265     ,p_from_segment13               => p_from_segment13
266     ,p_from_segment14               => p_from_segment14
267     ,p_from_segment15               => p_from_segment15
268     ,p_from_segment16               => p_from_segment16
269     ,p_from_segment17               => p_from_segment17
270     ,p_from_segment18               => p_from_segment18
271     ,p_from_segment19               => p_from_segment19
272     ,p_from_segment20               => p_from_segment20
273     ,p_from_segment21               => p_from_segment21
274     ,p_from_segment22               => p_from_segment22
275     ,p_from_segment23               => p_from_segment23
276     ,p_from_segment24               => p_from_segment24
277     ,p_from_segment25               => p_from_segment25
278     ,p_from_segment26               => p_from_segment26
279     ,p_from_segment27               => p_from_segment27
280     ,p_from_segment28               => p_from_segment28
281     ,p_from_segment29               => p_from_segment29
282     ,p_from_segment30               => p_from_segment30
283     ,p_to_segment1                  => p_to_segment1
284     ,p_to_segment2                  => p_to_segment2
285     ,p_to_segment3                  => p_to_segment3
286     ,p_to_segment4                  => p_to_segment4
287     ,p_to_segment5                  => p_to_segment5
288     ,p_to_segment6                  => p_to_segment6
289     ,p_to_segment7                  => p_to_segment7
290     ,p_to_segment8                  => p_to_segment8
291     ,p_to_segment9                  => p_to_segment9
292     ,p_to_segment10                 => p_to_segment10
293     ,p_to_segment11                 => p_to_segment11
294     ,p_to_segment12                 => p_to_segment12
295     ,p_to_segment13                 => p_to_segment13
296     ,p_to_segment14                 => p_to_segment14
297     ,p_to_segment15                 => p_to_segment15
298     ,p_to_segment16                 => p_to_segment16
299     ,p_to_segment17                 => p_to_segment17
300     ,p_to_segment18                 => p_to_segment18
301     ,p_to_segment19                 => p_to_segment19
302     ,p_to_segment20                 => p_to_segment20
303     ,p_to_segment21                 => p_to_segment21
304     ,p_to_segment22                 => p_to_segment22
305     ,p_to_segment23                 => p_to_segment23
306     ,p_to_segment24                 => p_to_segment24
307     ,p_to_segment25                 => p_to_segment25
308     ,p_to_segment26                 => p_to_segment26
309     ,p_to_segment27                 => p_to_segment27
310     ,p_to_segment28                 => p_to_segment28
311     ,p_to_segment29                 => p_to_segment29
312     ,p_to_segment30                 => p_to_segment30
313     ,p_transfer_from_cc_id          => p_transfer_from_cc_id
314     ,p_transfer_to_cc_id            => p_transfer_to_cc_id
315     ,p_validate                     => l_validate
316     ,p_effective_date               => p_effective_date
317     );
318   --
319   -- Convert API warning boolean parameter values to specific
320   -- messages and add them to Multiple Message List
321   --
322   --
323   -- Convert API non-warning boolean parameter values
324   --
325   --
326   -- Derive the API return status value based on whether
327   -- messages of any type exist in the Multiple Message List.
328   -- Also disable Multiple Message Detection.
329   --
330   p_return_status := hr_multi_message.get_return_status_disable;
331   hr_utility.set_location(' Leaving:' || l_proc,20);
332   --
333 exception
334   when hr_multi_message.error_message_exist then
335     --
336     -- Catch the Multiple Message List exception which
337     -- indicates API processing has been aborted because
338     -- at least one message exists in the list.
339     --
340     rollback to create_finance_header_swi;
341     --
342     -- Reset IN OUT parameters and set OUT parameters
343     --
344     p_finance_header_id            := null;
345     p_object_version_number        := null;
349     --
346     p_return_status := hr_multi_message.get_return_status_disable;
347     hr_utility.set_location(' Leaving:' || l_proc, 30);
348   when others then
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 create_finance_header_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_finance_header_id            := null;
365     p_object_version_number        := null;
366     p_return_status := hr_multi_message.get_return_status_disable;
367     hr_utility.set_location(' Leaving:' || l_proc,50);
368 end create_finance_header;
369 -- ----------------------------------------------------------------------------
370 -- |-------------------------< update_finance_header >------------------------|
371 -- ----------------------------------------------------------------------------
372 PROCEDURE update_finance_header
373   (p_finance_header_id            in     number
374   ,p_object_version_number        in out nocopy number
375   ,p_new_object_version_number       out nocopy number
376   ,p_superceding_header_id        in     number
377   ,p_authorizer_person_id         in     number
378   ,p_organization_id              in     number
379   ,p_administrator                in     number
380   ,p_cancelled_flag               in     varchar2
381   ,p_currency_code                in     varchar2
382   ,p_date_raised                  in     date
383   ,p_payment_status_flag          in     varchar2
384   ,p_transfer_status              in     varchar2
385   ,p_type                         in     varchar2
386   ,p_receivable_type              in     varchar2
387   ,p_comments                     in     varchar2
388   ,p_external_reference           in     varchar2
389   ,p_invoice_address              in     varchar2
390   ,p_invoice_contact              in     varchar2
391   ,p_payment_method               in     varchar2
392   ,p_pym_information_category     in     varchar2
393   ,p_pym_attribute1               in     varchar2
394   ,p_pym_attribute2               in     varchar2
395   ,p_pym_attribute3               in     varchar2
396   ,p_pym_attribute4               in     varchar2
397   ,p_pym_attribute5               in     varchar2
398   ,p_pym_attribute6               in     varchar2
399   ,p_pym_attribute7               in     varchar2
400   ,p_pym_attribute8               in     varchar2
401   ,p_pym_attribute9               in     varchar2
402   ,p_pym_attribute10              in     varchar2
403   ,p_pym_attribute11              in     varchar2
404   ,p_pym_attribute12              in     varchar2
405   ,p_pym_attribute13              in     varchar2
406   ,p_pym_attribute14              in     varchar2
407   ,p_pym_attribute15              in     varchar2
408   ,p_pym_attribute16              in     varchar2
409   ,p_pym_attribute17              in     varchar2
410   ,p_pym_attribute18              in     varchar2
411   ,p_pym_attribute19              in     varchar2
412   ,p_pym_attribute20              in     varchar2
413   ,p_transfer_date                in     date
414   ,p_transfer_message             in     varchar2
415   ,p_vendor_id                    in     number
416   ,p_contact_id                   in     number
417   ,p_address_id                   in     number
418   ,p_customer_id                  in     number
419   ,p_tfh_information_category     in     varchar2
420   ,p_tfh_information1             in     varchar2
421   ,p_tfh_information2             in     varchar2
422   ,p_tfh_information3             in     varchar2
423   ,p_tfh_information4             in     varchar2
424   ,p_tfh_information5             in     varchar2
425   ,p_tfh_information6             in     varchar2
426   ,p_tfh_information7             in     varchar2
427   ,p_tfh_information8             in     varchar2
428   ,p_tfh_information9             in     varchar2
429   ,p_tfh_information10            in     varchar2
430   ,p_tfh_information11            in     varchar2
431   ,p_tfh_information12            in     varchar2
432   ,p_tfh_information13            in     varchar2
433   ,p_tfh_information14            in     varchar2
434   ,p_tfh_information15            in     varchar2
435   ,p_tfh_information16            in     varchar2
436   ,p_tfh_information17            in     varchar2
437   ,p_tfh_information18            in     varchar2
438   ,p_tfh_information19            in     varchar2
439   ,p_tfh_information20            in     varchar2
440   ,p_paying_cost_center           in     varchar2
441   ,p_receiving_cost_center        in     varchar2
442   ,p_transfer_from_set_of_book_id in     number
443   ,p_transfer_to_set_of_book_id   in     number
444   ,p_from_segment1                in     varchar2
445   ,p_from_segment2                in     varchar2
446   ,p_from_segment3                in     varchar2
447   ,p_from_segment4                in     varchar2
448   ,p_from_segment5                in     varchar2
449   ,p_from_segment6                in     varchar2
450   ,p_from_segment7                in     varchar2
451   ,p_from_segment8                in     varchar2
452   ,p_from_segment9                in     varchar2
453   ,p_from_segment10               in     varchar2
454   ,p_from_segment11               in     varchar2
455   ,p_from_segment12               in     varchar2
456   ,p_from_segment13               in     varchar2
457   ,p_from_segment14               in     varchar2
458   ,p_from_segment15               in     varchar2
459   ,p_from_segment16               in     varchar2
460   ,p_from_segment17               in     varchar2
464   ,p_from_segment21               in     varchar2
461   ,p_from_segment18               in     varchar2
462   ,p_from_segment19               in     varchar2
463   ,p_from_segment20               in     varchar2
465   ,p_from_segment22               in     varchar2
466   ,p_from_segment23               in     varchar2
467   ,p_from_segment24               in     varchar2
468   ,p_from_segment25               in     varchar2
469   ,p_from_segment26               in     varchar2
470   ,p_from_segment27               in     varchar2
471   ,p_from_segment28               in     varchar2
472   ,p_from_segment29               in     varchar2
473   ,p_from_segment30               in     varchar2
474   ,p_to_segment1                  in     varchar2
475   ,p_to_segment2                  in     varchar2
476   ,p_to_segment3                  in     varchar2
477   ,p_to_segment4                  in     varchar2
478   ,p_to_segment5                  in     varchar2
479   ,p_to_segment6                  in     varchar2
480   ,p_to_segment7                  in     varchar2
481   ,p_to_segment8                  in     varchar2
482   ,p_to_segment9                  in     varchar2
483   ,p_to_segment10                 in     varchar2
484   ,p_to_segment11                 in     varchar2
485   ,p_to_segment12                 in     varchar2
486   ,p_to_segment13                 in     varchar2
487   ,p_to_segment14                 in     varchar2
488   ,p_to_segment15                 in     varchar2
489   ,p_to_segment16                 in     varchar2
490   ,p_to_segment17                 in     varchar2
491   ,p_to_segment18                 in     varchar2
492   ,p_to_segment19                 in     varchar2
493   ,p_to_segment20                 in     varchar2
494   ,p_to_segment21                 in     varchar2
495   ,p_to_segment22                 in     varchar2
496   ,p_to_segment23                 in     varchar2
497   ,p_to_segment24                 in     varchar2
498   ,p_to_segment25                 in     varchar2
499   ,p_to_segment26                 in     varchar2
500   ,p_to_segment27                 in     varchar2
501   ,p_to_segment28                 in     varchar2
502   ,p_to_segment29                 in     varchar2
503   ,p_to_segment30                 in     varchar2
504   ,p_transfer_from_cc_id          in     number
505   ,p_transfer_to_cc_id            in     number
506   ,p_validate                     in     number    default hr_api.g_false_num
507   ,p_effective_date               in     date
508   ,p_return_status                   out nocopy varchar2
509   ) is
510   --
511   -- Variables for API Boolean parameters
512   l_validate                      boolean;
513   --
514   -- Variables for IN/OUT parameters
515   l_object_version_number         number;
516   --
517   -- Other variables
518   l_proc    varchar2(72) := g_package ||'update_finance_header';
519 Begin
520   hr_utility.set_location(' Entering:' || l_proc,10);
521   --
522   -- Issue a savepoint
523   --
524   savepoint update_finance_header_swi;
525   --
526   -- Initialise Multiple Message Detection
527   --
528   hr_multi_message.enable_message_list;
529   --
530   -- Remember IN OUT parameter IN values
531   --
532   l_object_version_number         := p_object_version_number;
533   --
534   -- Convert constant values to their corresponding boolean value
535   --
536   l_validate :=
537     hr_api.constant_to_boolean
538       (p_constant_value => p_validate);
539   --
540   -- Register Surrogate ID or user key values
541   --
542   --
543   -- Call API
544   --
545   ota_finance_header_api.update_finance_header
546     (p_finance_header_id            => p_finance_header_id
547     ,p_object_version_number        => p_object_version_number
548     ,p_new_object_version_number    => p_new_object_version_number
549     ,p_superceding_header_id        => p_superceding_header_id
550     ,p_authorizer_person_id         => p_authorizer_person_id
551     ,p_organization_id              => p_organization_id
552     ,p_administrator                => p_administrator
553     ,p_cancelled_flag               => p_cancelled_flag
554     ,p_currency_code                => p_currency_code
555     ,p_date_raised                  => p_date_raised
556     ,p_payment_status_flag          => p_payment_status_flag
557     ,p_transfer_status              => p_transfer_status
558     ,p_type                         => p_type
559     ,p_receivable_type              => p_receivable_type
560     ,p_comments                     => p_comments
561     ,p_external_reference           => p_external_reference
562     ,p_invoice_address              => p_invoice_address
563     ,p_invoice_contact              => p_invoice_contact
564     ,p_payment_method               => p_payment_method
565     ,p_pym_information_category     => p_pym_information_category
566     ,p_pym_attribute1               => p_pym_attribute1
567     ,p_pym_attribute2               => p_pym_attribute2
568     ,p_pym_attribute3               => p_pym_attribute3
569     ,p_pym_attribute4               => p_pym_attribute4
570     ,p_pym_attribute5               => p_pym_attribute5
571     ,p_pym_attribute6               => p_pym_attribute6
572     ,p_pym_attribute7               => p_pym_attribute7
573     ,p_pym_attribute8               => p_pym_attribute8
574     ,p_pym_attribute9               => p_pym_attribute9
575     ,p_pym_attribute10              => p_pym_attribute10
576     ,p_pym_attribute11              => p_pym_attribute11
577     ,p_pym_attribute12              => p_pym_attribute12
578     ,p_pym_attribute13              => p_pym_attribute13
579     ,p_pym_attribute14              => p_pym_attribute14
580     ,p_pym_attribute15              => p_pym_attribute15
581     ,p_pym_attribute16              => p_pym_attribute16
582     ,p_pym_attribute17              => p_pym_attribute17
586     ,p_transfer_date                => p_transfer_date
583     ,p_pym_attribute18              => p_pym_attribute18
584     ,p_pym_attribute19              => p_pym_attribute19
585     ,p_pym_attribute20              => p_pym_attribute20
587     ,p_transfer_message             => p_transfer_message
588     ,p_vendor_id                    => p_vendor_id
589     ,p_contact_id                   => p_contact_id
590     ,p_address_id                   => p_address_id
591     ,p_customer_id                  => p_customer_id
592     ,p_tfh_information_category     => p_tfh_information_category
593     ,p_tfh_information1             => p_tfh_information1
594     ,p_tfh_information2             => p_tfh_information2
595     ,p_tfh_information3             => p_tfh_information3
596     ,p_tfh_information4             => p_tfh_information4
597     ,p_tfh_information5             => p_tfh_information5
598     ,p_tfh_information6             => p_tfh_information6
599     ,p_tfh_information7             => p_tfh_information7
600     ,p_tfh_information8             => p_tfh_information8
601     ,p_tfh_information9             => p_tfh_information9
602     ,p_tfh_information10            => p_tfh_information10
603     ,p_tfh_information11            => p_tfh_information11
604     ,p_tfh_information12            => p_tfh_information12
605     ,p_tfh_information13            => p_tfh_information13
606     ,p_tfh_information14            => p_tfh_information14
607     ,p_tfh_information15            => p_tfh_information15
608     ,p_tfh_information16            => p_tfh_information16
609     ,p_tfh_information17            => p_tfh_information17
610     ,p_tfh_information18            => p_tfh_information18
611     ,p_tfh_information19            => p_tfh_information19
612     ,p_tfh_information20            => p_tfh_information20
613     ,p_paying_cost_center           => p_paying_cost_center
614     ,p_receiving_cost_center        => p_receiving_cost_center
615     ,p_transfer_from_set_of_book_id => p_transfer_from_set_of_book_id
616     ,p_transfer_to_set_of_book_id   => p_transfer_to_set_of_book_id
617     ,p_from_segment1                => p_from_segment1
618     ,p_from_segment2                => p_from_segment2
619     ,p_from_segment3                => p_from_segment3
620     ,p_from_segment4                => p_from_segment4
621     ,p_from_segment5                => p_from_segment5
622     ,p_from_segment6                => p_from_segment6
623     ,p_from_segment7                => p_from_segment7
624     ,p_from_segment8                => p_from_segment8
625     ,p_from_segment9                => p_from_segment9
626     ,p_from_segment10               => p_from_segment10
627     ,p_from_segment11               => p_from_segment11
628     ,p_from_segment12               => p_from_segment12
629     ,p_from_segment13               => p_from_segment13
630     ,p_from_segment14               => p_from_segment14
631     ,p_from_segment15               => p_from_segment15
632     ,p_from_segment16               => p_from_segment16
633     ,p_from_segment17               => p_from_segment17
634     ,p_from_segment18               => p_from_segment18
635     ,p_from_segment19               => p_from_segment19
636     ,p_from_segment20               => p_from_segment20
637     ,p_from_segment21               => p_from_segment21
638     ,p_from_segment22               => p_from_segment22
639     ,p_from_segment23               => p_from_segment23
640     ,p_from_segment24               => p_from_segment24
641     ,p_from_segment25               => p_from_segment25
642     ,p_from_segment26               => p_from_segment26
643     ,p_from_segment27               => p_from_segment27
644     ,p_from_segment28               => p_from_segment28
645     ,p_from_segment29               => p_from_segment29
646     ,p_from_segment30               => p_from_segment30
647     ,p_to_segment1                  => p_to_segment1
648     ,p_to_segment2                  => p_to_segment2
649     ,p_to_segment3                  => p_to_segment3
650     ,p_to_segment4                  => p_to_segment4
651     ,p_to_segment5                  => p_to_segment5
652     ,p_to_segment6                  => p_to_segment6
653     ,p_to_segment7                  => p_to_segment7
654     ,p_to_segment8                  => p_to_segment8
655     ,p_to_segment9                  => p_to_segment9
656     ,p_to_segment10                 => p_to_segment10
657     ,p_to_segment11                 => p_to_segment11
658     ,p_to_segment12                 => p_to_segment12
659     ,p_to_segment13                 => p_to_segment13
660     ,p_to_segment14                 => p_to_segment14
661     ,p_to_segment15                 => p_to_segment15
662     ,p_to_segment16                 => p_to_segment16
663     ,p_to_segment17                 => p_to_segment17
664     ,p_to_segment18                 => p_to_segment18
665     ,p_to_segment19                 => p_to_segment19
666     ,p_to_segment20                 => p_to_segment20
667     ,p_to_segment21                 => p_to_segment21
668     ,p_to_segment22                 => p_to_segment22
669     ,p_to_segment23                 => p_to_segment23
670     ,p_to_segment24                 => p_to_segment24
671     ,p_to_segment25                 => p_to_segment25
672     ,p_to_segment26                 => p_to_segment26
673     ,p_to_segment27                 => p_to_segment27
674     ,p_to_segment28                 => p_to_segment28
675     ,p_to_segment29                 => p_to_segment29
676     ,p_to_segment30                 => p_to_segment30
677     ,p_transfer_from_cc_id          => p_transfer_from_cc_id
678     ,p_transfer_to_cc_id            => p_transfer_to_cc_id
679     ,p_validate                     => l_validate
680     ,p_effective_date               => p_effective_date
681     );
682   --
683   -- Convert API warning boolean parameter values to specific
684   -- messages and add them to Multiple Message List
685   --
686   --
687   -- Convert API non-warning boolean parameter values
688   --
692   -- Also disable Multiple Message Detection.
689   --
690   -- Derive the API return status value based on whether
691   -- messages of any type exist in the Multiple Message List.
693   --
694   p_return_status := hr_multi_message.get_return_status_disable;
695   hr_utility.set_location(' Leaving:' || l_proc,20);
696   --
697 exception
698   when hr_multi_message.error_message_exist then
699     --
700     -- Catch the Multiple Message List exception which
701     -- indicates API processing has been aborted because
702     -- at least one message exists in the list.
703     --
704     rollback to update_finance_header_swi;
705     --
706     -- Reset IN OUT parameters and set OUT parameters
707     --
708     p_object_version_number        := l_object_version_number;
709     p_new_object_version_number    := null;
710     p_return_status := hr_multi_message.get_return_status_disable;
711     hr_utility.set_location(' Leaving:' || l_proc, 30);
712   when others then
713     --
714     -- When Multiple Message Detection is enabled catch
715     -- any Application specific or other unexpected
716     -- exceptions.  Adding appropriate details to the
717     -- Multiple Message List.  Otherwise re-raise the
718     -- error.
719     --
720     rollback to update_finance_header_swi;
721     if hr_multi_message.unexpected_error_add(l_proc) then
722        hr_utility.set_location(' Leaving:' || l_proc,40);
723        raise;
724     end if;
725     --
726     -- Reset IN OUT and set OUT parameters
727     --
728     p_object_version_number        := l_object_version_number;
729     p_new_object_version_number    := null;
730     p_return_status := hr_multi_message.get_return_status_disable;
731     hr_utility.set_location(' Leaving:' || l_proc,50);
732 end update_finance_header;
733 -- ----------------------------------------------------------------------------
734 -- |-------------------------< delete_finance_header >------------------------|
735 -- ----------------------------------------------------------------------------
736 PROCEDURE delete_finance_header
737   (p_validate                     in     number    default hr_api.g_false_num
738   ,p_finance_header_id            in     number
739   ,p_object_version_number        in     number
740   ,p_return_status                   out nocopy varchar2
741   ) is
742   --
743   -- Variables for API Boolean parameters
744   l_validate                      boolean;
745   --
746   -- Variables for IN/OUT parameters
747   --
748   -- Other variables
749   l_proc    varchar2(72) := g_package ||'delete_finance_header';
750 Begin
751   hr_utility.set_location(' Entering:' || l_proc,10);
752   --
753   -- Issue a savepoint
754   --
755   savepoint delete_finance_header_swi;
756   --
757   -- Initialise Multiple Message Detection
758   --
759   hr_multi_message.enable_message_list;
760   --
761   -- Remember IN OUT parameter IN values
762   --
763   --
764   -- Convert constant values to their corresponding boolean value
765   --
766   l_validate :=
767     hr_api.constant_to_boolean
768       (p_constant_value => p_validate);
769   --
770   -- Register Surrogate ID or user key values
771   --
772   --
773   -- Call API
774   --
775   ota_finance_header_api.delete_finance_header
776     (p_validate                     => l_validate
777     ,p_finance_header_id            => p_finance_header_id
778     ,p_object_version_number        => p_object_version_number
779     );
780   --
781   -- Convert API warning boolean parameter values to specific
782   -- messages and add them to Multiple Message List
783   --
784   --
785   -- Convert API non-warning boolean parameter values
786   --
787   --
788   -- Derive the API return status value based on whether
789   -- messages of any type exist in the Multiple Message List.
790   -- Also disable Multiple Message Detection.
791   --
792   p_return_status := hr_multi_message.get_return_status_disable;
793   hr_utility.set_location(' Leaving:' || l_proc,20);
794   --
795 exception
796   when hr_multi_message.error_message_exist then
797     --
798     -- Catch the Multiple Message List exception which
799     -- indicates API processing has been aborted because
800     -- at least one message exists in the list.
801     --
802     rollback to delete_finance_header_swi;
803     --
804     -- Reset IN OUT parameters and set OUT parameters
805     --
806     p_return_status := hr_multi_message.get_return_status_disable;
807     hr_utility.set_location(' Leaving:' || l_proc, 30);
808   when others then
809     --
810     -- When Multiple Message Detection is enabled catch
811     -- any Application specific or other unexpected
812     -- exceptions.  Adding appropriate details to the
813     -- Multiple Message List.  Otherwise re-raise the
814     -- error.
815     --
816     rollback to delete_finance_header_swi;
817     if hr_multi_message.unexpected_error_add(l_proc) then
818        hr_utility.set_location(' Leaving:' || l_proc,40);
819        raise;
820     end if;
821     --
822     -- Reset IN OUT and set OUT parameters
823     --
824     p_return_status := hr_multi_message.get_return_status_disable;
825     hr_utility.set_location(' Leaving:' || l_proc,50);
826 end delete_finance_header;
827 
828 --
829 -- ----------------------------------------------------------------------------
830 -- |---------------------------< cancel_header >------------------------------|
831 -- ----------------------------------------------------------------------------
832 --
833 -- PUBLIC
834 --
835 -- OVERLOADING PROCEDURE
836 --
837 -- Description:
841 --   the new cancellation header in the supersedes_header_id attribute.
838 --   The update of cancelled_flag is not permitted by any other means
839 --   than to call this procedure to cancel. This sets the cancelled_flag
840 --   to 'Y' and creates a cancellation header with the old header_id on
842 --   The procedure 'CANCEL_LINES_FOR_HEADER', found in the lines API,
843 --   will then be called.
844 --
845 Procedure cancel_header
846   (
847    p_finance_header_id     in   number
848   ,p_cancel_header_id      out  nocopy number
849   ,p_date_raised           in   date
850   ,p_validate              in   number    default hr_api.g_false_num
851   ,p_commit                in   number    default hr_api.g_false_num
852   ,p_return_status  out nocopy VARCHAR2
853   ) is
854 
855     l_validate                      boolean;
856     l_commit                        boolean;
857   l_proc    varchar2(72) := g_package ||'cancel_header';
858 Begin
859   hr_utility.set_location(' Entering:' || l_proc,10);
860    --
861   -- Issue a savepoint
862   --
863   savepoint cancel_header_swi;
864   --
865   -- Initialise Multiple Message Detection
866   --
867   hr_multi_message.enable_message_list;
868   --
869   -- Remember IN OUT parameter IN values
870   --
871   --
872   -- Convert constant values to their corresponding boolean value
873   --
874   l_validate :=
875     hr_api.constant_to_boolean
876       (p_constant_value => p_validate);
877 
878     l_commit :=
879     hr_api.constant_to_boolean
880       (p_constant_value => p_commit);
881 
882    ota_tfh_api_business_rules.cancel_header
883   (
884    p_finance_header_id     => p_finance_header_id
885   ,p_cancel_header_id      => p_cancel_header_id
886   ,p_date_raised           => p_date_raised
887   ,p_validate              => l_validate
888   ,p_commit                => l_commit
889   );
890 
891  p_return_status := hr_multi_message.get_return_status_disable;
892   hr_utility.set_location(' Leaving:' || l_proc,20);
893 exception
894   when hr_multi_message.error_message_exist then
895     --
896     -- Catch the Multiple Message List exception which
897     -- indicates API processing has been aborted because
898     -- at least one message exists in the list.
899     --
900     rollback to cancel_header_swi;
901     --
902     -- Reset IN OUT parameters and set OUT parameters
903     --
904     p_return_status := hr_multi_message.get_return_status_disable;
905     hr_utility.set_location(' Leaving:' || l_proc, 30);
906   when others then
907     --
908     -- When Multiple Message Detection is enabled catch
909     -- any Application specific or other unexpected
910     -- exceptions.  Adding appropriate details to the
911     -- Multiple Message List.  Otherwise re-raise the
912     -- error.
913     --
914     rollback to cancel_header_swi;
915     if hr_multi_message.unexpected_error_add(l_proc) then
916        hr_utility.set_location(' Leaving:' || l_proc,40);
917        raise;
918     end if;
919 
920     --
921     p_return_status := hr_multi_message.get_return_status_disable;
922     hr_utility.set_location(' Leaving:' || l_proc,50);
923 
924 end cancel_header;
925 
926 --
927 -- ----------------------------------------------------------------------------
928 -- |--------------------------< recancel_header >-----------------------------|
929 -- ----------------------------------------------------------------------------
930 --
931 -- PUBLIC
932 --
933 --
934 -- Description:
935 --   The update of cancelled_flag is not permitted by any other means
936 --   than to call this procedure to cancel. This sets the cancelled_flag
937 --   to 'N' and creates a cancellation header with the old header_id on
938 --   the new cancellation header in the supersedes_header_id attribute.
939 --   The procedure 'RECANCEL_LINES_FOR_HEADER', found in the lines API,
940 --   will then be called.
941 --
942 Procedure recancel_header
943   (
944    p_finance_header_id     in   number
945   ,p_validate              in   number    default hr_api.g_false_num
946   ,p_commit                in   number    default hr_api.g_false_num
947   ,p_return_status  out nocopy VARCHAR2
948   ) is
949     l_validate                      boolean;
950     l_commit                        boolean;
951   l_proc    varchar2(72) := g_package ||'recancel_header';
952 Begin
953 
954   hr_utility.set_location(' Entering:' || l_proc,10);
955    --
956   -- Issue a savepoint
957   --
958   savepoint recancel_header_swi;
959   --
960   -- Initialise Multiple Message Detection
961   --
962   hr_multi_message.enable_message_list;
963   --
964   -- Remember IN OUT parameter IN values
965   --
966   --
967   -- Convert constant values to their corresponding boolean value
968   --
969   l_validate :=
970     hr_api.constant_to_boolean
971       (p_constant_value => p_validate);
972 
973     l_commit :=
974     hr_api.constant_to_boolean
975       (p_constant_value => p_commit);
976 
977    ota_tfh_api_business_rules.recancel_header
978   (
979    p_finance_header_id     => p_finance_header_id
980   ,p_validate              => l_validate
981   ,p_commit                => l_commit
982   );
983 
984 
985   p_return_status := hr_multi_message.get_return_status_disable;
986   hr_utility.set_location(' Leaving:' || l_proc,20);
987 exception
988   when hr_multi_message.error_message_exist then
989     --
990     -- Catch the Multiple Message List exception which
991     -- indicates API processing has been aborted because
992     -- at least one message exists in the list.
996     -- Reset IN OUT parameters and set OUT parameters
993     --
994     rollback to recancel_header_swi;
995     --
997     --
998     p_return_status := hr_multi_message.get_return_status_disable;
999     hr_utility.set_location(' Leaving:' || l_proc, 30);
1000   when others then
1001     --
1002     -- When Multiple Message Detection is enabled catch
1003     -- any Application specific or other unexpected
1004     -- exceptions.  Adding appropriate details to the
1005     -- Multiple Message List.  Otherwise re-raise the
1006     -- error.
1007     --
1008     rollback to recancel_header_swi;
1009     if hr_multi_message.unexpected_error_add(l_proc) then
1010        hr_utility.set_location(' Leaving:' || l_proc,40);
1011        raise;
1012     end if;
1013     --
1014     -- Reset IN OUT and set OUT parameters
1015     p_return_status := hr_multi_message.get_return_status_disable;
1016     hr_utility.set_location(' Leaving:' || l_proc,50);
1017          --
1018 
1019 
1020 end recancel_header;
1021 
1022 
1023 Procedure cancel_and_recreate
1024   (
1025    p_finance_header_id     in   number
1026   ,p_recreation_header_id  out  nocopy number
1027   ,p_cancel_header_id      out  nocopy number
1028   ,p_date_raised           in   date
1029   ,p_validate              in   number    default hr_api.g_false_num
1030   ,p_commit                in   number    default hr_api.g_false_num
1031   ,p_return_status  out nocopy VARCHAR2
1032   ) is
1033 
1034     l_validate                      boolean;
1035     l_commit                        boolean;
1036   l_proc    varchar2(72) := g_package ||'cancel_and_recreate';
1037 Begin
1038   hr_utility.set_location(' Entering:' || l_proc,10);
1039    --
1040   -- Issue a savepoint
1041   --
1042   savepoint cancel_and_recreate_header_swi;
1043   --
1044   -- Initialise Multiple Message Detection
1045   --
1046   hr_multi_message.enable_message_list;
1047   --
1048   -- Remember IN OUT parameter IN values
1049   --
1050   --
1051   -- Convert constant values to their corresponding boolean value
1052   --
1053   l_validate :=
1054     hr_api.constant_to_boolean
1055       (p_constant_value => p_validate);
1056 
1057     l_commit :=
1058     hr_api.constant_to_boolean
1059       (p_constant_value => p_commit);
1060 
1061    ota_tfh_api_business_rules.cancel_and_recreate
1062   (
1063    p_finance_header_id     => p_finance_header_id
1064   ,p_recreation_header_id  => p_recreation_header_id
1065   ,p_cancel_header_id      => p_cancel_header_id
1066   ,p_date_raised           => p_date_raised
1067   ,p_validate              => l_validate
1068   ,p_commit                => l_commit
1069   );
1070 
1071  p_return_status := hr_multi_message.get_return_status_disable;
1072   hr_utility.set_location(' Leaving:' || l_proc,20);
1073 exception
1074   when hr_multi_message.error_message_exist then
1075     --
1076     -- Catch the Multiple Message List exception which
1077     -- indicates API processing has been aborted because
1078     -- at least one message exists in the list.
1079     --
1080     rollback to cancel_and_recreate_header_swi;
1081     --
1082     -- Reset IN OUT parameters and set OUT parameters
1083     --
1084     p_return_status := hr_multi_message.get_return_status_disable;
1085     hr_utility.set_location(' Leaving:' || l_proc, 30);
1086   when others then
1087     --
1088     -- When Multiple Message Detection is enabled catch
1089     -- any Application specific or other unexpected
1090     -- exceptions.  Adding appropriate details to the
1091     -- Multiple Message List.  Otherwise re-raise the
1092     -- error.
1093     --
1094     rollback to cancel_and_recreate_header_swi;
1095     if hr_multi_message.unexpected_error_add(l_proc) then
1096        hr_utility.set_location(' Leaving:' || l_proc,40);
1097        raise;
1098     end if;
1099 
1100     --
1101     p_return_status := hr_multi_message.get_return_status_disable;
1102     hr_utility.set_location(' Leaving:' || l_proc,50);
1103 
1104 end cancel_and_recreate;
1105 
1106 end ota_finance_header_swi;