300: ln_dbg_level NUMBER := FND_LOG.G_CURRENT_RUNTIME_LEVEL;
301: ln_proc_level NUMBER := FND_LOG.LEVEL_PROCEDURE;
302: CURSOR periods_cur IS
303: SELECT period_name
304: FROM gl_period_statuses
305: WHERE application_id = 101
306: AND ledger_id = pn_ledger_id
307: AND start_date >=
308: (select start_date
305: WHERE application_id = 101
306: AND ledger_id = pn_ledger_id
307: AND start_date >=
308: (select start_date
309: from gl_period_statuses
310: where application_id = 101
311: and ledger_id = pn_ledger_id
312: and period_name = pv_period_from)
313: AND end_date <= (select end_date
310: where application_id = 101
311: and ledger_id = pn_ledger_id
312: and period_name = pv_period_from)
313: AND end_date <= (select end_date
314: from gl_period_statuses
315: where application_id = 101
316: and ledger_id = pn_ledger_id
317: and period_name = pv_period_to)
318: AND adjustment_period_flag = 'N'
402: JOURNAL_AMOUNT NUMBER;
403: l_Error_Msg VARCHAR2(300);
404: CURSOR periods_cur IS
405: SELECT period_name
406: FROM gl_period_statuses
407: WHERE application_id = 101
408: AND ledger_id = P_LEDGER_ID
409: AND start_date >=
410: (select start_date
407: WHERE application_id = 101
408: AND ledger_id = P_LEDGER_ID
409: AND start_date >=
410: (select start_date
411: from gl_period_statuses
412: where application_id = 101
413: and ledger_id = P_LEDGER_ID
414: and period_name = P_PERIOD_FROM)
415: AND end_date <= (select end_date
412: where application_id = 101
413: and ledger_id = P_LEDGER_ID
414: and period_name = P_PERIOD_FROM)
415: AND end_date <= (select end_date
416: from gl_period_statuses
417: where application_id = 101
418: and ledger_id = P_LEDGER_ID
419: and period_name = P_PERIOD_TO)
420: AND closing_status <> 'N'