DBA Data[Home] [Help]

VIEW: APPS.PA_RPT_CUST_SUMMARY_BASE_V

Source

View Text - Preformatted

SELECT project_id , project_accum_id , accum_period , customer_id , raw_cost_itd , raw_cost_ytd , raw_cost_ptd , billable_raw_cost_itd , billable_raw_cost_ytd , billable_raw_cost_ptd , burdened_cost_itd , burdened_cost_ytd , burdened_cost_ptd , billable_burdened_cost_itd , billable_burdened_cost_ytd , billable_burdened_cost_ptd , revenue_itd , revenue_ytd , revenue_ptd , labor_hours_itd , labor_hours_ytd , labor_hours_ptd , billable_labor_hours_itd , billable_labor_hours_ytd , billable_labor_hours_ptd , b1.budget_type_code , b1.budget_type , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , b2.budget_type_code , b2.budget_type , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , b3.budget_type_code , b3.budget_type , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , b4.budget_type_code , b4.budget_type , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 from pa_rpt_cust_act_summary, pa_budget_types b1, pa_budget_types b2, pa_budget_types b3, pa_budget_types b4 WHERE b1.budget_type_code = pa_rpt_utils.get_rpt_budget_type('C',1) And b2.budget_type_code = pa_rpt_utils.get_rpt_budget_type('C',2) And b3.budget_type_code = pa_rpt_utils.get_rpt_budget_type('R',1) and b4.budget_type_code = pa_rpt_utils.get_rpt_budget_type('R',2) UNION ALL Select /* Only Budget type 1 */ project_id , project_accum_id , accum_period , customer_id , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , b.budget_type_code , b.budget_type , base_raw_cost_itd , base_raw_cost_ytd , base_raw_cost_ptd , base_raw_cost_tot , orig_raw_cost_itd , orig_raw_cost_ytd , orig_raw_cost_ptd , orig_raw_cost_tot , base_burdened_cost_itd , base_burdened_cost_ytd , base_burdened_cost_ptd , base_burdened_cost_tot , orig_burdened_cost_itd , orig_burdened_cost_ytd , orig_burdened_cost_ptd , orig_burdened_cost_tot , orig_labor_hours_itd , orig_labor_hours_ytd , orig_labor_hours_ptd , orig_labor_hours_tot , base_labor_hours_itd , base_labor_hours_ytd , base_labor_hours_ptd , base_labor_hours_tot , b2.budget_type_code , b2.budget_type , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , b3.budget_type_code , b3.budget_type , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , b4.budget_type_code , b4.budget_type , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 from pa_rpt_cust_bgt_summary b, pa_budget_types b2, pa_budget_types b3, pa_budget_types b4 Where b2.budget_type_code = pa_rpt_utils.get_rpt_budget_type('C',2) And b3.budget_type_code = pa_rpt_utils.get_rpt_budget_type('R',1) And b4.budget_type_code = pa_rpt_utils.get_rpt_budget_type('R',2) And b.budget_type_code = pa_rpt_utils.get_rpt_budget_type('C',1) UNION ALL Select /* ONLY Budget type 2 */ project_id , project_accum_id , accum_period , customer_id , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , b1.budget_type_code , b1.budget_type , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , b.budget_type_code , b.budget_type , base_raw_cost_itd , base_raw_cost_ytd , base_raw_cost_ptd , base_raw_cost_tot , orig_raw_cost_itd , orig_raw_cost_ytd , orig_raw_cost_ptd , orig_raw_cost_tot , base_burdened_cost_itd , base_burdened_cost_ytd , base_burdened_cost_ptd , base_burdened_cost_tot , orig_burdened_cost_itd , orig_burdened_cost_ytd , orig_burdened_cost_ptd , orig_burdened_cost_tot , orig_labor_hours_itd , orig_labor_hours_ytd , orig_labor_hours_ptd , orig_labor_hours_tot , base_labor_hours_itd , base_labor_hours_ytd , base_labor_hours_ptd , base_labor_hours_tot , b3.budget_type_code , b3.budget_type , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , b4.budget_type_code , b4.budget_type , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 from pa_rpt_cust_bgt_summary b, pa_budget_types b1, pa_budget_types b3, pa_budget_types b4 Where b1.budget_type_code = pa_rpt_utils.get_rpt_budget_type('C',1) And b3.budget_type_code = pa_rpt_utils.get_rpt_budget_type('R',1) And b4.budget_type_code = pa_rpt_utils.get_rpt_budget_type('R',2) And b.budget_type_code = pa_rpt_utils.get_rpt_budget_type('C',2) UNION ALL Select /* ONLY Budget type 3 */ project_id , project_accum_id , accum_period , customer_id , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , b1.budget_type_code , b1.budget_type , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , b2.budget_type_code , b2.budget_type , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , b.budget_type_code , b.budget_type , base_revenue_itd , base_revenue_ytd , base_revenue_ptd , base_revenue_tot , orig_revenue_itd , orig_revenue_ytd , orig_revenue_ptd , orig_revenue_tot , orig_labor_hours_itd , orig_labor_hours_ytd , orig_labor_hours_ptd , orig_labor_hours_tot , base_labor_hours_itd , base_labor_hours_ytd , base_labor_hours_ptd , base_labor_hours_tot , b4.budget_type_code , b4.budget_type , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 from pa_rpt_cust_bgt_summary b, pa_budget_types b1, pa_budget_types b2, pa_budget_types b4 Where b1.budget_type_code = pa_rpt_utils.get_rpt_budget_type('C',1) And b2.budget_type_code = pa_rpt_utils.get_rpt_budget_type('C',2) And b4.budget_type_code = pa_rpt_utils.get_rpt_budget_type('R',2) And b.budget_type_code = pa_rpt_utils.get_rpt_budget_type('R',1) UNION ALL Select /* ONLY Budget type 4 */ project_id , project_accum_id , accum_period , customer_id , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , b1.budget_type_code , b1.budget_type , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , b2.budget_type_code , b2.budget_type , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , b3.budget_type_code , b3.budget_type , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , b.budget_type_code , b.budget_type , base_revenue_itd , base_revenue_ytd , base_revenue_ptd , base_revenue_tot , orig_revenue_itd , orig_revenue_ytd , orig_revenue_ptd , orig_revenue_tot , orig_labor_hours_itd , orig_labor_hours_ytd , orig_labor_hours_ptd , orig_labor_hours_tot , base_labor_hours_itd , base_labor_hours_ytd , base_labor_hours_ptd , base_labor_hours_tot from pa_rpt_cust_bgt_summary b, pa_budget_types b1, pa_budget_types b2, pa_budget_types b3 Where b1.budget_type_code = pa_rpt_utils.get_rpt_budget_type('C',1) And b2.budget_type_code = pa_rpt_utils.get_rpt_budget_type('C',2) And b3.budget_type_code = pa_rpt_utils.get_rpt_budget_type('R',1) And b.budget_type_code = pa_rpt_utils.get_rpt_budget_type('R',2)
View Text - HTML Formatted

SELECT PROJECT_ID
, PROJECT_ACCUM_ID
, ACCUM_PERIOD
, CUSTOMER_ID
, RAW_COST_ITD
, RAW_COST_YTD
, RAW_COST_PTD
, BILLABLE_RAW_COST_ITD
, BILLABLE_RAW_COST_YTD
, BILLABLE_RAW_COST_PTD
, BURDENED_COST_ITD
, BURDENED_COST_YTD
, BURDENED_COST_PTD
, BILLABLE_BURDENED_COST_ITD
, BILLABLE_BURDENED_COST_YTD
, BILLABLE_BURDENED_COST_PTD
, REVENUE_ITD
, REVENUE_YTD
, REVENUE_PTD
, LABOR_HOURS_ITD
, LABOR_HOURS_YTD
, LABOR_HOURS_PTD
, BILLABLE_LABOR_HOURS_ITD
, BILLABLE_LABOR_HOURS_YTD
, BILLABLE_LABOR_HOURS_PTD
, B1.BUDGET_TYPE_CODE
, B1.BUDGET_TYPE
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, B2.BUDGET_TYPE_CODE
, B2.BUDGET_TYPE
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, B3.BUDGET_TYPE_CODE
, B3.BUDGET_TYPE
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, B4.BUDGET_TYPE_CODE
, B4.BUDGET_TYPE
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
FROM PA_RPT_CUST_ACT_SUMMARY
, PA_BUDGET_TYPES B1
, PA_BUDGET_TYPES B2
, PA_BUDGET_TYPES B3
, PA_BUDGET_TYPES B4
WHERE B1.BUDGET_TYPE_CODE = PA_RPT_UTILS.GET_RPT_BUDGET_TYPE('C'
, 1)
AND B2.BUDGET_TYPE_CODE = PA_RPT_UTILS.GET_RPT_BUDGET_TYPE('C'
, 2)
AND B3.BUDGET_TYPE_CODE = PA_RPT_UTILS.GET_RPT_BUDGET_TYPE('R'
, 1)
AND B4.BUDGET_TYPE_CODE = PA_RPT_UTILS.GET_RPT_BUDGET_TYPE('R'
, 2) UNION ALL SELECT /* ONLY BUDGET TYPE 1 */ PROJECT_ID
, PROJECT_ACCUM_ID
, ACCUM_PERIOD
, CUSTOMER_ID
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, B.BUDGET_TYPE_CODE
, B.BUDGET_TYPE
, BASE_RAW_COST_ITD
, BASE_RAW_COST_YTD
, BASE_RAW_COST_PTD
, BASE_RAW_COST_TOT
, ORIG_RAW_COST_ITD
, ORIG_RAW_COST_YTD
, ORIG_RAW_COST_PTD
, ORIG_RAW_COST_TOT
, BASE_BURDENED_COST_ITD
, BASE_BURDENED_COST_YTD
, BASE_BURDENED_COST_PTD
, BASE_BURDENED_COST_TOT
, ORIG_BURDENED_COST_ITD
, ORIG_BURDENED_COST_YTD
, ORIG_BURDENED_COST_PTD
, ORIG_BURDENED_COST_TOT
, ORIG_LABOR_HOURS_ITD
, ORIG_LABOR_HOURS_YTD
, ORIG_LABOR_HOURS_PTD
, ORIG_LABOR_HOURS_TOT
, BASE_LABOR_HOURS_ITD
, BASE_LABOR_HOURS_YTD
, BASE_LABOR_HOURS_PTD
, BASE_LABOR_HOURS_TOT
, B2.BUDGET_TYPE_CODE
, B2.BUDGET_TYPE
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, B3.BUDGET_TYPE_CODE
, B3.BUDGET_TYPE
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, B4.BUDGET_TYPE_CODE
, B4.BUDGET_TYPE
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
FROM PA_RPT_CUST_BGT_SUMMARY B
, PA_BUDGET_TYPES B2
, PA_BUDGET_TYPES B3
, PA_BUDGET_TYPES B4
WHERE B2.BUDGET_TYPE_CODE = PA_RPT_UTILS.GET_RPT_BUDGET_TYPE('C'
, 2)
AND B3.BUDGET_TYPE_CODE = PA_RPT_UTILS.GET_RPT_BUDGET_TYPE('R'
, 1)
AND B4.BUDGET_TYPE_CODE = PA_RPT_UTILS.GET_RPT_BUDGET_TYPE('R'
, 2)
AND B.BUDGET_TYPE_CODE = PA_RPT_UTILS.GET_RPT_BUDGET_TYPE('C'
, 1) UNION ALL SELECT /* ONLY BUDGET TYPE 2 */ PROJECT_ID
, PROJECT_ACCUM_ID
, ACCUM_PERIOD
, CUSTOMER_ID
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, B1.BUDGET_TYPE_CODE
, B1.BUDGET_TYPE
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, B.BUDGET_TYPE_CODE
, B.BUDGET_TYPE
, BASE_RAW_COST_ITD
, BASE_RAW_COST_YTD
, BASE_RAW_COST_PTD
, BASE_RAW_COST_TOT
, ORIG_RAW_COST_ITD
, ORIG_RAW_COST_YTD
, ORIG_RAW_COST_PTD
, ORIG_RAW_COST_TOT
, BASE_BURDENED_COST_ITD
, BASE_BURDENED_COST_YTD
, BASE_BURDENED_COST_PTD
, BASE_BURDENED_COST_TOT
, ORIG_BURDENED_COST_ITD
, ORIG_BURDENED_COST_YTD
, ORIG_BURDENED_COST_PTD
, ORIG_BURDENED_COST_TOT
, ORIG_LABOR_HOURS_ITD
, ORIG_LABOR_HOURS_YTD
, ORIG_LABOR_HOURS_PTD
, ORIG_LABOR_HOURS_TOT
, BASE_LABOR_HOURS_ITD
, BASE_LABOR_HOURS_YTD
, BASE_LABOR_HOURS_PTD
, BASE_LABOR_HOURS_TOT
, B3.BUDGET_TYPE_CODE
, B3.BUDGET_TYPE
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, B4.BUDGET_TYPE_CODE
, B4.BUDGET_TYPE
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
FROM PA_RPT_CUST_BGT_SUMMARY B
, PA_BUDGET_TYPES B1
, PA_BUDGET_TYPES B3
, PA_BUDGET_TYPES B4
WHERE B1.BUDGET_TYPE_CODE = PA_RPT_UTILS.GET_RPT_BUDGET_TYPE('C'
, 1)
AND B3.BUDGET_TYPE_CODE = PA_RPT_UTILS.GET_RPT_BUDGET_TYPE('R'
, 1)
AND B4.BUDGET_TYPE_CODE = PA_RPT_UTILS.GET_RPT_BUDGET_TYPE('R'
, 2)
AND B.BUDGET_TYPE_CODE = PA_RPT_UTILS.GET_RPT_BUDGET_TYPE('C'
, 2) UNION ALL SELECT /* ONLY BUDGET TYPE 3 */ PROJECT_ID
, PROJECT_ACCUM_ID
, ACCUM_PERIOD
, CUSTOMER_ID
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, B1.BUDGET_TYPE_CODE
, B1.BUDGET_TYPE
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, B2.BUDGET_TYPE_CODE
, B2.BUDGET_TYPE
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, B.BUDGET_TYPE_CODE
, B.BUDGET_TYPE
, BASE_REVENUE_ITD
, BASE_REVENUE_YTD
, BASE_REVENUE_PTD
, BASE_REVENUE_TOT
, ORIG_REVENUE_ITD
, ORIG_REVENUE_YTD
, ORIG_REVENUE_PTD
, ORIG_REVENUE_TOT
, ORIG_LABOR_HOURS_ITD
, ORIG_LABOR_HOURS_YTD
, ORIG_LABOR_HOURS_PTD
, ORIG_LABOR_HOURS_TOT
, BASE_LABOR_HOURS_ITD
, BASE_LABOR_HOURS_YTD
, BASE_LABOR_HOURS_PTD
, BASE_LABOR_HOURS_TOT
, B4.BUDGET_TYPE_CODE
, B4.BUDGET_TYPE
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
FROM PA_RPT_CUST_BGT_SUMMARY B
, PA_BUDGET_TYPES B1
, PA_BUDGET_TYPES B2
, PA_BUDGET_TYPES B4
WHERE B1.BUDGET_TYPE_CODE = PA_RPT_UTILS.GET_RPT_BUDGET_TYPE('C'
, 1)
AND B2.BUDGET_TYPE_CODE = PA_RPT_UTILS.GET_RPT_BUDGET_TYPE('C'
, 2)
AND B4.BUDGET_TYPE_CODE = PA_RPT_UTILS.GET_RPT_BUDGET_TYPE('R'
, 2)
AND B.BUDGET_TYPE_CODE = PA_RPT_UTILS.GET_RPT_BUDGET_TYPE('R'
, 1) UNION ALL SELECT /* ONLY BUDGET TYPE 4 */ PROJECT_ID
, PROJECT_ACCUM_ID
, ACCUM_PERIOD
, CUSTOMER_ID
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, B1.BUDGET_TYPE_CODE
, B1.BUDGET_TYPE
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, B2.BUDGET_TYPE_CODE
, B2.BUDGET_TYPE
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, B3.BUDGET_TYPE_CODE
, B3.BUDGET_TYPE
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, 0
, B.BUDGET_TYPE_CODE
, B.BUDGET_TYPE
, BASE_REVENUE_ITD
, BASE_REVENUE_YTD
, BASE_REVENUE_PTD
, BASE_REVENUE_TOT
, ORIG_REVENUE_ITD
, ORIG_REVENUE_YTD
, ORIG_REVENUE_PTD
, ORIG_REVENUE_TOT
, ORIG_LABOR_HOURS_ITD
, ORIG_LABOR_HOURS_YTD
, ORIG_LABOR_HOURS_PTD
, ORIG_LABOR_HOURS_TOT
, BASE_LABOR_HOURS_ITD
, BASE_LABOR_HOURS_YTD
, BASE_LABOR_HOURS_PTD
, BASE_LABOR_HOURS_TOT
FROM PA_RPT_CUST_BGT_SUMMARY B
, PA_BUDGET_TYPES B1
, PA_BUDGET_TYPES B2
, PA_BUDGET_TYPES B3
WHERE B1.BUDGET_TYPE_CODE = PA_RPT_UTILS.GET_RPT_BUDGET_TYPE('C'
, 1)
AND B2.BUDGET_TYPE_CODE = PA_RPT_UTILS.GET_RPT_BUDGET_TYPE('C'
, 2)
AND B3.BUDGET_TYPE_CODE = PA_RPT_UTILS.GET_RPT_BUDGET_TYPE('R'
, 1)
AND B.BUDGET_TYPE_CODE = PA_RPT_UTILS.GET_RPT_BUDGET_TYPE('R'
, 2)