select receipt_num,transaction_id,shipment_line_id,acct_type,acct_nature,
a.code_combination_id,entered_dr,entered_cr, count(*) cnt,
sum(nvl(entered_cr,0)) - avg(nvl(entered_cr,0)) "Excess Credit",
sum(nvl(entered_dr,0))-avg(nvl(entered_dr,0)) "Excess Debit" ,
gcc.concatenated_segments
from JAI_RCV_JOURNAL_ENTRIES a,gl_code_combinations_kfv gcc
where 0 < (
select count(*)
from JAI_RCV_JOURNAL_ENTRIES b
where a.transaction_id=b.transaction_id
and a.code_combination_id=b.code_combination_id
and a.acct_nature=b.acct_nature
and a.acct_type=b.acct_type
and nvl(a.entered_cr,0) = nvl(b.entered_cr,0)
and nvl(a.entered_dr,0) = nvl(b.entered_dr,0)
and a.rowid <> b.rowid
)
and a.period_name='&period_name'
and a.organization_code='&organization_code'
and a.transaction_type ='RECEIVE'
and a.code_combination_id=&CCID and gcc.code_combination_id = a.code_combination_id
group by receipt_num,transaction_id,shipment_line_id,acct_type,acct_nature,
a.code_combination_id,entered_dr,entered_cr,gcc.concatenated_segments
order by receipt_num,transaction_id,shipment_line_id,acct_type,acct_nature,
a.code_combination_id,entered_dr,entered_cr
a.code_combination_id,entered_dr,entered_cr, count(*) cnt,
sum(nvl(entered_cr,0)) - avg(nvl(entered_cr,0)) "Excess Credit",
sum(nvl(entered_dr,0))-avg(nvl(entered_dr,0)) "Excess Debit" ,
gcc.concatenated_segments
from JAI_RCV_JOURNAL_ENTRIES a,gl_code_combinations_kfv gcc
where 0 < (
select count(*)
from JAI_RCV_JOURNAL_ENTRIES b
where a.transaction_id=b.transaction_id
and a.code_combination_id=b.code_combination_id
and a.acct_nature=b.acct_nature
and a.acct_type=b.acct_type
and nvl(a.entered_cr,0) = nvl(b.entered_cr,0)
and nvl(a.entered_dr,0) = nvl(b.entered_dr,0)
and a.rowid <> b.rowid
)
and a.period_name='&period_name'
and a.organization_code='&organization_code'
and a.transaction_type ='RECEIVE'
and a.code_combination_id=&CCID and gcc.code_combination_id = a.code_combination_id
group by receipt_num,transaction_id,shipment_line_id,acct_type,acct_nature,
a.code_combination_id,entered_dr,entered_cr,gcc.concatenated_segments
order by receipt_num,transaction_id,shipment_line_id,acct_type,acct_nature,
a.code_combination_id,entered_dr,entered_cr
No comments:
Post a Comment