--
-- $Id$
--
-- Vervangers uit acceptatie overnemen naar productie

DEFINE thisfile = 'HSLE#53040.SQL'
DEFINE dbuser   = '^HSLE'

SET ECHO ON
SET DEFINE ON
COLUMN fcltlogfile NEW_VALUE fcltlogfile NOPRINT;
WHENEVER SQLERROR EXIT;

SELECT adm.scriptspoolfile ('&dbuser', '&thisfile') AS fcltlogfile FROM DUAL;

WHENEVER SQLERROR CONTINUE;
SPOOL &fcltlogfile
SET DEFINE OFF

------ payload begin ------

UPDATE res_rsv_artikel
   SET RES_RSV_ARTIKEL_PRIJS = RES_RSV_ARTIKEL_PRIJS  /1.06 *1.09
 WHERE res_rsv_artikel_key IN
           (SELECT resa.res_rsv_artikel_key
                FROM RES_RSV_ARTIKEL resa, RES_ARTIKEL art
 WHERE     resa.RES_ARTIKEL_KEY = art.RES_ARTIKEL_KEY
       AND resa.res_rsv_artikel_levering > to_date('01-01-2019', 'DD-MM-YYYY')
       AND resa.res_rsv_artikel_aanmaak <  to_date('15-JAN-2019', 'DD-MM-YYYY')
       AND art.res_discipline_key != '1021'
       AND art.res_discipline_key != '283'
       AND resa.RES_RSV_ARTIKEL_AFGEMELD IS NULL
       AND resa.RES_RSV_ARTIKEL_VERWIJDER IS NULL);
       



------ payload end   ------

SET DEFINE OFF

 BEGIN
   adm.systrackscriptId (
      '$Id$',
      1);
END;
/

COMMIT;
SET ECHO OFF
SPOOL OFF
SET DEFINE ON
PROMPT Logfile of this upgrade is: &fcltlogfile