/* Formatted on 5/6/2025 9:55:34 AM (QP5 v5.381) */
select * from GL_PERIOD_STATUSES
select * from GL_PERIOD_STATUSES_V
SELECT * FROM GL_LEDGERS where name ='Vision Operations (USA)'
SELECT NAME,
LEDGER_ID,
period_name,
APPLICATION_NAME,
status
FROM (SELECT ff.NAME NAME,
kk.LEDGER_ID,
kk.PERIOD_NAME,
jj.APPLICATION_NAME,
period_year,
start_date, end_date,
DECODE (kk.CLOSING_STATUS,
'O', 'Open',
'C', 'Closed',
'F', 'Future',
'N', 'Never') STATUS
FROM GL_PERIOD_STATUSES_V kk, fnd_application_vl jj, gl_ledgers ff
WHERE 1 = 1
AND jj.APPLICATION_ID = kk.APPLICATION_ID
AND ff.LEDGER_ID = kk.LEDGER_ID
AND kk.CLOSING_STATUS != 'N')
where name ='Vision Operations (USA)'
--and period_year = 2024
and APPLICATION_NAME='General Ledger'
UNION
(SELECT
fbc.BOOK_TYPE_CODE NAME,
fbc.set_of_books_id LEDGER_ID,
fdp.period_name,
'Assets' APPLICATION_NAME,
DECODE (fdp.period_close_date, NULL, 'Open', 'Closed') status
FROM fa_book_controls fbc, fa_deprn_periods fdp
WHERE fbc.book_type_code = fdp.book_type_code
AND fbc.DATE_INEFFECTIVE IS NULL)