117: --AND cdv.organization_id = p_organization_id Bug#5632148
118: AND (p_account_from is null or
119: cdv.reference_account in (
120: SELECT code_combination_id from gl_code_combinations glcc
121: where fnd_flex_ext.get_segs('SQLGL', 'GL#',
122: glcc.chart_of_accounts_id, glcc.code_combination_id) >= p_account_from
123: AND fnd_flex_ext.get_segs('SQLGL', 'GL#', glcc.chart_of_accounts_id,
124: glcc.code_combination_id) <= p_account_to))
125: UNION ALL
119: cdv.reference_account in (
120: SELECT code_combination_id from gl_code_combinations glcc
121: where fnd_flex_ext.get_segs('SQLGL', 'GL#',
122: glcc.chart_of_accounts_id, glcc.code_combination_id) >= p_account_from
123: AND fnd_flex_ext.get_segs('SQLGL', 'GL#', glcc.chart_of_accounts_id,
124: glcc.code_combination_id) <= p_account_to))
125: UNION ALL
126: SELECT
127: oap.period_set_name,
158: --AND cdv.organization_id = p_organization_id Bug#5632148
159: AND (p_account_from is null or
160: cdv.reference_account in (
161: SELECT code_combination_id from gl_code_combinations glcc
162: where fnd_flex_ext.get_segs('SQLGL', 'GL#',
163: glcc.chart_of_accounts_id, glcc.code_combination_id) >= p_account_from
164: AND fnd_flex_ext.get_segs('SQLGL', 'GL#', glcc.chart_of_accounts_id,
165: glcc.code_combination_id) <= p_account_to));
166:
160: cdv.reference_account in (
161: SELECT code_combination_id from gl_code_combinations glcc
162: where fnd_flex_ext.get_segs('SQLGL', 'GL#',
163: glcc.chart_of_accounts_id, glcc.code_combination_id) >= p_account_from
164: AND fnd_flex_ext.get_segs('SQLGL', 'GL#', glcc.chart_of_accounts_id,
165: glcc.code_combination_id) <= p_account_to));
166:
167: begin
168: