SELECT gld.ledger_id
,gjb.je_batch_id
,gjh.je_header_id
,gjl.je_line_num
,gld.name 帐套
,gjb.name 批名
,gjb.description 批说明
,gjb.posting_run_id
,gjb.posted_by 过账人 --fnd_user.user_id
,gjb.status 过账状态 --U 未过账,P 已过账,S 选定以过账,I 过账中
,gjb.posted_date 过账时间
,gjb.approver_employee_id 审批人 --per_all_people_f.person_id
,gjb.approval_status_code 审批状态 --R 需要审批但未提交,Z 无需审批,I 处理中,J 拒绝,A 批准
,gjh.name 日记账名
,gjh.description 日记账说明
,gjh.status 日记账状态 --U 未过账,P 已过账,S 选定以过账,I 过账中
,gjh.created_by 记账人 --fnd_user.user_id
,gjh.creation_date 记账日期
,gjh.default_effective_date 有效日期
,gjh.period_name 期间
,gjh.je_category
,gjc.user_je_category_name 类别
,gjh.je_source
,gjs.user_je_source_name 来源
,gjh.doc_sequence_value 单据编号
,gjh.external_reference "参考/凭证编号"
,gjh.parent_je_header_id --辅助账的源主账ID(主账日记账此字段为空)
,gjh.accrual_rev_flag
,gjh.accrual_rev_status 冲销状态 --空或N 未冲销,R 已冲销
,gjh.accrual_rev_period_name 冲销期间
,gjh.accrual_rev_je_header_id --冲销日记账的源日记账ID 或 源日记账的冲销日记账ID(非冲销日记账此字段为空,源日记账删除冲销日记账后也清空)
,gjh.reversed_je_header_id --冲销日记账的源日记账ID(非冲销日记账此字段为空)
,gjl.description 行说明
,gjh.currency_code 原币币种
,gld.currency_code 本位币币种
,gjh.currency_conversion_rate 汇率
,gjh.currency_conversion_type 汇率类型
,gjh.currency_conversion_date 汇率日期
,gjl.entered_dr 原币_借
,gjl.entered_cr 原币_贷
,gjl.accounted_dr 本位币_借
,gjl.accounted_cr 本位币_贷
,gcc.segment1 公司段代码
,gcc.segment2
,gcc.segment3
,gcc.segment4
,gcc.segment5
,gcc.segment6
,gcc.segment7
,gcc.segment8
,gcc.segment9
,(SELECT ffvv.description
FROM apps.fnd_flex_value_sets ffvs
,apps.fnd_flex_values_vl ffvv
WHERE ffvs.flex_value_set_id = ffvv.flex_value_set_id
AND ffvs.flex_value_set_name = 'COA_COM_CODE'
AND ffvv.flex_value = gcc.segment1
AND ffvv.enabled_flag = 'Y'
AND trunc(SYSDATE) BETWEEN
nvl(ffvv.start_date_active, trunc(SYSDATE - 1)) AND
nvl(ffvv.end_date_active, trunc(SYSDATE + 1))) 公司名称
FROM gl.gl_je_batches gjb
,gl.gl_je_headers gjh
,gl.gl_je_lines gjl
,gl.gl_code_combinations gcc
,gl.gl_ledgers gld
,apps.gl_je_categories_vl gjc
,apps.gl_je_sources_vl gjs
WHERE gjb.je_batch_id = gjh.je_batch_id
AND gjh.je_header_id = gjl.je_header_id
AND gjl.code_combination_id = gcc.code_combination_id
AND gjh.ledger_id = gld.ledger_id
AND gjh.je_category = gjc.je_category_name
AND gjh.je_source = gjs.je_source_name
AND gjh.actual_flag = 'A' --余额类型:'A' 实际,'B' 预算,'E' 保留款
AND gjh.period_name = '2021-01';
Oracle EBS R12 GL总帐模块 查询日记帐明细SQL
最新推荐文章于 2022-09-20 14:25:43 发布