select
c.concatenated_segments account_code,
ar.acct_bal ar_account_balance,
gl.acct_bal gl_account_balance
from
(select l.code_combination_id,sum(nvl(accounted_dr,0)-nvl(accounted_cr,0)) acct_bal
from xla_ae_headers h,xla_ae_lines l
where h.ae_header_id=l.ae_header_id and l.application_id=222 and
h.balance_type_code='A' and h.gl_transfer_status_code='Y'
group by l.code_combination_id) ar,
(select l.code_combination_id,sum(nvl(accounted_dr,0)-nvl(accounted_cr,0)) acct_bal
from gl_je_headers h, gl_je_lines l
where h.je_header_id=l.je_header_id and h.je_source='Receivables' and h.actual_flag='A' and h.status='P' group by l.code_combination_id) gl,
gl_code_combinations_kfv c
where
ar.code_combination_id=gl.code_combination_id
and ar.code_combination_id=c.code_combination_id
No comments:
Post a Comment