Research of Trial Balance report. Help, please

Hello guys,.
I have a trial balance report that reports on more than one period (for example, between January and March).
I am registered for the opening and the closing balance. Then included the total debits and credits for each period. I'd like to think I did it successfully and to the best of my knowledge.
However for some codes, combinations, I see an opening balance (say 1 000 000), total appropriations 0, total debits 400 000 5 000 and closing balance. What I mean essentially is, the numbers don't seem to match. When I analyze the account survey GL the total debits and total credits are exactly as stated in my report. Can someone help me with this, or perhaps anyone with a query better. I'm doing this project on 11i.
Thank you very much.

Here's my post:

create or replace function get_open_balance
(p_code_combination_id number,
p_set_of_books_id number,
p_period_name in varchar2)
Return number
is
v_open_balance number: = 0;
Start
SELECT
NVL (sum(bal.begin_balance_dr-bal.begin_balance_cr), 0)
IN v_open_balance
OF gl_code_combinations_kfv cc
gl_balances ball
WHERE
CC.code_combination_id = bal.code_combination_id
AND cc.code_combination_id = p_code_combination_id
AND bal.period_name = p_period_name
AND bal.set_of_books_id = p_set_of_books_id
ORDER by
CC.concatenated_segments;
Return v_open_balance;
exception
When no_data_found then
return 0;
while others then
return 0;
end get_open_balance;


create or replace function get_close_balance
(p_code_combination_id number,
p_set_of_books_id number,
p_period_name in varchar2)
Return number
is
v_close_balance number: = 0;
Start
SELECT
NVL (sum (bal.begin_balance_dr - bal.begin_balance_cr +))
Bal.period_net_dr - bal.period_net_cr), 0)
IN v_close_balance
OF gl_code_combinations_kfv cc
gl_balances ball
WHERE
CC.code_combination_id = bal.code_combination_id
AND cc.code_combination_id = p_code_combination_id
AND bal.period_name = p_period_name
AND bal.set_of_books_id = p_set_of_books_id
ORDER by
CC.concatenated_segments;
Return v_close_balance;
exception
When no_data_found then
return 0;
while others then
return 0;
end get_close_balance;


So here's my query:

Select
GCC.code_combination_id,
GCC.concatenated_segments,
GSOB.currency_code,
GSOB. Name sob_name,
gl_flexfields_pkg.get_description_sql (gcc.chart_of_accounts_id,
4, gcc.segment4) account_description,.
get_open_balance (gcc.code_combination_id, gsob.set_of_books_id,: p_period_from) opening_balance.
NVL ((select sum (entered_cr)
of gl_je_lines gjl
where gjl.code_combination_id = gcc.code_combination_id
and gjl.status = 'P '.
and gjl.effective_date between to_date ('01-' |: p_period_from)
and last_day (to_date ('01-' |: p_period_to))), 0) credit.
NVL ((select sum (entered_dr)
of gl_je_lines gjl
where gjl.code_combination_id = gcc.code_combination_id
and gjl.status = 'P '.
and gjl.effective_date between to_date ('01-' |: p_period_from)
and last_day (to_date ('01-' |: p_period_to))), 0) flow,.
get_close_balance (gcc.code_combination_id, gsob.set_of_books_id,: p_period_to) closing_balance
of gl_code_combinations_kfv CCG, gl_sets_of_books gsob
where gsob.chart_of_accounts_id = gcc.chart_of_accounts_id
and gsob.set_of_books_id = nvl (: p_set_of_books_id, gsob.set_of_books_id)

Hello.

Simple. User entered_dr or entered_cr. Allways never use accounted_dr or accounted_cr.

Octavio

Tags: Oracle Applications

Similar Questions

Maybe you are looking for