GL Periods

Description
Categories: Enginatics
Repository: Github
Geleral ledger calendars and accounting periods
select
gp.period_set_name calendar,
gps.description calendar_description,
xxen_util.yes(gps.security_flag) enable_security,
gp.entered_period_name,
gpt.user_period_type type,
gp.period_year year,
gp.quarter_num quarter,
gp.period_num,
gp.start_date,
gp.end_date,
gp.period_name,
xxen_util.yes(gp.adjustment_period_flag) adjustment_period,
xxen_util.meaning((select 'Y' from gl_period_statuses gps where gp.period_type=gps.period_type and gp.period_name=gps.period_name and gps.closing_status in ('O','W','C','P') and rownum=1),'YES_NO',0) used,
gpt.number_per_fiscal_year periods_per_year,
decode(gpt.year_type_in_name,'C','Calendar','F','Fiscal') year_type,
xxen_util.user_name(gp.created_by) created_by,
xxen_util.client_time(gp.creation_date) creation_date,
xxen_util.user_name(gp.last_updated_by) last_updated_by,
xxen_util.client_time(gp.last_update_date) last_update_date,
gp.period_type
from
gl_period_sets gps,
gl_periods gp,
gl_period_types gpt
where
1=1 and
gps.period_set_name=gp.period_set_name and
gp.period_type=gpt.period_type
order by
gp.period_set_name,
gpt.user_period_type,
gp.period_year desc,
gp.period_num desc
Parameter NameSQL textValidation
Period From
gp.start_date>=(
select
min(gp.start_date)
from
gl_periods gp
where
gp.period_name=:period_from and
gp.period_set_name in (
select gl.period_set_name from gl_ledgers gl where
(:ledger is null or gl.name=:ledger) and
(:chart_of_accounts is null or gl.chart_of_accounts_id in (select fifsv.id_flex_num from fnd_id_flex_structures_vl fifsv where fifsv.application_id=101 and fifsv.id_flex_code='GL#' and fifsv.id_flex_structure_name=:chart_of_accounts))
)
)
LOV
Period To
gp.end_date<=(
select
max(gp.end_date)
from
gl_periods gp
where
gp.period_name=:period_to and
gp.period_set_name in (
select gl.period_set_name from gl_ledgers gl where
(:ledger is null or gl.name=:ledger) and
(:chart_of_accounts is null or gl.chart_of_accounts_id in (select fifsv.id_flex_num from fnd_id_flex_structures_vl fifsv where fifsv.application_id=101 and fifsv.id_flex_code='GL#' and fifsv.id_flex_structure_name=:chart_of_accounts))
))
LOV
Calendar
gp.period_set_name=:calendar
LOV
Period Type
gp.period_type=:period_type
LOV
Ledger
(gp.period_set_name, gp.period_type) in (select gl.period_set_name, gl.accounted_period_type from gl_ledgers gl where gl.ledger_id=:ledger_id)
LOV
Chart of Accounts
(gp.period_set_name, gp.period_type) in (select gl.period_set_name, gl.accounted_period_type from gl_ledgers gl where
gl.chart_of_accounts_id in (select fifsv.id_flex_num from fnd_id_flex_structures_vl fifsv where fifsv.application_id=101 and fifsv.id_flex_code='GL#' and fifsv.id_flex_structure_name=:chart_of_accounts)
)
LOV