DBA Data[Home] [Help]

PACKAGE BODY: APPS.OTA_TDB_API_INS2

Source


1 Package Body ota_tdb_api_ins2 as
2 /* $Header: ottdb02t.pkb 120.22.12010000.2 2009/08/12 14:15:14 smahanka ship $ */
3 --
4 -- Package Variables
5 --
6 g_package  varchar2(33) := 'ota_tdb_api_ins2.';
7 --
8 -- ----------------------------------------------------------------------------
9 -- |-------------------------< Check New Status  >----------------------------|
10 -- ----------------------------------------------------------------------------
11 --
12 -- PRIVATE
13 -- Description: Check the delegate booking Status when Inserting.
14 --
15 --
16 procedure Check_New_Status(p_event_id in number
17  			  ,p_booking_status_type_id in number
18 			  ,p_event_status in varchar2
19 			  ,p_maximum_attendees in number
20 			  ,p_number_of_places in number) is
21   --
22   l_booking_status varchar2(30) := ota_tdb_bus.booking_status_type(
23 					p_booking_status_type_id);
24   --
25   l_proc 	varchar2(72) := g_package||'check_new_status';
26   --
27 begin
28   --
29   --
30   hr_utility.set_location('Entering:'|| l_proc, 5);
31   --
32   -- Check for exceeding max attendees.
33   --
34 
35     if p_maximum_attendees is not null then
36     --
37       if (ota_evt_bus2.get_vacancies(p_event_id) < p_number_of_places) and
38           l_booking_status in ('P','A','E') then
39       --
40        fnd_message.set_name('OTA','OTA_13558_TDB_PLACES_INC');
41        fnd_message.raise_error;
42       --
43       end if;
44     --
45     end if;
46 
47   --
48   -- Check new status for Full Events.
49   --
50 
51   if p_event_status = 'F' and l_booking_status in ('P','A','E','C') then
52   --
53     fnd_message.set_name('OTA','OTA_13518_TDB_NEW_STATUS_P');
54     fnd_message.raise_error;
55   --
56   end if;
57 
58   --
59   -- Check new status for Planned Events.
60   --
61 
62   if p_event_status = 'P' and l_booking_status not in ('W','R') then
63   --
64     fnd_message.set_name('OTA','OTA_13518_TDB_NEW_STATUS_P');
65     fnd_message.raise_error;
66   --
67   end if;
68 
69   --
70   -- Check new status for Cancelled or Closed Events.
71   --
72   if p_event_status in ('A','C') and l_booking_status is not null then
73   --
74     fnd_message.set_name('OTA','OTA_13519_TDB_NEW_STATUS_A');
75     fnd_message.raise_error;
76   --
77   end if;
78 
79   --
80   -- Check new status for Normal Events.
81   --
82   if p_event_status = 'N' and l_booking_status in ('C') then
83   --
84     fnd_message.set_name('OTA','OTA_13520_TDB_NEW_STATUS_N');
85     fnd_message.raise_error;
86   --
87   end if;
88 
89   --
90   hr_utility.set_location('Leaving:'|| l_proc, 10);
91   --
92 end Check_New_Status;
93 --
94 -- ----------------------------------------------------------------------------
95 -- |--------------------------< Create Enrollment >---------------------------|
96 -- ----------------------------------------------------------------------------
97 --
98 -- PUBLIC
99 -- Description: Creates an Enrollment.
100 --
101 --
102 procedure Create_Enrollment
103   (
104   p_booking_id				in out  nocopy number,
105   p_booking_status_type_id		in number,
106   p_delegate_person_id			in number	default null,
107   p_contact_id				in number,
108   p_business_group_id			in number,
109   p_event_id				in number,
110   p_customer_id				in number	default null,
111   p_authorizer_person_id		in number	default null,
112   p_date_booking_placed			in date,
113   p_corespondent			in varchar2	default null,
114   p_internal_booking_flag		in varchar2,
115   p_number_of_places			in number,
116   p_object_version_number		in out nocopy  number,
117   p_administrator			in number	default null,
118   p_booking_priority			in varchar2	default null,
119   p_comments				in varchar2	default null,
120   p_contact_address_id			in number	default null,
121   p_delegate_contact_phone		in varchar2	default null,
122   p_delegate_contact_fax		in varchar2	default null,
123   p_third_party_customer_id		in number	default null,
124   p_third_party_contact_id		in number	default null,
125   p_third_party_address_id		in number	default null,
126   p_third_party_contact_phone		in varchar2	default null,
127   p_third_party_contact_fax		in varchar2	default null,
128   p_date_status_changed			in date		default null,
129   p_failure_reason			in varchar2	default null,
130   p_attendance_result			in varchar2	default null,
131   p_language_id				in number	default null,
132   p_source_of_booking			in varchar2	default null,
133   p_special_booking_instructions	in varchar2	default null,
134   p_successful_attendance_flag		in varchar2	default null,
135   p_tdb_information_category		in varchar2	default null,
136   p_tdb_information1			in varchar2	default null,
137   p_tdb_information2			in varchar2	default null,
138   p_tdb_information3			in varchar2	default null,
139   p_tdb_information4			in varchar2	default null,
140   p_tdb_information5			in varchar2	default null,
141   p_tdb_information6			in varchar2	default null,
142   p_tdb_information7			in varchar2	default null,
143   p_tdb_information8			in varchar2	default null,
144   p_tdb_information9			in varchar2	default null,
145   p_tdb_information10			in varchar2	default null,
146   p_tdb_information11			in varchar2	default null,
147   p_tdb_information12			in varchar2	default null,
148   p_tdb_information13			in varchar2	default null,
149   p_tdb_information14			in varchar2	default null,
150   p_tdb_information15			in varchar2	default null,
151   p_tdb_information16			in varchar2	default null,
152   p_tdb_information17			in varchar2	default null,
153   p_tdb_information18			in varchar2	default null,
154   p_tdb_information19			in varchar2	default null,
155   p_tdb_information20			in varchar2	default null,
156   p_create_finance_line			in varchar2	default null,
157   p_finance_header_id			in number	default null,
158   p_currency_code			in varchar2	default null,
159   p_standard_amount			in number	default null,
160   p_unitary_amount			in number	default null,
161   p_money_amount			in number	default null,
162   p_booking_deal_id			in number	default null,
163   p_booking_deal_type			in varchar2	default null,
164   p_finance_line_id			in out nocopy number,
165   p_enrollment_type			in varchar2,
166   p_validate				in boolean	default false,
167   p_organization_id              	in number	default null,
168   p_sponsor_person_id            	in number	default null,
169   p_sponsor_assignment_id        	in number	default null,
170   p_person_address_id            	in number	default null,
171   p_delegate_assignment_id       	in number	default null,
172   p_delegate_contact_id          	in number	default null,
173   p_delegate_contact_email       	in varchar2	default null,
174   p_third_party_email            	in varchar2	default null,
175   p_person_address_type          	in varchar2	default null,
176   p_line_id					in number       default null,
177   p_org_id					in number       default null,
178   p_daemon_flag				in varchar2     default null,
179   p_daemon_type 				in varchar2     default null,
180   p_old_event_id                    in number       default null,
181   p_quote_line_id                   in number       default null,
182   p_interface_source                in varchar2     default null,
183   p_total_training_time             in varchar2 default null,
184   p_content_player_status           in varchar2 default null,
185   p_score		                  in number   default null,
186   p_completed_content			in number   default null,
187   p_total_content	                  in number   default null,
188   p_booking_justification_id                in number default null,
189   p_override_prerequisites                in varchar2 default 'N',
190 p_book_from in varchar2,
191 p_override_learner_access in varchar2 ,
192 p_is_history_flag in varchar2 default 'N',
193 p_is_mandatory_enrollment             in varchar2 default 'N')
194   is
195 
196   l_proc 	varchar2(72) := g_package||'create_enrollment';
197 
198 /*
199   l_object_version_number number;
200   l_booking_id number;
201   l_dummy number;
202   l_event_status 		varchar2(30);
203   l_maximum_attendees 		number;
204   l_maximum_internal_attendees 	number;
205   l_evt_object_version_number 	number;
206   l_event_rec			ota_evt_shd.g_rec_type;
207   l_event_exists		boolean;
208   l_effective_date	date;
209 
210   l_lp_enrollment_ids varchar2(4000);
211   l_cert_prd_enrollment_ids varchar2(4000);
212   l_item_key     wf_items.item_key%type;
213 
214   l_type ota_booking_status_types.type%type;
215 
216 
217   --
218   l_proc 	varchar2(72) := g_package||'create_enrollment';
219 
220   l_add_struct_d hr_dflex_utility.l_ignore_dfcode_varray :=
221                                hr_dflex_utility.l_ignore_dfcode_varray();
222   l_ignore_dff_validation varchar2(1);
223   v_forum_id        number;
224   v_business_group_id   number;
225 
226 Cursor chk_for_comp_upd
227   is
228   select ocu.online_flag , off.Learning_object_id from ota_category_usages ocu,
229     ota_offerings off , ota_events oev
230     where ocu.category_usage_id = off.delivery_mode_id
231     and off.offering_id = oev.parent_offering_id
232     and oev.event_id = p_event_id;
233 
234 Cursor csr_forums_for_class
235   is
236   Select fr.forum_id, fr.business_group_id from
237   ota_forums_b fr,
238   ota_frm_obj_inclusions foi
239   where fr.forum_id = foi.forum_id
240   and foi.object_type = 'E'
241   and foi.object_id = p_event_id
242   and fr.auto_notification_flag = 'Y';
243   l_comp_upd varchar2(1000) :='MoveToHistoryImage';
244   l_on_flag varchar2(100);
245   l_LO_id ota_offerings.Learning_object_id%type;
246 
247   l_incoming_status_type varchar2(30);
248 
249 */
250   --
251   begin
252   --
253   hr_utility.set_location('Entering:'|| l_proc, 5);
254 
255   ota_delegate_booking_api.create_delegate_booking(
256          p_effective_date                     =>      trunc(sysdate)                ,
257          p_booking_id                         =>      p_booking_id                  ,
258          p_booking_status_type_id             =>      p_booking_status_type_id      ,
259          p_delegate_person_id                 =>      p_delegate_person_id          ,
260          p_contact_id                         =>      p_contact_id                  ,
261          p_business_group_id                  =>      p_business_group_id           ,
262          p_event_id                           =>      p_event_id                    ,
263          p_customer_id                        =>      p_customer_id                 ,
264          p_authorizer_person_id               =>      p_authorizer_person_id        ,
265          p_date_booking_placed                =>      p_date_booking_placed         ,
266          p_corespondent                       =>      p_corespondent                ,
267          p_internal_booking_flag              =>      p_internal_booking_flag       ,
268          p_number_of_places                   =>      p_number_of_places            ,
269          p_object_version_number              =>      p_object_version_number       ,
270          p_administrator                      =>      p_administrator               ,
271          p_booking_priority                   =>      p_booking_priority            ,
272          p_comments                           =>      p_comments                    ,
273          p_contact_address_id                 =>      p_contact_address_id          ,
274          p_delegate_contact_phone             =>      p_delegate_contact_phone      ,
275          p_delegate_contact_fax               =>      p_delegate_contact_fax        ,
276          p_third_party_customer_id            =>      p_third_party_customer_id     ,
277          p_third_party_contact_id             =>      p_third_party_contact_id      ,
278          p_third_party_address_id             =>      p_third_party_address_id      ,
279          p_third_party_contact_phone          =>      p_third_party_contact_phone   ,
280          p_third_party_contact_fax            =>      p_third_party_contact_fax     ,
281          p_date_status_changed                =>      p_date_status_changed         ,
282          p_failure_reason                     =>      p_failure_reason              ,
283          p_attendance_result                  =>      p_attendance_result           ,
284          p_language_id                        =>      p_language_id                 ,
285          p_source_of_booking                  =>      p_source_of_booking           ,
286          p_special_booking_instructions       =>      p_special_booking_instructions,
287          p_successful_attendance_flag         =>      p_successful_attendance_flag  ,
288          p_tdb_information_category           =>      p_tdb_information_category    ,
289          p_tdb_information1                   =>      p_tdb_information1            ,
290          p_tdb_information2                   =>      p_tdb_information2            ,
291          p_tdb_information3                   =>      p_tdb_information3            ,
292          p_tdb_information4                   =>      p_tdb_information4            ,
293          p_tdb_information5                   =>      p_tdb_information5            ,
294          p_tdb_information6                   =>      p_tdb_information6            ,
295          p_tdb_information7                   =>      p_tdb_information7            ,
296          p_tdb_information8                   =>      p_tdb_information8            ,
297          p_tdb_information9                   =>      p_tdb_information9            ,
298          p_tdb_information10                  =>      p_tdb_information10           ,
299          p_tdb_information11                  =>      p_tdb_information11           ,
300          p_tdb_information12                  =>      p_tdb_information12           ,
301          p_tdb_information13                  =>      p_tdb_information13           ,
302          p_tdb_information14                  =>      p_tdb_information14           ,
303          p_tdb_information15                  =>      p_tdb_information15           ,
304          p_tdb_information16                  =>      p_tdb_information16           ,
305          p_tdb_information17                  =>      p_tdb_information17           ,
306          p_tdb_information18                  =>      p_tdb_information18           ,
307          p_tdb_information19                  =>      p_tdb_information19           ,
308          p_tdb_information20                  =>      p_tdb_information20           ,
309          p_create_finance_line                =>      p_create_finance_line         ,
310          p_finance_header_id                  =>      p_finance_header_id           ,
311          p_currency_code                      =>      p_currency_code               ,
312          p_standard_amount                    =>      p_standard_amount             ,
313          p_unitary_amount                     =>      p_unitary_amount              ,
314          p_money_amount                       =>      p_money_amount                ,
315          p_booking_deal_id                    =>      p_booking_deal_id             ,
316          p_booking_deal_type                  =>      p_booking_deal_type           ,
317          p_finance_line_id                    =>      p_finance_line_id             ,
318          p_enrollment_type                    =>      p_enrollment_type             ,
319          p_validate                           =>      p_validate                    ,
320          p_organization_id                    =>      p_organization_id             ,
321          p_sponsor_person_id                  =>      p_sponsor_person_id           ,
322          p_sponsor_assignment_id              =>      p_sponsor_assignment_id       ,
323          p_person_address_id                  =>      p_person_address_id           ,
324          p_delegate_assignment_id             =>      p_delegate_assignment_id      ,
325          p_delegate_contact_id                =>      p_delegate_contact_id         ,
326          p_delegate_contact_email             =>      p_delegate_contact_email      ,
327          p_third_party_email                  =>      p_third_party_email           ,
328          p_person_address_type                =>      p_person_address_type         ,
329          p_line_id                            =>      p_line_id                     ,
330          p_org_id                             =>      p_org_id                      ,
331          p_daemon_flag                        =>      p_daemon_flag                 ,
332          p_daemon_type                        =>      p_daemon_type                 ,
333          p_old_event_id                       =>      p_old_event_id                ,
334          p_quote_line_id                      =>      p_quote_line_id               ,
335          p_interface_source                   =>      p_interface_source            ,
336          p_total_training_time                =>      p_total_training_time         ,
337          p_content_player_status              =>      p_content_player_status       ,
338          p_score                              =>      p_score                       ,
339          p_completed_content                  =>      p_completed_content           ,
340          p_total_content                      =>      p_total_content               ,
341          p_booking_justification_id           =>      p_booking_justification_id    ,
342          p_is_history_flag	 	      =>      p_is_history_flag	     ,
343          p_override_prerequisites 	      =>      p_override_prerequisites      ,
344          p_override_learner_access	      =>      p_override_learner_access     ,
345          p_book_from 		              =>      p_book_from ,
346          p_is_mandatory_enrollment        =>      p_is_mandatory_enrollment
347    );
348 
349    hr_utility.set_location('Leaving:'||l_proc, 10);
350 
351 /*
352   --
353   -- Issue a savepoint if operating in validation only mode.
354   --
355   if p_validate then
356   --
357     savepoint create_enrollment;
358   --
359   end if;
360    --
361   -- Truncate the time portion from all IN date parameters
362   --
363  -- l_effective_date := trunc(p_effective_date);
364   --
365   hr_utility.set_location(l_proc, 6);
366 
367   --
368   -- Validation in addition to Table Handlers
369   --
370  -- Prerequisite Validation Code
371   -- Can be overridden if p_override_prerequisites parameter is 'Y'
372   -- get booking status type
373 
374    ota_utility.get_booking_status_type(p_status_type_id=>p_booking_status_type_id,
375                                                                 p_type => l_incoming_status_type);
376 
377      If ( p_override_prerequisites = 'N' and nvl(l_incoming_status_type,'-1')<>'C'
378           and (p_delegate_person_id is not null or p_delegate_contact_id is not null) ) Then --Bug 4686100
379 	     --Call local method
380 	      ota_cpr_utility.chk_mandatory_prereqs(p_delegate_person_id, p_delegate_contact_id, p_event_id);
381      End If;
382 
383   IF p_override_learner_access <> 'Y' THEN
384   --
385   -- check that the delegate is eligible to be booked on to the event
386   --
387   ota_tdb_bus.check_delegate_eligible (p_event_id,
388                            p_customer_id,
389                            p_delegate_contact_id,
390                            p_organization_id,
391                            p_delegate_person_id,
392                            p_delegate_assignment_id);
393   -- Added for bug#4606760
394   ELSIF p_delegate_person_id IS NOT NULL THEN
395     ota_tdb_bus.check_secure_event(p_event_id, p_delegate_person_id);
396 
397   END IF;
398 
399   --
400   -- Lock Event
401   --
402   ota_evt_bus2.lock_event(p_event_id);
403 
404   --
405   -- Get Event record
406   --
407   ota_evt_shd.get_event_details (p_event_id,
408                                  l_event_rec,
409                                  l_event_exists);
410 
411   -- Ignore Enrollment Dff Validation for some cases
412   if ( (l_event_rec.price_basis = 'C' and p_contact_id is not null) or (l_event_rec.line_id is not null) or (p_line_id is not null) ) then
413 	  l_add_struct_d.extend(1);
414 	  l_add_struct_d(l_add_struct_d.count) := 'OTA_DELEGATE_BOOKINGS';
415 	  hr_dflex_utility.create_ignore_df_validation(p_rec => l_add_struct_d);
416           l_ignore_dff_validation := 'Y';
417   else
418           l_ignore_dff_validation := 'N';
419   end if;
420 
421   --
422   --  Validation Check on event / booking statuses
423   --
424 
425   Check_New_Status(p_event_id
426                   ,p_booking_Status_type_id
427                   ,l_event_rec.event_status
428                   ,l_event_rec.maximum_attendees
429                   ,p_number_of_places);
430 --
431   ota_tdb_ins.ins(
432     p_booking_id
433   , p_booking_status_type_id
434   , p_delegate_person_id
435   , p_contact_id
436   , p_business_group_id
437   , p_event_id
438   , p_customer_id
439   , p_authorizer_person_id
440   , p_date_booking_placed
441   , p_corespondent
442   , p_internal_booking_flag
443   , p_number_of_places
444   , p_object_version_number
445   , p_administrator
446   , p_booking_priority
447   , p_comments
448   , p_contact_address_id
449   , p_delegate_contact_phone
450   , p_delegate_contact_fax
451   , p_third_party_customer_id
452   , p_third_party_contact_id
453   , p_third_party_address_id
454   , p_third_party_contact_phone
455   , p_third_party_contact_fax
456   , p_date_status_changed
457   , p_failure_reason
458   , p_attendance_result
459   , p_language_id
460   , p_source_of_booking
461   , p_special_booking_instructions
462   , p_successful_attendance_flag
463   , p_tdb_information_category
464   , p_tdb_information1
465   , p_tdb_information2
466   , p_tdb_information3
467   , p_tdb_information4
468   , p_tdb_information5
469   , p_tdb_information6
470   , p_tdb_information7
471   , p_tdb_information8
472   , p_tdb_information9
473   , p_tdb_information10
474   , p_tdb_information11
475   , p_tdb_information12
476   , p_tdb_information13
477   , p_tdb_information14
478   , p_tdb_information15
479   , p_tdb_information16
480   , p_tdb_information17
481   , p_tdb_information18
482   , p_tdb_information19
483   , p_tdb_information20
484   , p_create_finance_line
485   , p_finance_header_id
486   , p_currency_code
487   , p_standard_amount
488   , p_unitary_amount
489   , p_money_amount
490   , p_booking_deal_id
491   , p_booking_deal_type
492   , p_finance_line_id
493   , p_enrollment_type
494   , p_validate
495   , p_organization_id
496   , p_sponsor_person_id
497   , p_sponsor_assignment_id
498   , p_person_address_id
499   , p_delegate_assignment_id
500   , p_delegate_contact_id
501   , p_delegate_contact_email
502   , p_third_party_email
503   , p_person_address_type
504   , p_line_id
505   , p_org_id
506   , p_daemon_flag
507   , p_daemon_type
508   , p_old_event_id
509   , p_quote_line_id
510   , p_interface_source
511   , p_total_training_time
512   , p_content_player_status
513   , p_score
514   , p_completed_content
515   , p_total_content
516   ,p_booking_justification_id
517   ,p_is_history_flag);
518   --
519 
520   ota_tdb_bus.ota_letter_lines
521                  (p_booking_id             => p_booking_id,
522                   p_booking_status_type_id => p_booking_status_type_id,
523                   p_event_id               => p_event_id,
524                   p_delegate_person_id     => p_delegate_person_id);
525 /* bug 3795299. changed call to ota_lrng_path_member_util
526          ---***added p_delegate_person_id also.Bug 2791524
527          ota_trng_plan_comp_ss.update_tpc_enroll_status_chg(p_event_id  => p_event_id,
528                                                      p_person_id => p_delegate_person_id,
529 						    -- Added for Bug#3479186
530 						     p_contact_id => p_delegate_contact_id,
531                                                      p_learning_path_ids => l_learning_path_ids);
532 */
533 /*
534   ota_lrng_path_member_util.update_lme_enroll_status_chg(p_event_id          => p_event_id,
535                                                          p_person_id         => p_delegate_person_id,
536                                                          p_contact_id        => p_delegate_contact_id,
537                                                          p_lp_enrollment_ids => l_lp_enrollment_ids);
538 
539   -- update any associated cert member enrollment statuses
540   ota_cme_util.update_cme_status(p_event_id          => p_event_id,
541                                  p_person_id         => p_delegate_person_id,
542                                  p_contact_id        => p_delegate_contact_id,
543                                  p_cert_prd_enrollment_ids => l_cert_prd_enrollment_ids);
544 
545          select Type into l_type from ota_booking_status_types where booking_status_type_id=p_booking_status_type_id;
546 
547        if l_type='A' and p_delegate_contact_id is null and p_contact_id is null then
548 
549 */		-- check whether class is online or not
550       /*  OPEN chk_for_comp_upd;
551         FETCH chk_for_comp_upd INTO l_on_flag,l_LO_id;
552         CLOSE chk_for_comp_upd;
553 
554        if l_on_flag='Y' then
555        -- check whether online class is succesfully completed or not
556        l_comp_upd := ota_lo_utility.get_history_button(p_user_id  => p_delegate_person_id,
557                             p_lo_id => l_LO_id  ,
558                             p_event_id => p_event_id,
559                             p_booking_id => p_booking_id);
560 	elsif p_successful_attendance_flag <>'Y' then
561             l_comp_upd := null;
562         end if; -- flag */
563 /*
564         if p_successful_attendance_flag = 'Y' then
565         ota_competence_ss.create_wf_process(p_process 	=>'OTA_COMPETENCE_UPDATE_JSP_PRC',
566             p_itemtype 		=>'HRSSA',
567             p_person_id 	=> p_delegate_person_id,
568             p_eventid       =>p_event_id,
569             p_learningpath_ids => null,
570             p_itemkey    =>l_item_key);
571 
572         end if;
573 */
574 
575        /* ota_competence_ss.create_wf_process(p_process 	=>'OTA_COMPETENCE_UPDATE_JSP_PRC',
576             p_itemtype 		=>'HRSSA',
577             p_person_id 	=> p_delegate_person_id,
578             p_eventid       =>p_event_id,
579             p_learningpath_ids => null,
580             p_itemkey    =>l_item_key);*/
581 /*
582         end if;
583 
584   --
585   -- fire learner enrollment notification
586         if p_contact_id is null and p_delegate_contact_id is null
587         and nvl(p_book_from,'-1') <> 'AME' then
588             -- call learner ntf process
589 
590             OTA_LRNR_ENROLL_UNENROLL_WF.learner_enrollment(p_process => 'OTA_LNR_TRNG_APPROVAL_JSP_PRC',
591                                                         p_itemtype => 'HRSSA',
592                                                         p_person_id => p_delegate_person_id,
593                                                         p_eventid => p_event_id,
594                                                         p_booking_id => p_booking_id);
595 
596 
597 
598             end if;
599 
600   if p_create_finance_line = 'Y' then
601   --
602    ota_finance.maintain_finance_line(p_finance_header_id => p_finance_header_id,
603                                      p_booking_id        => p_booking_id   ,
604                                      p_currency_code     => p_currency_code    ,
605                                      p_standard_amount   => p_standard_amount,
606                                      p_unitary_amount    => p_unitary_amount   ,
607                                      p_money_amount      => p_money_amount     ,
608                                      p_booking_deal_id   => p_booking_deal_id  ,
609                                      p_booking_deal_type => p_booking_deal_type,
610                                      p_object_version_number => l_dummy,
611                                      p_finance_line_id   => p_finance_line_id);
612   --
613   end if;
614   --
615   --
616   hr_utility.set_location(l_proc, 7);
617 
618   --
619   -- Reset Event Status
620   --
621   ota_evt_bus2.reset_event_status(p_event_id
622                                  ,l_event_rec.object_version_number
623                                  ,l_event_rec.event_status
624                                  ,l_event_rec.maximum_attendees);
625   --
626   hr_utility.set_location(l_proc, 8);
627 
628   if ( l_ignore_dff_validation = 'Y' ) then
629 	  hr_dflex_utility.remove_ignore_df_validation;
630   end if;
631 
632 
633 --create frm_notif_subscriber record, only if the enrollment status is 'P' or 'A'
634  if (l_type='A' OR l_type = 'P') then
635   OPEN csr_forums_for_class;
636   FETCH csr_forums_for_class into v_forum_id, v_business_group_id;
637 
638   LOOP
639   Exit When csr_forums_for_class%notfound OR csr_forums_for_class%notfound is null;
640 */
641   /*OTA_FRM_NOTIF_SUBSCRIBER_API.create_frm_notif_subscriber(
642   		p_validate                     => p_validate
643 		    ,p_effective_date               => l_effective_date
644 		    ,p_business_group_id            => v_business_group_id
645 		    ,p_forum_id                     => v_forum_id
646 		    ,p_person_id                    => p_delegate_person_id
647 		    ,p_contact_id                   => p_delegate_contact_id
648     		    ,p_object_version_number        => p_object_version_number
649   		);*/
650 /*
651   ota_fns_ins.ins
652     (  p_effective_date             => l_effective_date
653       ,p_business_group_id          => v_business_group_id
654       ,p_forum_id                   => v_forum_id
655       ,p_person_id                  => p_delegate_person_id
656       ,p_contact_id                 => p_delegate_contact_id
657       ,p_object_version_number      => p_object_version_number
658     );
659 
660 
661   FETCH csr_forums_for_class into v_forum_id, v_business_group_id;
662   End Loop;
663   Close csr_forums_for_class;
664 
665 end if;
666   --
667   -- When in validation only mode raise the Validate_Enabled exception
668   --
669   if p_validate then
670   --
671     raise hr_api.validate_enabled;
672   --
673   end if;
674 
675   --
676   hr_utility.set_location('Leaving:'||l_proc, 10);
677   --
678 exception
679   when hr_api.validate_enabled then
680     --
681     -- As the Validate_Enabled exception has been raised
682     -- we must rollback to the savepoint
683     --
684     ROLLBACK TO create_enrollment;
685     --
686     -- Only set output warning arguments
687     -- (Any key or derived arguments must be set to null
688     -- when validation only mode is being used.)
689     --
690 */
691 end Create_Enrollment;
692 --
693 end ota_tdb_api_ins2;
694 --