17: PROCEDURE set_training_globals(p_event_id IN NUMBER) IS
18:
19: CURSOR bg_csr is
20: SELECT business_group_id
21: FROM ota_events
22: WHERE event_id = p_event_id;
23:
24: CURSOR bg_currency_csr is
25: SELECT bg.currency_code, NVL(c.precision,2)
76: ,evt.title
77: ,tav.version_name
78: FROM
79: ota_activity_versions tav
80: ,ota_events evt
81: ,ota_program_memberships pm
82: WHERE evt.activity_version_id = tav.activity_version_id
83: AND evt.event_id = pm.event_id
84: AND pm.program_event_id = p_program_event_id;
85:
86: program_member_rec program_member_csr%rowtype;
87:
88: l_activity_version_name ota_activity_versions.version_name%type;
89: l_duration ota_events.duration%type := 0;
90: l_event_duration ota_events.duration%type := 0;
91: l_event_name ota_events.title%type;
92: l_pro_rata_amount number := 0;
93: l_pro_rata_total number := 0;
86: program_member_rec program_member_csr%rowtype;
87:
88: l_activity_version_name ota_activity_versions.version_name%type;
89: l_duration ota_events.duration%type := 0;
90: l_event_duration ota_events.duration%type := 0;
91: l_event_name ota_events.title%type;
92: l_pro_rata_amount number := 0;
93: l_pro_rata_total number := 0;
94: l_total_duration number := 0;
87:
88: l_activity_version_name ota_activity_versions.version_name%type;
89: l_duration ota_events.duration%type := 0;
90: l_event_duration ota_events.duration%type := 0;
91: l_event_name ota_events.title%type;
92: l_pro_rata_amount number := 0;
93: l_pro_rata_total number := 0;
94: l_total_duration number := 0;
95:
171: SELECT
172: nvl(budget_cost,0) budget_cost
173: ,budget_currency_code
174: ,business_group_id
175: FROM ota_events
176: WHERE event_id = p_csr_event_id;
177:
178: l_business_group_id ota_events.business_group_id%type;
179:
174: ,business_group_id
175: FROM ota_events
176: WHERE event_id = p_csr_event_id;
177:
178: l_business_group_id ota_events.business_group_id%type;
179:
180: CURSOR program_event_csr is
181: SELECT program_event_id
182: FROM ota_program_memberships
182: FROM ota_program_memberships
183: WHERE event_id = p_event_id;
184:
185: program_event_rec program_event_csr%rowtype;
186: l_budget_cost ota_events.budget_cost%type := 0;
187: l_budget_currency_code ota_events.budget_currency_code%type;
188: l_converted_amount ota_events.budget_cost%type := 0;
189: l_pro_rata_amount NUMBER := 0;
190: l_total_budget_cost NUMBER := 0;
183: WHERE event_id = p_event_id;
184:
185: program_event_rec program_event_csr%rowtype;
186: l_budget_cost ota_events.budget_cost%type := 0;
187: l_budget_currency_code ota_events.budget_currency_code%type;
188: l_converted_amount ota_events.budget_cost%type := 0;
189: l_pro_rata_amount NUMBER := 0;
190: l_total_budget_cost NUMBER := 0;
191: l_pro_rata_total NUMBER := 0;
184:
185: program_event_rec program_event_csr%rowtype;
186: l_budget_cost ota_events.budget_cost%type := 0;
187: l_budget_currency_code ota_events.budget_currency_code%type;
188: l_converted_amount ota_events.budget_cost%type := 0;
189: l_pro_rata_amount NUMBER := 0;
190: l_total_budget_cost NUMBER := 0;
191: l_pro_rata_total NUMBER := 0;
192:
280: SELECT
281: nvl(actual_cost,0)
282: ,budget_currency_code
283: ,business_group_id
284: FROM ota_events
285: WHERE event_id = p_event_id;
286:
287: l_actual_cost NUMBER := 0;
288: l_actual_currency_code ota_events.budget_currency_code%type;
284: FROM ota_events
285: WHERE event_id = p_event_id;
286:
287: l_actual_cost NUMBER := 0;
288: l_actual_currency_code ota_events.budget_currency_code%type;
289: l_business_group_id ota_events.business_group_id%type;
290: l_event_cost NUMBER := 0;
291: l_resource_cost NUMBER := 0;
292:
285: WHERE event_id = p_event_id;
286:
287: l_actual_cost NUMBER := 0;
288: l_actual_currency_code ota_events.budget_currency_code%type;
289: l_business_group_id ota_events.business_group_id%type;
290: l_event_cost NUMBER := 0;
291: l_resource_cost NUMBER := 0;
292:
293: BEGIN
353: SELECT
354: price_basis
355: ,nvl(stANDard_price,0)
356: ,currency_code
357: FROM ota_events
358: WHERE event_id = p_event_id;
359:
360: CURSOR internal_bookings_csr is
361: SELECT NVL(SUM(NVL(tdb.number_of_places,1)),0)
366: AND bst.type = 'A' -- Attended
367: AND tdb.organization_id IS NOT NULL
368: AND tdb.event_id = p_event_id;
369:
370: l_currency_code ota_events.currency_code%type;
371: l_internal_revenue NUMBER := 0;
372: l_price_basis ota_events.price_basis%type;
373: l_standard_price ota_events.standard_price%type;
374: l_total_int_students NUMBER := 0;
368: AND tdb.event_id = p_event_id;
369:
370: l_currency_code ota_events.currency_code%type;
371: l_internal_revenue NUMBER := 0;
372: l_price_basis ota_events.price_basis%type;
373: l_standard_price ota_events.standard_price%type;
374: l_total_int_students NUMBER := 0;
375:
376: BEGIN
369:
370: l_currency_code ota_events.currency_code%type;
371: l_internal_revenue NUMBER := 0;
372: l_price_basis ota_events.price_basis%type;
373: l_standard_price ota_events.standard_price%type;
374: l_total_int_students NUMBER := 0;
375:
376: BEGIN
377: -- Get event details
487: SELECT
488: price_basis
489: ,nvl(stANDard_price,0)
490: ,currency_code
491: FROM ota_events
492: WHERE event_id = p_event_id;
493:
494: CURSOR internal_bookings_csr is
495: SELECT NVL(SUM(NVL(tdb.number_of_places,1)),0)
500: AND tdb.organization_id IS NOT NULL
501: AND tdb.booking_id = p_booking_id
502: AND tdb.event_id = p_event_id;
503:
504: l_currency_code ota_events.currency_code%type;
505: l_internal_revenue NUMBER := 0;
506: l_price_basis ota_events.price_basis%type;
507: l_standard_price ota_events.standard_price%type;
508: l_total_int_students NUMBER := 0;
502: AND tdb.event_id = p_event_id;
503:
504: l_currency_code ota_events.currency_code%type;
505: l_internal_revenue NUMBER := 0;
506: l_price_basis ota_events.price_basis%type;
507: l_standard_price ota_events.standard_price%type;
508: l_total_int_students NUMBER := 0;
509:
510: BEGIN
503:
504: l_currency_code ota_events.currency_code%type;
505: l_internal_revenue NUMBER := 0;
506: l_price_basis ota_events.price_basis%type;
507: l_standard_price ota_events.standard_price%type;
508: l_total_int_students NUMBER := 0;
509:
510: BEGIN
511:
634: SELECT
635: price_basis
636: ,nvl(stANDard_price,0)
637: ,currency_code
638: FROM ota_events
639: WHERE event_id = p_event_id;
640:
641: CURSOR internal_bookings_csr is
642: SELECT NVL(SUM(NVL(tdb.number_of_places,1)),0)
647: AND tdb.organization_id IS NOT NULL
648: AND tdb.booking_id = p_booking_id
649: AND tdb.event_id = p_event_id;
650:
651: l_currency_code ota_events.currency_code%type;
652: l_internal_revenue NUMBER := 0;
653: l_price_basis ota_events.price_basis%type;
654: l_standard_price ota_events.standard_price%type;
655: l_total_int_students NUMBER := 0;
649: AND tdb.event_id = p_event_id;
650:
651: l_currency_code ota_events.currency_code%type;
652: l_internal_revenue NUMBER := 0;
653: l_price_basis ota_events.price_basis%type;
654: l_standard_price ota_events.standard_price%type;
655: l_total_int_students NUMBER := 0;
656:
657: BEGIN
650:
651: l_currency_code ota_events.currency_code%type;
652: l_internal_revenue NUMBER := 0;
653: l_price_basis ota_events.price_basis%type;
654: l_standard_price ota_events.standard_price%type;
655: l_total_int_students NUMBER := 0;
656:
657: BEGIN
658: