0% found this document useful (0 votes)
145 views2 pages

Query Check JV Approve

This document contains an SQL query that selects data from various tables related to general ledger journals. The query selects journal header, batch, line, and user approval information for spreadsheet journals from January 1, 2022 to current date for a specific ledger. It orders the results by ledger, approver, batch, header, and line.

Uploaded by

Hareyuya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
145 views2 pages

Query Check JV Approve

This document contains an SQL query that selects data from various tables related to general ledger journals. The query selects journal header, batch, line, and user approval information for spreadsheet journals from January 1, 2022 to current date for a specific ledger. It orders the results by ledger, approver, batch, header, and line.

Uploaded by

Hareyuya
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

SELECT

gjh.ledger_id

,led.name ledger_name

,gjb.approver_employee_id

,usr.username approved_login

,decode(gjb.approval_status_code, 'A', gl_journals_rpt_pkg.get_action_user(gjb.je_batch_id,


'APPROVED'), null) approved_name

,decode(gjb.approval_status_code, 'A', gl_journals_rpt_pkg.get_action_date(gjb.je_batch_id,


'APPROVED'), null) batch_approved_date

,gjb.je_batch_id

,gjb.name je_batch_name

,gjb.default_effective_date

-- ,gjb.last_updated_by

,gjh.je_header_id

,gjh.name je_header_name

,gjh.description je_header_desc

,gjh.je_category

,cat.user_je_category_name

,gjh.je_source

,gjh.currency_code

,gjh.period_name

,gjh.date_created

,gjh.posted_date

,gjl.je_line_num

,gjl.code_combination_id

,gcc.segment1 || '.' || gcc.segment2 || '.' || gcc.segment3 || '.' || gcc.segment4 || '.' ||


gcc.segment5 || '.' || gcc.segment6 || '.' ||

gcc.segment7 || '.' || gcc.segment8 || '.' || gcc.segment9 || '.' || gcc.segment10 || '.' ||


gcc.segment11 account_chart

,nvl(gjl.accounted_cr, 0) accounted_cr
,nvl(gjl.accounted_dr, 0) accounted_dr

,nvl(gjl.accounted_cr, 0) - nvl(gjl.accounted_dr, 0) je_line_balance

,gjl.description je_line_desc

FROM

gl_je_headers gjh

,gl_je_batches gjb

,per_users usr

,gl_je_lines gjl

,gl_code_combinations gcc

,gl_ledgers led

,gl_je_categories_tl cat

WHERE 1=1

AND gjh.je_batch_id = gjb.je_batch_id

AND gjb.approver_employee_id = usr.person_id

AND gjh.je_header_id = gjl.je_header_id

AND gjl.code_combination_id = gcc.code_combination_id

AND gjh.ledger_id = led.ledger_id

AND gjh.je_category = cat.je_category_name

AND gjb.status = 'P'

AND gjh.je_source = 'Spreadsheet'

AND cat.language = 'US'

AND trunc(gjb.default_effective_date) between to_date('01-01-2022','dd-mm-yyyy') and trunc(sysdate)

--AND gjh.je_batch_id = 699012

ORDER BY

gjh.ledger_id

,gjb.approver_employee_id

,gjb.je_batch_id

,gjh.je_header_id

,gjl.je_line_num

You might also like