351:
352: CURSOR event_csr is
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:
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
376: BEGIN
377: -- Get event details
378: OPEN event_csr;
379: FETCH event_csr INTO
380: l_price_basis, l_standard_price, l_currency_code;
381: CLOSE event_csr;
382:
383: -- Price Basis = 'Student' ?
384: IF (l_price_basis = 'S') AND (l_standard_price <> 0) then
380: l_price_basis, l_standard_price, l_currency_code;
381: CLOSE event_csr;
382:
383: -- Price Basis = 'Student' ?
384: IF (l_price_basis = 'S') AND (l_standard_price <> 0) then
385:
386: OPEN internal_bookings_csr;
387: FETCH internal_bookings_csr INTO l_total_int_students;
388: CLOSE internal_bookings_csr;
387: FETCH internal_bookings_csr INTO l_total_int_students;
388: CLOSE internal_bookings_csr;
389:
390: -- Calculate internal revenue
391: l_internal_revenue := l_total_int_students * l_standard_price;
392:
393: -- Convert to currency of business group
394: l_internal_revenue := hri_bpl_currency.convert_currency_amount(
395: p_from_currency => l_currency_code
485:
486: CURSOR event_csr is
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:
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:
516:
517: -- Get event details
518: OPEN event_csr;
519: FETCH event_csr INTO
520: l_price_basis, l_stANDard_price, l_currency_code;
521: CLOSE event_csr;
522:
523: -- Price Basis = 'Student' ?
524: IF (l_price_basis = 'S') AND (l_standard_price <> 0) THEN
520: l_price_basis, l_stANDard_price, l_currency_code;
521: CLOSE event_csr;
522:
523: -- Price Basis = 'Student' ?
524: IF (l_price_basis = 'S') AND (l_standard_price <> 0) THEN
525:
526: OPEN internal_bookings_csr;
527: FETCH internal_bookings_csr INTO l_total_int_students;
528: CLOSE internal_bookings_csr;
527: FETCH internal_bookings_csr INTO l_total_int_students;
528: CLOSE internal_bookings_csr;
529:
530: -- Calculate internal revenue
531: l_internal_revenue := l_total_int_students * l_stANDard_price;
532:
533: -- Convert to currency of business group
534: l_internal_revenue := hri_bpl_currency.convert_currency_amount(
535: p_from_currency => l_currency_code
632:
633: CURSOR event_csr is
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:
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:
663:
664: -- Get event details
665: OPEN event_csr;
666: FETCH event_csr INTO
667: l_price_basis, l_standard_price, l_currency_code;
668: CLOSE event_csr;
669:
670: -- Price Basis = 'Student' ?
671: IF (l_price_basis = 'S') AND (l_standard_price <> 0) THEN
667: l_price_basis, l_standard_price, l_currency_code;
668: CLOSE event_csr;
669:
670: -- Price Basis = 'Student' ?
671: IF (l_price_basis = 'S') AND (l_standard_price <> 0) THEN
672:
673: OPEN internal_bookings_csr;
674: FETCH internal_bookings_csr INTO l_total_int_students;
675: CLOSE internal_bookings_csr;
674: FETCH internal_bookings_csr INTO l_total_int_students;
675: CLOSE internal_bookings_csr;
676:
677: -- Calculate internal revenue
678: l_internal_revenue := l_total_int_students * l_stANDard_price;
679:
680: -- Convert to currency of business group
681: l_internal_revenue := hri_bpl_currency.convert_currency_amount(
682: p_FROM_currency => l_currency_code