213: begin
214:
215: if(p_finance_header_id is null) then
216:
217: l_auto_create_finance := FND_PROFILE.value('OTA_AUTO_CREATE_FINANCE');
218: l_user := FND_PROFILE.value('USER_ID');
219:
220: open bg_to;
221: fetch bg_to into l_business_group_id_to,
214:
215: if(p_finance_header_id is null) then
216:
217: l_auto_create_finance := FND_PROFILE.value('OTA_AUTO_CREATE_FINANCE');
218: l_user := FND_PROFILE.value('USER_ID');
219:
220: open bg_to;
221: fetch bg_to into l_business_group_id_to,
222: l_sponsor_organization_id,
974: p_booking_deal_type => p_booking_deal_type,
975: p_object_version_number => l_dummy,
976: p_finance_line_id => p_finance_line_id);
977:
978: l_automatic_transfer_gl := FND_PROFILE.value('OTA_SSHR_AUTO_GL_TRANSFER');
979: if l_automatic_transfer_gl = 'Y' AND p_finance_line_id IS NOT NULL THEN
980: UPDATE ota_finance_lines SET transfer_status = 'AT'
981: WHERE finance_line_id = p_finance_line_id;
982: end if;
1619: --bug# 5231470 first date format changed from DD-MON-YYYY to DD/MM/YYYY
1620: l_hours_until_class_starts := 24*(to_date(to_char(l_course_start_date, 'DD/MM/YYYY')
1621: ||''||l_course_start_time, 'DD/MM/YYYYHH24:MI') - SYSDATE);
1622:
1623: l_auto_waitlist_days := TO_NUMBER(fnd_profile.value('OTA_AUTO_WAITLIST_DAYS'));
1624: --
1625: OPEN csr_get_waitlist_count(l_event_id);
1626: FETCH csr_get_waitlist_count INTO l_waitlist_count;
1627: IF (csr_get_waitlist_count%FOUND)
2638: --bug 603768 changes starts
2639: --Send ntf to class owner if any enrollment has been cancelled
2640: --or deleted or class changed
2641: l_old_event_id := ota_tdb_shd.g_old_rec.event_id;
2642: l_auto_waitlist := fnd_profile.value('OTA_AUTO_WAITLIST_ACTIVE');
2643: l_waitlist_size := ota_utility.students_on_waitlist(l_old_event_id);
2644:
2645: if (l_auto_waitlist = 'Y' and l_waitlist_size > 0) then
2646:
2653: if ( l_course_start_date is not null ) then
2654: l_hours_until_class_starts := 24*(to_date(to_char(l_course_start_date, 'DD-MM-YYYY')||''||l_course_start_time, 'DD/MM/YYYYHH24:MI') - SYSDATE);
2655: end if;
2656:
2657: l_auto_waitlist_days := TO_NUMBER(fnd_profile.value('OTA_AUTO_WAITLIST_DAYS'));
2658:
2659: if (l_hours_until_class_starts <= nvl(l_auto_waitlist_days,0) )then
2660:
2661: OPEN sys_date_csr;
2662: FETCH sys_date_csr INTO l_sysdate;
2663: CLOSE sys_date_csr;
2664:
2665: if (l_owner_id is null) then
2666: l_owner_id := fnd_profile.value('OTA_DEFAULT_EVENT_OWNER');
2667: end if;
2668:
2669: OPEN fnduser_csr(l_owner_id);
2670: FETCH fnduser_csr INTO l_username;
3225: end;
3226:
3227: -- 6063768 changes starts
3228: --Send ntf to class owner if any enrollment has been deleted
3229: l_auto_waitlist := fnd_profile.value('OTA_AUTO_WAITLIST_ACTIVE');
3230: l_auto_waitlist_days := TO_NUMBER(fnd_profile.value('OTA_AUTO_WAITLIST_DAYS'));
3231:
3232: if (l_auto_waitlist is not null and l_auto_waitlist = 'Y' ) then
3233:
3226:
3227: -- 6063768 changes starts
3228: --Send ntf to class owner if any enrollment has been deleted
3229: l_auto_waitlist := fnd_profile.value('OTA_AUTO_WAITLIST_ACTIVE');
3230: l_auto_waitlist_days := TO_NUMBER(fnd_profile.value('OTA_AUTO_WAITLIST_DAYS'));
3231:
3232: if (l_auto_waitlist is not null and l_auto_waitlist = 'Y' ) then
3233:
3234: OPEN booking_csr (p_booking_id);
3259: FETCH sys_date_csr INTO l_sysdate;
3260: CLOSE sys_date_csr;
3261:
3262: if (l_owner_id is null) then
3263: l_owner_id := fnd_profile.value('OTA_DEFAULT_EVENT_OWNER');
3264: end if;
3265:
3266: OPEN fnduser_csr(l_owner_id);
3267: FETCH fnduser_csr INTO l_username;