/* $Id$ */
/*============================================================================*
 |                 Copyright (c) 2016 Applaud Solutions UK Ltd                |
 |                             All rights reserved                            |
 *===========================================================================*/

SET VERIFY OFF
SET FEEDBACK OFF
WHENEVER OSERROR  EXIT FAILURE ROLLBACK
WHENEVER SQLERROR EXIT FAILURE ROLLBACK

CREATE OR REPLACE FORCE VIEW XXAS_PERF_REVIEW_STEPS_V
AS
SELECT
   xprs.perf_review_step_id
  ,xprs.perf_review_form_id
  ,xprs.perf_review_templ_step_id
  ,xprf.start_date + nvl(xprts.step_duration_days,0) due_date
  ,xprs.status_code
  ,xxas_util_pkg.decode_lookup('XXAS_PERF_REVIEW_STEP_STATUSES', xprs.status_code) status_meaning
  ,xprs.created_by
  ,xprs.creation_date
  ,xprs.last_update_date
  ,xprs.last_updated_by
  ,xprs.last_update_login
  FROM xxas_perf_review_forms xprf
      ,xxas_perf_review_steps xprs
      ,xxas_perf_review_templ_steps xprts
  WHERE xprs.perf_review_form_id        = xprf.perf_review_form_id
    AND xprs.perf_review_templ_step_id  = xprts.perf_review_templ_step_id;
            
BEGIN
  xxas_fnd_dictionary_pkg.add_view
   (p_application_short_name => xxas_util_pkg.app
   ,p_view_name              => 'XXAS_PERF_REVIEW_STEPS_V'
   ,p_description            => 'Applaud Performance Review Steps');
END;     
/       

COMMIT;
EXIT;

