QA: Journal Source Balance

Description
select /*+ no_merge(x)*/
sum(x.amount) balance
from
(
select /*+ leading(gcc) use_nl(gcc)*/
nvl(gjl.accounted_dr,0)-nvl(gjl.accounted_cr,0) amount
from
gl_code_combinations gcc,
gl_je_lines gjl,
gl_je_headers gjh
where
(gjh.je_source in (select gjsv.je_source_name from gl_je_sources_vl gjsv where gjsv.user_je_source_name=:p_journal_source) ) and
(
gcc.segment1=:segment1
) and
(
gcc.segment4:segment4
) and
1=1 and
gcc.chart_of_accounts_id=:l_coa_id and
gcc.summary_flag='N' and
gcc.code_combination_id=gjl.code_combination_id and
gjh.ledger_id=:l_ledger_id and
gjl.ledger_id=:l_ledger_id and
gjh.actual_flag=:p_actual_flag and
gjh.currency_code=:p_currency_code and
gjh.status='P' and
gjh.period_name=:p_period_name and
gjl.period_name=:p_period_name and
gjl.je_header_id=gjh.je_header_id
) x
where
x.amount<>0
Parameter NameSQL textValidation
Ledger ID
 
Number
Chart Of Accounts ID
 
Number
Actual Flag
 
Char
Journal Source
 
LOV
Period
 
LOV
Currency
 
Char
GL_SEGMENT1
 
Char
GL_SEGMENT4
 
Char