DBA Data[Home] [Help]

APPS.PA_SUMMARIZE_FORECAST_UTIL_PVT SQL Statements

The following lines contain the word 'select', 'insert', 'update' or 'delete':

Line: 37

  l_last_updated_by        NUMBER(15) := PA_REP_UTIL_GLOB.G_who_columns.G_last_updated_by;
Line: 42

  l_last_update_date       DATE := PA_REP_UTIL_GLOB.G_who_columns.G_last_update_date;
Line: 43

  l_program_update_date    DATE := PA_REP_UTIL_GLOB.G_who_columns.G_last_update_date;
Line: 52

  PROCEDURE insert_fct_into_tmp_table
  IS
  BEGIN
    PA_DEBUG.Set_Curr_Function( p_function => 'insert_fct_into_tmp_table');
Line: 57

    PA_DEBUG.g_err_stage := '205: Before inserting recs into Temp Table';
Line: 65

    INSERT
    INTO pa_rep_util_summ0_tmp
    ( row_id
    , parent_row_id
    , expenditure_organization_id
    , person_id
    , assignment_id
    , work_type_id
    , org_util_category_id
    , res_util_category_id
    , expenditure_type
    , expenditure_type_class
    , pa_period_name
    , pa_period_num
    , pa_period_year
    , pa_quarter_number
    , gl_period_name
    , gl_period_num
    , gl_period_year
    , gl_quarter_number
    , global_exp_period_end_date
    , global_exp_year
    , global_exp_month_number
    , total_hours
    , total_prov_hours
    , total_wghted_hours_people
    , total_wghted_hours_org
    , prov_wghted_hours_people
    , prov_wghted_hours_org
    , reduce_capacity
    , delete_flag               )
    SELECT
      row_id
    , parent_row_id
    , expenditure_organization_id
    , person_id
    , assignment_id
    , work_type_id
    , org_util_category_id
    , res_util_category_id
    , expenditure_type
    , expenditure_type_class
    , pa_period_name
    , pa_period_num
    , pa_period_year
    , pa_quarter_number
    , gl_period_name
    , gl_period_num
    , gl_period_year
    , gl_quarter_number
    , global_exp_period_end_date
    , global_exp_year
    , global_exp_month_number
    , total_hours
    , total_prov_hours
    , total_wghted_hours_people
    , total_wghted_hours_org
    , prov_wghted_hours_people
    , prov_wghted_hours_org
    , reduce_capacity
    , delete_flag
    FROM pa_rep_util_summ00_tmp
    WHERE rownum <= l_fetch_size;
Line: 140

  END insert_fct_into_tmp_table;
Line: 147

  l_records_inserted     PLS_INTEGER;
Line: 148

  l_records_updated      PLS_INTEGER;
Line: 150

  l_records_inserted1    PLS_INTEGER;
Line: 189

            Insert_Fcst_Into_Tmp_PAGLGE;
Line: 195

            Insert_Fcst_Into_Tmp_PAGL;
Line: 202

          Insert_Fcst_Into_Tmp_PAGE;
Line: 208

          Insert_Fcst_Into_Tmp_PA;
Line: 216

          Insert_Fcst_Into_Tmp_GLGE;
Line: 222

          Insert_Fcst_Into_Tmp_GL;
Line: 229

        Insert_Fcst_Into_Tmp_GE;
Line: 232

      PA_DEBUG.G_Err_Stage := '700 : After Calling the INSERT_PROC_[PA][GL][GE]';
Line: 249

      insert_fct_into_tmp_table;
Line: 251

      l_records_inserted := SQL%ROWCOUNT;
Line: 253

      PA_DEBUG.G_Err_Stage := '750 : Records Inserted in Temp tab : ' || l_records_inserted;
Line: 259

      IF (l_records_inserted = 0 AND l_capacity_summarized= 1) THEN
      IF P_DEBUG_MODE = 'Y' THEN /* Added Debug Profile Option Check for bug#2674619 */
      PA_DEBUG.G_Err_Stage := '757 : EXITING since l_records_inserted = 0 AND l_capacity_summarized= 1';
Line: 272

      UPDATE pa_forecast_item_details A
      SET    util_summarized_code = 'S'
      WHERE  util_summarized_code = 'N'
      AND    exists (   SELECT row_id
                        FROM   pa_rep_util_summ0_tmp B
			WHERE  A.ROWID = B.ROW_ID  -- bug 3132246
                      )
      RETURNING ROWID BULK COLLECT INTO l_fid_rowid_tab;
Line: 281

      l_records_updated := SQL%ROWCOUNT;
Line: 283

      PA_DEBUG.G_Err_Stage := '800 : Records Updated in PA_FORECAST_ITEMS_DETAILS : '|| l_records_updated;
Line: 300

      IF (l_records_updated < l_records_inserted AND l_fid_rowid_tab.COUNT > 0) THEN /* added second condition 2084888 */
        l_process_method := 'F';
Line: 303

          UPDATE pa_rep_util_summ0_tmp tmp
          SET    tmp.delete_flag = 'N'
          WHERE  tmp.row_id = l_fid_rowid_tab(i);
Line: 309

      l_fid_rowid_tab.DELETE;
Line: 349

        PA_DEBUG.G_Err_Stage := '1000 : Records Deleted from PA_FORECAST_ITEM_DETAILS: ' || to_char(SQL%ROWCOUNT);
Line: 359

        UPDATE pa_forecast_item_details
        SET    util_summarized_code = NULL
              ,last_update_date  = l_last_update_date
              ,last_updated_by   = l_last_updated_by
              ,request_id       = l_request_id
              ,program_application_id = l_program_application_id
              ,program_id = l_program_id
              ,program_update_date = l_program_update_date
        WHERE  util_summarized_code = 'S' -- Do we require this?
        AND    ROWID IN (SELECT  row_id
                         FROM    pa_rep_util_summ0_tmp
                         WHERE   delete_flag = 'N'
                        );
Line: 373

        PA_DEBUG.G_Err_Stage := '1100 : Records Updated in PA_FORECAST_ITEM_DETAILS: ' || to_char(SQL%ROWCOUNT);
Line: 381

		** The delete statement for pa_forecast_items is removed.
	    */
        --
      ELSIF l_process_method = 'A' THEN
        IF P_DEBUG_MODE = 'Y' THEN /* Added Debug Profile Option Check for bug#2674619 */
	/* Commented for Bug 2984871
        PA_DEBUG.G_Err_Stage := '1300 : Records Deleted from PA_FORECAST_ITEM_DETAILS: ' || to_char(SQL%ROWCOUNT);
Line: 398

        UPDATE pa_forecast_item_details
        SET    util_summarized_code = NULL
              ,last_update_date = l_last_update_date
              ,last_updated_by  = l_last_updated_by
              ,request_id       = l_request_id
              ,program_application_id = l_program_application_id
              ,program_id = l_program_id
              ,program_update_date = l_program_update_date
        WHERE  util_summarized_code = 'S' -- Do we require this?
        AND    ROWID IN (SELECT  row_id
                         FROM    pa_rep_util_summ0_tmp
                        );
Line: 411

        PA_DEBUG.G_Err_Stage := '1400 : Records Updated in PA_FORECAST_ITEM_DETAILS: ' || to_char(SQL%ROWCOUNT);
Line: 419

        ** The delete statement for pa_forecast_items is removed.
        */
        --
      END IF;
Line: 424

 delete from pa_rep_util_summ00_tmp
 where row_id in (select row_id from pa_rep_util_summ0_tmp)
 ;
Line: 446

     * Put the code for update outside of the if loop so that the thru date
     *  is updated with the end date of the current run (it would no longer
     *  reflect the furthest out date till which summarization was ever run,
     *  as was the case earlier)
     * IF NVL(l_forecast_thru_date, l_fc_end_date -1) < l_fc_end_date  THEN
     * code for update
     * END IF;
Line: 454

    UPDATE pa_utilization_options_all
    SET    forecast_thru_date = l_fc_end_date
           , forecast_last_run_date = sysdate
    WHERE  NVL(org_id, -99) = l_org_id;
Line: 460

	 * The delete logic is modified to delete all the forecast items
	 * which are processed (util_summarized_code is null).
	 */
    /*
    ** Bug 2263074
    ** The delete statement for pa_forecast_item_details is removed.
    */

    COMMIT;
Line: 492

PROCEDURE Insert_Fcst_Into_Tmp_PA
IS
 BEGIN
   -- Set the error stack
   PA_DEBUG.Set_Curr_Function( p_function   => 'Insert_Fcst_Into_Tmp_PA');
Line: 498

   PA_DEBUG.G_Err_Stage := '2000 : Before Inserting Forecast data into PA_REP_UTIL_SUMM0_TMP for PA';
Line: 500

   INSERT INTO pa_rep_util_summ00_tmp
   ( row_id
    ,parent_row_id
    ,expenditure_organization_id
    ,person_id
    ,assignment_id
    ,work_type_id
    ,org_util_category_id
    ,res_util_category_id
    ,expenditure_type
    ,expenditure_type_class
    ,pa_period_name
    ,pa_period_num
    ,pa_period_year
    ,pa_quarter_number
    ,gl_period_name
    ,gl_period_num
    ,gl_period_year
    ,gl_quarter_number
    ,global_exp_period_end_date
    ,global_exp_year
    ,global_exp_month_number
    ,total_hours
    ,total_prov_hours
    ,total_wghted_hours_people
    ,total_wghted_hours_org
    ,prov_wghted_hours_people
    ,prov_wghted_hours_org
    ,reduce_capacity
    ,delete_flag
    )
   SELECT fid.rowid   row_id
         ,fi.rowid    parent_row_id
         ,fi.expenditure_organization_id
         ,fi.person_id
         ,fi.assignment_id
         ,fid.work_type_id
         ,fid.org_util_category_id
         ,fid.resource_util_category_id
         ,fi.expenditure_type
         ,fi.expenditure_type_class
         ,fi.pvdr_pa_period_name                    pa_period_name
         ,(pp.period_year * 10000) + pp.period_num  pa_period_num
         ,pp.period_year                            pa_period_year
         ,pp.quarter_num                            pa_quarter_number
         ,NULL                                      gl_period_name
         ,NULL                                      gl_period_num
         ,NULL                                      gl_period_year
         ,NULL                                      gl_quarter_number
         ,NULL                                      global_exp_period_end_date
         ,NULL                                      global_exp_year
         ,NULL                                      global_exp_month_number
         ,NVL(fid.item_quantity, 0)                                                     total_hours
         ,NVL(fid.item_quantity, 0) * decode(fid.provisional_flag, 'Y', 1, 0)           total_prov_hours
         ,NVL(fid.resource_util_weighted, 0)                                            total_wghted_hours_people
         ,NVL(fid.org_util_weighted, 0)                                                 total_wghted_hours_org
         ,NVL(fid.resource_util_weighted, 0) * decode(fid.provisional_flag, 'Y', 1, 0)  prov_wghted_hours_people
         ,NVL(fid.org_util_weighted, 0) * decode(fid.provisional_flag, 'Y', 1, 0)       prov_wghted_hours_org
         ,DECODE(fid.reduce_capacity_flag, 'Y', 1, 'N', 0) * NVL(fid.item_quantity, 0)  reduce_capacity
         ,'Y'                                                                           delete_flag
   FROM  pa_forecast_items fi
        ,pa_forecast_item_details fid
        ,gl_periods pp
   WHERE fi.forecast_item_id = fid.forecast_item_id
   AND   fi.expenditure_org_id = l_org_id
   AND   fid.expenditure_org_id = l_org_id
   AND   fi.forecast_item_type IN ('A', 'U')
   AND   fid.util_summarized_code = 'N'
   --AND   fid.person_billable_flag = 'Y'
   AND   fid.amount_type_id = l_quantity_id
-- AND   pp.period_set_name = l_period_set_name
   AND   pp.period_set_name = l_pa_period_set_name  -- bug 3434019
   AND   pp.period_type = l_pa_period_type
   --AND   fi.pvdr_period_set_name = pp.period_set_name /* commented for bug 3488229 */
   AND   fi.pvdr_pa_period_name  = pp.period_name
   AND   fi.item_date BETWEEN  l_fc_start_date AND TRUNC(l_fc_end_date)+0.99999;  /* BUG# 3118592 */
Line: 580

     PA_DEBUG.G_Err_Stage := '2050 : After Inserting Forecast data into PA_REP_UTIL_SUMM0_TMP for PA';
Line: 590

 END Insert_Fcst_Into_Tmp_PA;
Line: 597

PROCEDURE Insert_Fcst_Into_Tmp_GL
IS
 BEGIN
   -- Set the error satack
   PA_DEBUG.Set_Curr_Function( p_function   => 'Insert_Fcst_Into_Tmp_GL');
Line: 603

   PA_DEBUG.G_Err_Stage := '2100 : Before Inserting Forecast data into PA_REP_UTIL_SUMM0_TMP for GL';
Line: 607

   INSERT INTO pa_rep_util_summ00_tmp
   ( row_id
    ,parent_row_id
    ,expenditure_organization_id
    ,person_id
    ,assignment_id
    ,work_type_id
    ,org_util_category_id
    ,res_util_category_id
    ,expenditure_type
    ,expenditure_type_class
    ,pa_period_name
    ,pa_period_num
    ,pa_period_year
    ,pa_quarter_number
    ,gl_period_name
    ,gl_period_num
    ,gl_period_year
    ,gl_quarter_number
    ,global_exp_period_end_date
    ,global_exp_year
    ,global_exp_month_number
    ,total_hours
    ,total_prov_hours
    ,total_wghted_hours_people
    ,total_wghted_hours_org
    ,prov_wghted_hours_people
    ,prov_wghted_hours_org
    ,reduce_capacity
    ,delete_flag
   )
   SELECT fid.rowid   row_id
         ,fi.rowid    parent_row_id
         ,fi.expenditure_organization_id
         ,fi.person_id
         ,fi.assignment_id
         ,fid.work_type_id
         ,fid.org_util_category_id
         ,fid.resource_util_category_id
         ,fi.expenditure_type
         ,fi.expenditure_type_class
         ,NULL                                      pa_period_name
         ,NULL                                      pa_period_num
         ,NULL                                      pa_period_year
         ,NULL                                      pa_quarter_number
         ,fi.pvdr_gl_period_name                    gl_period_name
         ,(gp.period_year * 10000) + gp.period_num  gl_period_num
         ,gp.period_year                            gl_period_year
         ,gp.quarter_num                            gl_quarter_number
         ,NULL                                      global_exp_period_end_date
         ,NULL                                      global_exp_year
         ,NULL                                      global_exp_month_number
         ,NVL(fid.item_quantity, 0)                                                     total_hours
         ,NVL(fid.item_quantity, 0) * decode(fid.provisional_flag, 'Y', 1, 0)           total_prov_hours
         ,NVL(fid.resource_util_weighted, 0)                                            total_wghted_hours_people
         ,NVL(fid.org_util_weighted, 0)                                                 total_wghted_hours_org
         ,NVL(fid.resource_util_weighted, 0) * decode(fid.provisional_flag, 'Y', 1, 0)  prov_wghted_hours_people
         ,NVL(fid.org_util_weighted, 0) * decode(fid.provisional_flag, 'Y', 1, 0)       prov_wghted_hours_org
         ,DECODE(fid.reduce_capacity_flag, 'Y', 1, 'N', 0) * NVL(fid.item_quantity, 0)  reduce_capacity
         ,'Y'                                                                           delete_flag
    FROM  pa_forecast_items fi
         ,pa_forecast_item_details fid
         ,gl_periods gp
   WHERE fi.forecast_item_id = fid.forecast_item_id
   AND   fi.expenditure_org_id = l_org_id
   AND   fid.expenditure_org_id = l_org_id
   AND   fi.forecast_item_type IN ('A', 'U')
   AND   fid.util_summarized_code = 'N'
   --AND   fid.person_billable_flag = 'Y'
   AND   fid.amount_type_id = l_quantity_id
-- AND   gp.period_set_name = l_period_set_name
   AND   gp.period_set_name = l_gl_period_set_name  -- bug 3322360
   AND   gp.period_type = l_gl_period_type
 --AND   fi.pvdr_period_set_name = gp.period_set_name /* commented for bug 3488229 */
   AND   fi.pvdr_gl_period_name  = gp.period_name
     AND   fi.item_date BETWEEN  l_fc_start_date AND TRUNC(l_fc_end_date)+0.99999 ; /* BUG# 3118592 */
Line: 686

   PA_DEBUG.G_Err_Stage := '2150 : After Inserting Forecast data into PA_REP_UTIL_SUMM0_TMP for GL';
Line: 696

 END Insert_Fcst_Into_Tmp_GL;
Line: 703

PROCEDURE Insert_Fcst_Into_Tmp_GE
IS
 BEGIN
   -- Set the error satack
   PA_DEBUG.Set_Curr_Function( p_function   => 'Insert_Fcst_Into_Tmp_GE');
Line: 710

   PA_DEBUG.G_Err_Stage := '2200 : Before Inserting Forecast data into PA_REP_UTIL_SUMM0_TMP for GE';
Line: 714

   INSERT INTO pa_rep_util_summ00_tmp
   ( row_id
    ,parent_row_id
    ,expenditure_organization_id
    ,person_id
    ,assignment_id
    ,work_type_id
    ,org_util_category_id
    ,res_util_category_id
    ,expenditure_type
    ,expenditure_type_class
    ,pa_period_name
    ,pa_period_num
    ,pa_period_year
    ,pa_quarter_number
    ,gl_period_name
    ,gl_period_num
    ,gl_period_year
    ,gl_quarter_number
    ,global_exp_period_end_date
    ,global_exp_year
    ,global_exp_month_number
    ,total_hours
    ,total_prov_hours
    ,total_wghted_hours_people
    ,total_wghted_hours_org
    ,prov_wghted_hours_people
    ,prov_wghted_hours_org
    ,reduce_capacity
    ,delete_flag
   )
   SELECT fid.rowid   row_id
         ,fi.rowid    parent_row_id
         ,fi.expenditure_organization_id
         ,fi.person_id
         ,fi.assignment_id
         ,fid.work_type_id
         ,fid.org_util_category_id
         ,fid.resource_util_category_id
         ,fi.expenditure_type
         ,fi.expenditure_type_class
         ,NULL                    pa_period_name
         ,NULL                    pa_period_num
         ,NULL                    pa_period_year
         ,NULL                    pa_quarter_number
         ,NULL                    gl_period_name
         ,NULL                    gl_period_num
         ,NULL                    gl_period_year
         ,NULL                    gl_quarter_number
         ,trunc(fi.global_exp_period_end_date)                        global_exp_period_end_date
         ,to_number(to_char(fi.global_exp_period_end_date, 'YYYY'))   global_exp_year
         ,to_number(to_char(fi.global_exp_period_end_date, 'MM'))     global_exp_month_number
         ,NVL(fid.item_quantity, 0)                                                     total_hours
         ,NVL(fid.item_quantity, 0) * decode(fid.provisional_flag, 'Y', 1, 0)           total_prov_hours
         ,NVL(fid.resource_util_weighted, 0)                                            total_wghted_hours_people
         ,NVL(fid.org_util_weighted, 0)                                                 total_wghted_hours_org
         ,NVL(fid.resource_util_weighted, 0) * decode(fid.provisional_flag, 'Y', 1, 0)  prov_wghted_hours_people
         ,NVL(fid.org_util_weighted, 0) * decode(fid.provisional_flag, 'Y', 1, 0)       prov_wghted_hours_org
         ,DECODE(fid.reduce_capacity_flag, 'Y', 1, 'N', 0) * NVL(fid.item_quantity, 0)  reduce_capacity
         ,'Y'                                                                           delete_flag
    FROM  pa_forecast_items fi
         ,pa_forecast_item_details fid
   WHERE fi.forecast_item_id = fid.forecast_item_id
   AND   fi.expenditure_org_id = l_org_id
   AND   fid.expenditure_org_id = l_org_id
   AND   fi.forecast_item_type IN ('A', 'U')
   AND   fid.util_summarized_code = 'N'
   --AND   fid.person_billable_flag = 'Y'
   AND   fid.amount_type_id = l_quantity_id
   AND   fi.item_date BETWEEN  l_fc_start_date AND TRUNC(l_fc_end_date)+0.99999;   /* BUG# 3118592 */
Line: 786

   PA_DEBUG.G_Err_Stage := '2250 : After Inserting Forecast data into PA_REP_UTIL_SUMM0_TMP for GE';
Line: 796

 END Insert_Fcst_Into_Tmp_GE;
Line: 803

PROCEDURE Insert_Fcst_Into_Tmp_PAGL
IS
 BEGIN
   -- Set the error satack
   PA_DEBUG.Set_Curr_Function( p_function   => 'Insert_Fcst_Into_Tmp_PAGL');
Line: 810

   PA_DEBUG.G_Err_Stage := '2300 : Before Inserting Forecast data into PA_REP_UTIL_SUMM0_TMP for PA and GL';
Line: 814

   INSERT INTO pa_rep_util_summ00_tmp
   ( row_id
    ,parent_row_id
    ,expenditure_organization_id
    ,person_id
    ,assignment_id
    ,work_type_id
    ,org_util_category_id
    ,res_util_category_id
    ,expenditure_type
    ,expenditure_type_class
    ,pa_period_name
    ,pa_period_num
    ,pa_period_year
    ,pa_quarter_number
    ,gl_period_name
    ,gl_period_num
    ,gl_period_year
    ,gl_quarter_number
    ,global_exp_period_end_date
    ,global_exp_year
    ,global_exp_month_number
    ,total_hours
    ,total_prov_hours
    ,total_wghted_hours_people
    ,total_wghted_hours_org
    ,prov_wghted_hours_people
    ,prov_wghted_hours_org
    ,reduce_capacity
    ,delete_flag
    )
   SELECT fid.rowid   row_id
         ,fi.rowid    parent_row_id
         ,fi.expenditure_organization_id
         ,fi.person_id
         ,fi.assignment_id
         ,fid.work_type_id
         ,fid.org_util_category_id
         ,fid.resource_util_category_id
         ,fi.expenditure_type
         ,fi.expenditure_type_class
         ,fi.pvdr_pa_period_name                    pa_period_name
         ,(pp.period_year * 10000) + pp.period_num  pa_period_num
         ,pp.period_year                            pa_period_year
         ,pp.quarter_num                            pa_quarter_number
         ,fi.pvdr_gl_period_name                    gl_period_name
         ,(gp.period_year * 10000) + gp.period_num  gl_period_num
         ,gp.period_year                            gl_period_year
         ,gp.quarter_num                            gl_quarter_number
         ,NULL                                      global_exp_period_end_date
         ,NULL                                      global_exp_year
         ,NULL                                      global_exp_month_number
         ,NVL(fid.item_quantity, 0)                                                     total_hours
         ,NVL(fid.item_quantity, 0) * decode(fid.provisional_flag, 'Y', 1, 0)           total_prov_hours
         ,NVL(fid.resource_util_weighted, 0)                                            total_wghted_hours_people
         ,NVL(fid.org_util_weighted, 0)                                                 total_wghted_hours_org
         ,NVL(fid.resource_util_weighted, 0) * decode(fid.provisional_flag, 'Y', 1, 0)  prov_wghted_hours_people
         ,NVL(fid.org_util_weighted, 0) * decode(fid.provisional_flag, 'Y', 1, 0)       prov_wghted_hours_org
         ,DECODE(fid.reduce_capacity_flag, 'Y', 1, 'N', 0) * NVL(fid.item_quantity, 0)  reduce_capacity
         ,'Y'                                                                           delete_flag
   FROM  pa_forecast_items fi
        ,pa_forecast_item_details fid
        ,gl_periods pp
        ,gl_periods gp
   WHERE fi.forecast_item_id = fid.forecast_item_id
   AND   fi.expenditure_org_id = l_org_id
   AND   fid.expenditure_org_id = l_org_id
   AND   fi.forecast_item_type IN ('A', 'U')
   AND   fid.util_summarized_code = 'N'
   --AND   fid.person_billable_flag = 'Y'
   AND   fid.amount_type_id = l_quantity_id
-- AND   pp.period_set_name = l_period_set_name
   AND   pp.period_set_name = l_pa_period_set_name  -- bug 3434019
   AND   pp.period_type = l_pa_period_type
 --AND   fi.pvdr_period_set_name = pp.period_set_name /* commented for bug 3488229 */
   AND   fi.pvdr_pa_period_name  = pp.period_name
-- AND   gp.period_set_name = l_period_set_name
   AND   gp.period_set_name = l_gl_period_set_name  -- bug 3434019
   AND   gp.period_type = l_gl_period_type
 --AND   fi.pvdr_period_set_name = gp.period_set_name /* commented for bug 3488229 */
   AND   fi.pvdr_gl_period_name  = gp.period_name
   AND   fi.item_date BETWEEN  l_fc_start_date AND TRUNC(l_fc_end_date)+0.99999 ;  /* BUG# 3118592 */
Line: 897

   PA_DEBUG.G_Err_Stage := '2350 : After Inserting Forecast data into PA_REP_UTIL_SUMM0_TMP for PA and GL';
Line: 907

 END Insert_Fcst_Into_Tmp_PAGL;
Line: 914

PROCEDURE Insert_Fcst_Into_Tmp_PAGE
IS
 BEGIN
   -- Set the error satack
   PA_DEBUG.Set_Curr_Function( p_function   => 'Insert_Fcst_Into_Tmp_PAGE');
Line: 921

   PA_DEBUG.G_Err_Stage := '2400 : Before Inserting Forecast data into PA_REP_UTIL_SUMM0_TMP for PA and GE';
Line: 925

   INSERT INTO pa_rep_util_summ00_tmp
   ( row_id
    ,parent_row_id
    ,expenditure_organization_id
    ,person_id
    ,assignment_id
    ,work_type_id
    ,org_util_category_id
    ,res_util_category_id
    ,expenditure_type
    ,expenditure_type_class
    ,pa_period_name
    ,pa_period_num
    ,pa_period_year
    ,pa_quarter_number
    ,gl_period_name
    ,gl_period_num
    ,gl_period_year
    ,gl_quarter_number
    ,global_exp_period_end_date
    ,global_exp_year
    ,global_exp_month_number
    ,total_hours
    ,total_prov_hours
    ,total_wghted_hours_people
    ,total_wghted_hours_org
    ,prov_wghted_hours_people
    ,prov_wghted_hours_org
    ,reduce_capacity
    ,delete_flag
    )
   SELECT fid.rowid   row_id
         ,fi.rowid    parent_row_id
         ,fi.expenditure_organization_id
         ,fi.person_id
         ,fi.assignment_id
         ,fid.work_type_id
         ,fid.org_util_category_id
         ,fid.resource_util_category_id
         ,fi.expenditure_type
         ,fi.expenditure_type_class
         ,fi.pvdr_pa_period_name                    pa_period_name
         ,(pp.period_year * 10000) + pp.period_num  pa_period_num
         ,pp.period_year                            pa_period_year
         ,pp.quarter_num                            pa_quarter_number
         ,NULL                                      gl_period_name
         ,NULL                                      gl_period_num
         ,NULL                                      gl_period_year
         ,NULL                                      gl_quarter_number
         ,trunc(fi.global_exp_period_end_date)                        global_exp_period_end_date
         ,to_number(to_char(fi.global_exp_period_end_date, 'YYYY'))   global_exp_year
         ,to_number(to_char(fi.global_exp_period_end_date, 'MM'))     global_exp_month_number
         ,NVL(fid.item_quantity, 0)                                                     total_hours
         ,NVL(fid.item_quantity, 0) * decode(fid.provisional_flag, 'Y', 1, 0)           total_prov_hours
         ,NVL(fid.resource_util_weighted, 0)                                            total_wghted_hours_people
         ,NVL(fid.org_util_weighted, 0)                                                 total_wghted_hours_org
         ,NVL(fid.resource_util_weighted, 0) * decode(fid.provisional_flag, 'Y', 1, 0)  prov_wghted_hours_people
         ,NVL(fid.org_util_weighted, 0) * decode(fid.provisional_flag, 'Y', 1, 0)       prov_wghted_hours_org
         ,DECODE(fid.reduce_capacity_flag, 'Y', 1, 'N', 0) * NVL(fid.item_quantity, 0)  reduce_capacity
         ,'Y'                                                                           delete_flag
   FROM  pa_forecast_items fi
        ,pa_forecast_item_details fid
        ,gl_periods pp
   WHERE fi.forecast_item_id = fid.forecast_item_id
   AND   fi.expenditure_org_id = l_org_id
   AND   fid.expenditure_org_id = l_org_id
   AND   fi.forecast_item_type IN ('A', 'U')
   AND   fid.util_summarized_code = 'N'
   --AND   fid.person_billable_flag = 'Y'
   AND   fid.amount_type_id = l_quantity_id
--   AND   pp.period_set_name = l_period_set_name
   AND   pp.period_set_name = l_pa_period_set_name  -- bug 3434019
   AND   pp.period_type = l_pa_period_type
  --AND   fi.pvdr_period_set_name = pp.period_set_name /* commented for bug 3488229 */
   AND   fi.pvdr_pa_period_name  = pp.period_name
   AND   fi.item_date BETWEEN  l_fc_start_date AND TRUNC(l_fc_end_date)+0.99999   ; /* BUG# 3118592 */
Line: 1002

   PA_DEBUG.G_Err_Stage := '2450 : After Inserting Forecast data into PA_REP_UTIL_SUMM0_TMP for PA and GE';
Line: 1012

 END Insert_Fcst_Into_Tmp_PAGE;
Line: 1019

PROCEDURE Insert_Fcst_Into_Tmp_GLGE
IS
 BEGIN
   -- Set the error satack
   PA_DEBUG.Set_Curr_Function( p_function   => 'Insert_Fcst_Into_Tmp_GLGE');
Line: 1026

   PA_DEBUG.G_Err_Stage := '2500 : Before Inserting Forecast data into PA_REP_UTIL_SUMM0_TMP for GL and GE';
Line: 1030

   INSERT INTO pa_rep_util_summ00_tmp
   ( row_id
    ,parent_row_id
    ,expenditure_organization_id
    ,person_id
    ,assignment_id
    ,work_type_id
    ,org_util_category_id
    ,res_util_category_id
    ,expenditure_type
    ,expenditure_type_class
    ,pa_period_name
    ,pa_period_num
    ,pa_period_year
    ,pa_quarter_number
    ,gl_period_name
    ,gl_period_num
    ,gl_period_year
    ,gl_quarter_number
    ,global_exp_period_end_date
    ,global_exp_year
    ,global_exp_month_number
    ,total_hours
    ,total_prov_hours
    ,total_wghted_hours_people
    ,total_wghted_hours_org
    ,prov_wghted_hours_people
    ,prov_wghted_hours_org
    ,reduce_capacity
    ,delete_flag
    )
   SELECT fid.rowid   row_id
         ,fi.rowid    parent_row_id
         ,fi.expenditure_organization_id
         ,fi.person_id
         ,fi.assignment_id
         ,fid.work_type_id
         ,fid.org_util_category_id
         ,fid.resource_util_category_id
         ,fi.expenditure_type
         ,fi.expenditure_type_class
         ,NULL                                      pa_period_name
         ,NULL                                      pa_period_num
         ,NULL                                      pa_period_year
         ,NULL                                      pa_quarter_number
         ,fi.pvdr_gl_period_name                    gl_period_name
         ,(gp.period_year * 10000) + gp.period_num  gl_period_num
         ,gp.period_year                            gl_period_year
         ,gp.quarter_num                            gl_quarter_number
         ,trunc(fi.global_exp_period_end_date)                        global_exp_period_end_date
         ,to_number(to_char(fi.global_exp_period_end_date, 'YYYY'))   global_exp_year
         ,to_number(to_char(fi.global_exp_period_end_date, 'MM'))     global_exp_month_number
         ,NVL(fid.item_quantity, 0)                                                     total_hours
         ,NVL(fid.item_quantity, 0) * decode(fid.provisional_flag, 'Y', 1, 0)           total_prov_hours
         ,NVL(fid.resource_util_weighted, 0)                                            total_wghted_hours_people
         ,NVL(fid.org_util_weighted, 0)                                                 total_wghted_hours_org
         ,NVL(fid.resource_util_weighted, 0) * decode(fid.provisional_flag, 'Y', 1, 0)  prov_wghted_hours_people
         ,NVL(fid.org_util_weighted, 0) * decode(fid.provisional_flag, 'Y', 1, 0)       prov_wghted_hours_org
         ,DECODE(fid.reduce_capacity_flag, 'Y', 1, 'N', 0) * NVL(fid.item_quantity, 0)  reduce_capacity
         ,'Y'                                                                           delete_flag
   FROM  pa_forecast_items fi
        ,pa_forecast_item_details fid
        ,gl_periods gp
   WHERE fi.forecast_item_id = fid.forecast_item_id
   AND   fi.expenditure_org_id = l_org_id
   AND   fid.expenditure_org_id = l_org_id
   AND   fi.forecast_item_type IN ('A', 'U')
   AND   fid.util_summarized_code = 'N'
   --AND   fid.person_billable_flag = 'Y'
   AND   fid.amount_type_id = l_quantity_id
-- AND   gp.period_set_name = l_period_set_name
   AND   gp.period_set_name = l_gl_period_set_name  -- bug 3434019
   AND   gp.period_type = l_gl_period_type
  --AND   fi.pvdr_period_set_name = gp.period_set_name /* commented for bug 3488229 */
   AND   fi.pvdr_gl_period_name  = gp.period_name
  AND   fi.item_date BETWEEN  l_fc_start_date AND TRUNC(l_fc_end_date)+0.99999; /* BUG# 3118592 */
Line: 1107

   PA_DEBUG.G_Err_Stage := '2550 : After Inserting Forecast data into PA_REP_UTIL_SUMM0_TMP for GL and GE';
Line: 1117

 END Insert_Fcst_Into_Tmp_GLGE;
Line: 1124

PROCEDURE Insert_Fcst_Into_Tmp_PAGLGE
IS
 BEGIN
   -- Set the error satack
   PA_DEBUG.Set_Curr_Function( p_function   => 'Insert_Fcst_Into_Tmp_PAGLGE');
Line: 1130

   PA_DEBUG.G_Err_Stage := '2600 : Before Inserting Forecast data into PA_REP_UTIL_SUMM0_TMP for PA, GL and GE';
Line: 1134

   INSERT INTO pa_rep_util_summ00_tmp
   ( row_id
    ,parent_row_id
    ,expenditure_organization_id
    ,person_id
    ,assignment_id
    ,work_type_id
    ,org_util_category_id
    ,res_util_category_id
    ,expenditure_type
    ,expenditure_type_class
    ,pa_period_name
    ,pa_period_num
    ,pa_period_year
    ,pa_quarter_number
    ,gl_period_name
    ,gl_period_num
    ,gl_period_year
    ,gl_quarter_number
    ,global_exp_period_end_date
    ,global_exp_year
    ,global_exp_month_number
    ,total_hours
    ,total_prov_hours
    ,total_wghted_hours_people
    ,total_wghted_hours_org
    ,prov_wghted_hours_people
    ,prov_wghted_hours_org
    ,reduce_capacity
    ,delete_flag
    )
   SELECT fid.rowid   row_id
         ,fi.rowid    parent_row_id
         ,fi.expenditure_organization_id
         ,fi.person_id
         ,fi.assignment_id
         ,fid.work_type_id
         ,fid.org_util_category_id
         ,fid.resource_util_category_id
         ,fi.expenditure_type
         ,fi.expenditure_type_class
         ,fi.pvdr_pa_period_name                    pa_period_name
         ,(pp.period_year * 10000) + pp.period_num  pa_period_num
         ,pp.period_year                            pa_period_year
         ,pp.quarter_num                            pa_quarter_number
         ,fi.pvdr_gl_period_name                    gl_period_name
         ,(gp.period_year * 10000) + gp.period_num  gl_period_num
         ,gp.period_year                            gl_period_year
         ,gp.quarter_num                            gl_quarter_number
         ,trunc(fi.global_exp_period_end_date)                        global_exp_period_end_date
         ,to_number(to_char(fi.global_exp_period_end_date, 'YYYY'))   global_exp_year
         ,to_number(to_char(fi.global_exp_period_end_date, 'MM'))     global_exp_month_number
         ,NVL(fid.item_quantity, 0)                                                     total_hours
         ,NVL(fid.item_quantity, 0) * decode(fid.provisional_flag, 'Y', 1, 0)           total_prov_hours
         ,NVL(fid.resource_util_weighted, 0)                                            total_wghted_hours_people
         ,NVL(fid.org_util_weighted, 0)                                                 total_wghted_hours_org
         ,NVL(fid.resource_util_weighted, 0) * decode(fid.provisional_flag, 'Y', 1, 0)  prov_wghted_hours_people
         ,NVL(fid.org_util_weighted, 0) * decode(fid.provisional_flag, 'Y', 1, 0)       prov_wghted_hours_org
         ,DECODE(fid.reduce_capacity_flag, 'Y', 1, 'N', 0) * NVL(fid.item_quantity, 0)  reduce_capacity
         ,'Y'                                                                           delete_flag
   FROM  pa_forecast_items fi
        ,pa_forecast_item_details fid
        ,gl_periods pp
        ,gl_periods gp
   WHERE fi.forecast_item_id = fid.forecast_item_id
   AND   fi.expenditure_org_id = l_org_id
   AND   fid.expenditure_org_id = l_org_id
   AND   fi.forecast_item_type IN ('A', 'U')
   AND   fid.util_summarized_code = 'N'
   --AND   fid.person_billable_flag = 'Y'
   AND   fid.amount_type_id = l_quantity_id
-- AND   pp.period_set_name = l_period_set_name
   AND   pp.period_set_name = l_pa_period_set_name  -- bug 3434019
   AND   pp.period_type = l_pa_period_type
 --AND   fi.pvdr_period_set_name = pp.period_set_name /* commented for bug 3488229 */
   AND   fi.pvdr_pa_period_name  = pp.period_name
-- AND   gp.period_set_name = l_period_set_name
   AND   gp.period_set_name = l_gl_period_set_name  -- bug 3434019
   AND   gp.period_type = l_gl_period_type
  --AND   fi.pvdr_period_set_name = gp.period_set_name /* commented for bug 3488229 */
   AND   fi.pvdr_gl_period_name  = gp.period_name
   AND   fi.item_date BETWEEN  l_fc_start_date AND TRUNC(l_fc_end_date)+0.99999 ; /* BUG# 3118592 */
Line: 1218

   PA_DEBUG.G_Err_Stage := '2650 : After Inserting Forecast data into PA_REP_UTIL_SUMM0_TMP for PA, GL and GE';
Line: 1228

 END Insert_Fcst_Into_Tmp_PAGLGE;