select distinct gjl.accounted_dr, gjl.accounted_cr, gjh.je_source, gjh.je_category, gcc.concatenated_segments, gjl.reference_5, gjh.status
, gcc.code_combination_id, pda.code_combination_id
-- xdl.source_distribution_id_num_1 , xdl.source_distribution_type
from
apps.gl_je_headers gjh,
apps.gl_je_lines gjl,
apps.gl_code_combinations_kfv gcc,
apps.gl_import_references gir,
apps.gl_je_batches gjb,
apps.po_distributions_all pda
where 1=1
AND gjh.je_header_id = gjl.je_header_id
AND gjh.je_header_id = gir.je_header_id
AND gir.je_header_id = gjl.je_header_id
AND gir.je_line_num = gjl.je_line_num
AND gjl.code_combination_id = gcc.code_combination_id
AND gjb.je_batch_id = gir.je_batch_id
AND pda.code_combination_id = gcc.code_combination_id
AND gjl.period_name in (select distinct period_name from apps.gl_periods where start_date between :p_from_per and :p_to_per)
AND gcc.segment4 in (3021000, 3021100)--, 3021700, 3023000, 3023100)
AND gcc.segment3 in (100603)
AND gcc.segment2 not in (102)
and gjh.je_source = 'Cost Management'
and gjh.je_category = 'Receiving'
, gcc.code_combination_id, pda.code_combination_id
-- xdl.source_distribution_id_num_1 , xdl.source_distribution_type
from
apps.gl_je_headers gjh,
apps.gl_je_lines gjl,
apps.gl_code_combinations_kfv gcc,
apps.gl_import_references gir,
apps.gl_je_batches gjb,
apps.po_distributions_all pda
where 1=1
AND gjh.je_header_id = gjl.je_header_id
AND gjh.je_header_id = gir.je_header_id
AND gir.je_header_id = gjl.je_header_id
AND gir.je_line_num = gjl.je_line_num
AND gjl.code_combination_id = gcc.code_combination_id
AND gjb.je_batch_id = gir.je_batch_id
AND pda.code_combination_id = gcc.code_combination_id
AND gjl.period_name in (select distinct period_name from apps.gl_periods where start_date between :p_from_per and :p_to_per)
AND gcc.segment4 in (3021000, 3021100)--, 3021700, 3023000, 3023100)
AND gcc.segment3 in (100603)
AND gcc.segment2 not in (102)
and gjh.je_source = 'Cost Management'
and gjh.je_category = 'Receiving'
No comments:
Post a Comment