243: l_week_num number;
244: l_p445_num number;
245: l_year_num number;
246: l_day_row number;
247: l_period_year gl_periods.period_year%TYPE;
248: l_quarter_num gl_periods.quarter_num%TYPE;
249: l_period_num gl_periods.period_num%TYPE;
250: l_start_date gl_periods.start_date%TYPE;
251: l_quarter_start_date gl_periods.quarter_start_date%TYPE;
244: l_p445_num number;
245: l_year_num number;
246: l_day_row number;
247: l_period_year gl_periods.period_year%TYPE;
248: l_quarter_num gl_periods.quarter_num%TYPE;
249: l_period_num gl_periods.period_num%TYPE;
250: l_start_date gl_periods.start_date%TYPE;
251: l_quarter_start_date gl_periods.quarter_start_date%TYPE;
252: l_year_start_date gl_periods.year_start_date%TYPE;
245: l_year_num number;
246: l_day_row number;
247: l_period_year gl_periods.period_year%TYPE;
248: l_quarter_num gl_periods.quarter_num%TYPE;
249: l_period_num gl_periods.period_num%TYPE;
250: l_start_date gl_periods.start_date%TYPE;
251: l_quarter_start_date gl_periods.quarter_start_date%TYPE;
252: l_year_start_date gl_periods.year_start_date%TYPE;
253: l_count number;
246: l_day_row number;
247: l_period_year gl_periods.period_year%TYPE;
248: l_quarter_num gl_periods.quarter_num%TYPE;
249: l_period_num gl_periods.period_num%TYPE;
250: l_start_date gl_periods.start_date%TYPE;
251: l_quarter_start_date gl_periods.quarter_start_date%TYPE;
252: l_year_start_date gl_periods.year_start_date%TYPE;
253: l_count number;
254:
247: l_period_year gl_periods.period_year%TYPE;
248: l_quarter_num gl_periods.quarter_num%TYPE;
249: l_period_num gl_periods.period_num%TYPE;
250: l_start_date gl_periods.start_date%TYPE;
251: l_quarter_start_date gl_periods.quarter_start_date%TYPE;
252: l_year_start_date gl_periods.year_start_date%TYPE;
253: l_count number;
254:
255: cursor ent_period_cur (day date) is
248: l_quarter_num gl_periods.quarter_num%TYPE;
249: l_period_num gl_periods.period_num%TYPE;
250: l_start_date gl_periods.start_date%TYPE;
251: l_quarter_start_date gl_periods.quarter_start_date%TYPE;
252: l_year_start_date gl_periods.year_start_date%TYPE;
253: l_count number;
254:
255: cursor ent_period_cur (day date) is
256: select period_year, quarter_num, period_num, start_date, quarter_start_date, year_start_date
253: l_count number;
254:
255: cursor ent_period_cur (day date) is
256: select period_year, quarter_num, period_num, start_date, quarter_start_date, year_start_date
257: from gl_periods
258: where adjustment_period_flag='N'
259: and period_set_name=g_period_set_name
260: and period_type=g_period_type
261: and day between start_date and end_date;
415: l_week_num number;
416: l_p445_num number;
417: l_year_num number;
418: l_day_row number;
419: l_period_year gl_periods.period_year%TYPE;
420: l_quarter_num gl_periods.quarter_num%TYPE;
421: l_period_num gl_periods.period_num%TYPE;
422: l_start_date gl_periods.start_date%TYPE;
423: l_quarter_start_date gl_periods.quarter_start_date%TYPE;
416: l_p445_num number;
417: l_year_num number;
418: l_day_row number;
419: l_period_year gl_periods.period_year%TYPE;
420: l_quarter_num gl_periods.quarter_num%TYPE;
421: l_period_num gl_periods.period_num%TYPE;
422: l_start_date gl_periods.start_date%TYPE;
423: l_quarter_start_date gl_periods.quarter_start_date%TYPE;
424: l_year_start_date gl_periods.year_start_date%TYPE;
417: l_year_num number;
418: l_day_row number;
419: l_period_year gl_periods.period_year%TYPE;
420: l_quarter_num gl_periods.quarter_num%TYPE;
421: l_period_num gl_periods.period_num%TYPE;
422: l_start_date gl_periods.start_date%TYPE;
423: l_quarter_start_date gl_periods.quarter_start_date%TYPE;
424: l_year_start_date gl_periods.year_start_date%TYPE;
425:
418: l_day_row number;
419: l_period_year gl_periods.period_year%TYPE;
420: l_quarter_num gl_periods.quarter_num%TYPE;
421: l_period_num gl_periods.period_num%TYPE;
422: l_start_date gl_periods.start_date%TYPE;
423: l_quarter_start_date gl_periods.quarter_start_date%TYPE;
424: l_year_start_date gl_periods.year_start_date%TYPE;
425:
426: cursor ent_period_cur (day date) is
419: l_period_year gl_periods.period_year%TYPE;
420: l_quarter_num gl_periods.quarter_num%TYPE;
421: l_period_num gl_periods.period_num%TYPE;
422: l_start_date gl_periods.start_date%TYPE;
423: l_quarter_start_date gl_periods.quarter_start_date%TYPE;
424: l_year_start_date gl_periods.year_start_date%TYPE;
425:
426: cursor ent_period_cur (day date) is
427: select period_year, quarter_num, period_num, start_date, quarter_start_date, year_start_date
420: l_quarter_num gl_periods.quarter_num%TYPE;
421: l_period_num gl_periods.period_num%TYPE;
422: l_start_date gl_periods.start_date%TYPE;
423: l_quarter_start_date gl_periods.quarter_start_date%TYPE;
424: l_year_start_date gl_periods.year_start_date%TYPE;
425:
426: cursor ent_period_cur (day date) is
427: select period_year, quarter_num, period_num, start_date, quarter_start_date, year_start_date
428: from gl_periods
424: l_year_start_date gl_periods.year_start_date%TYPE;
425:
426: cursor ent_period_cur (day date) is
427: select period_year, quarter_num, period_num, start_date, quarter_start_date, year_start_date
428: from gl_periods
429: where adjustment_period_flag='N'
430: and period_set_name=g_period_set_name
431: and period_type=g_period_type
432: and day between start_date and end_date;
646: sysdate,
647: g_user_id,
648: g_user_id,
649: g_login_id
650: from gl_periods
651: where period_set_name = g_period_set_name
652: and period_type = g_period_type
653: and adjustment_period_flag='N'
654: and start_date <= l_to_date
710: sysdate,
711: g_user_id,
712: g_user_id,
713: g_login_id
714: from gl_periods gl,
715: (select period_year||quarter_num ent_qtr_pk_key, min(start_date) start_date, max(end_date) end_date
716: from gl_periods
717: where period_set_name=g_period_set_name
718: and period_type=g_period_type
712: g_user_id,
713: g_login_id
714: from gl_periods gl,
715: (select period_year||quarter_num ent_qtr_pk_key, min(start_date) start_date, max(end_date) end_date
716: from gl_periods
717: where period_set_name=g_period_set_name
718: and period_type=g_period_type
719: and adjustment_period_flag='N'
720: group by period_year||quarter_num) gl2
760: from ozf_time_ent_period;
761:
762: delete from OZF_TIME_ENT_YEAR where ent_year_id in
763: (select period_year
764: from gl_periods
765: where period_set_name = g_period_set_name
766: and period_type = g_period_type
767: and adjustment_period_flag='N'
768: and start_date <= l_to_date
795: sysdate last_update_date,
796: g_user_id last_updated_by,
797: g_user_id created_by,
798: g_login_id last_update_login
799: from gl_periods gl,
800: (select period_year period_year, min(start_date) start_date, max(end_date) end_date
801: from gl_periods
802: where period_set_name=g_period_set_name
803: and period_type=g_period_type
797: g_user_id created_by,
798: g_login_id last_update_login
799: from gl_periods gl,
800: (select period_year period_year, min(start_date) start_date, max(end_date) end_date
801: from gl_periods
802: where period_set_name=g_period_set_name
803: and period_type=g_period_type
804: and adjustment_period_flag='N'
805: and end_date <= l_end_date
1395: begin
1396:
1397: select max(end_date)
1398: into l_return_date
1399: from gl_periods
1400: where adjustment_period_flag = 'N'
1401: and period_set_name = l_period_set_name
1402: and period_type = l_period_type;
1403: