select a.budget_revision_id,
a.budget_group_id,
a.gl_budget_version_id,
a.code_combination_id,
a.currency_code,
b.concatenated_segments,
a.gl_budget_name,
a.start_period,
a.end_period,
a.budget_balance,
a.revision_amount,
decode(:cf_document_posting_status, 0, a.budget_balance + a.revision_amount, a.budget_balance) rev_budget,
b.description,
a.set_of_books_id,
a.chart_of_accounts_id,
PSB_PSBRPBRS_XMLP_PKG.cf_document_posting_statusform(a.currency_code) CF_document_posting_status,
PSB_PSBRPBRS_XMLP_PKG.cf_original_budgetformula(a.code_combination_id, a.budget_group_id, a.start_period, a.gl_budget_version_id, a.set_of_books_id, a.end_period, a.currency_code) CF_original_budget,
PSB_PSBRPBRS_XMLP_PKG.cf_percent_changeformula(a.budget_balance, a.revision_amount) CF_percent_change,
PSB_PSBRPBRS_XMLP_PKG.cf_acct_flex_descformula(a.chart_of_accounts_id, a.code_combination_id) CF_Acct_Flex_Desc,
PSB_PSBRPBRS_XMLP_PKG.CP_ORIGINAL_BUDGET_p CP_ORIGINAL_BUDGET
from psb_budget_revision_summary_v a,
gl_code_combinations_kfv b
where a.code_combination_id = b.code_combination_id
and a.chart_of_accounts_id = b.chart_of_accounts_id
and a.budget_revision_id = :p_budget_revision_id
ORDER BY 1 ASC,5 ASC,7 ASC,2 ASC |