select
gjh.je_header_id,
gjh.set_of_books_id ,
(SELECT user_je_source_name
FROM GL_JE_SOURCES_TL
where language = 'ESA'
and je_source_name = gjh.je_source) origen,
(SELECT user_je_category_name
FROM GL_JE_CATEGORIES_TL
where language = 'ESA'
and je_category_name = gjh.je_category) categoria,
gjh.period_Name periodo,
gjh.name asiento,
gjh.currency_code divisa,
gjl.je_line_num,
gcc.segment1 ||'.'|| gcc.segment2 ||'.'||
gcc.segment3 ||'.'|| gcc.segment4 ||'.'||
gcc.segment5
cuenta, /*de
acuerdo al plan de cuentas*/
(NVL(gjl.ACCOUNTED_DR, 0) - NVL(gjl.ACCOUNTED_CR, 0))
importe
from GL_JE_LINES gjl,
GL_JE_headers gjh,
GL_PERIODS glp,
GL_CODE_COMBINATIONS gcc
where gjl.period_name = glp.period_name
and gjl.je_header_id = gjh.je_header_id
and gcc.code_combination_id = gjl.code_combination_id
and gjh.period_Name=&PERIODO
AND glp.ADJUSTMENT_PERIOD_FLAG = 'N'
and gcc.DETAIL_POSTING_ALLOWED_FLAG = 'Y';
No hay comentarios:
Publicar un comentario