Monday, 27 March 2017

Approved Cost Budget Version Detail in oracle projects

/* Formatted on 3/27/2017 2:37:59 PM (QP5 v5.114.809.3010) */
SELECT   po.project_id,
         bv.version_name,
         pt.name AS plan_type_name,
         bv.description,
         po.fin_plan_preference_code,
         bv.budget_version_id,
         bv.record_version_number,
         bv.budget_status_code,
         bv.raw_cost Row_Cost_Total
  FROM   pa_proj_fp_options po,
         pa_fin_plan_types_vl pt,
         pa_budget_versions bv
 WHERE   bv.project_id = :p_project_id
         AND bv.budget_version_id =
               (SELECT   budget_version_id
                  FROM   pa_budget_versions
                 WHERE   project_id = :p_project_id
                         AND fin_plan_type_id =
                               (SELECT   fin_plan_type_id
                                  FROM   pa_fin_plan_types_vl
                                 WHERE   migrated_frm_bdgt_typ_code = 'AC'
                                         AND UPPER (NAME) =
                                               UPPER ('Approved Cost Budget'))
                         AND budget_status_code = 'B'
                         AND CURRENT_FLAG = 'Y')
         AND bv.budget_version_id = po.fin_plan_version_id
         AND bv.ci_id IS NULL
         AND po.fin_plan_option_level_code = 'PLAN_VERSION'
         AND po.fin_plan_type_id = pt.fin_plan_type_id
         AND pt.fin_plan_type_id =
               (SELECT   fin_plan_type_id
                  FROM   pa_fin_plan_types_vl
                 WHERE   migrated_frm_bdgt_typ_code = 'AC'
                         AND UPPER (name) = UPPER ('Approved Cost Budget'));

No comments:

Post a Comment