--
-- $Id$
--
-- <<bgt_budget_isreserve zetten voor reserve uit geimporteerde subprojecten EPO>>

DEFINE thisfile = 'TWYN#53817.SQL'
DEFINE dbuser   = '^TWYN'

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 bgt_budgetmutatie
   SET bgt_budgetmutatie_omschrijving = 'MW ' || bgt_budgetmutatie_omschrijving
 WHERE (  bgt_budget_key_naar IN (SELECT bgt_budget_key FROM bgt_budget WHERE ins_discipline_key = 321)
       or bgt_budget_key_van  IN (SELECT bgt_budget_key FROM bgt_budget WHERE ins_discipline_key = 321)
       )
   AND bgt_budgetmutatie_code IS NOT NULL
   AND bgt_budgetmutatie_code = 'M';


UPDATE bgt_budgetmutatie
   SET bgt_budgetmutatie_omschrijving = 'AO ' || bgt_budgetmutatie_omschrijving
 WHERE (  bgt_budget_key_naar IN (SELECT bgt_budget_key FROM bgt_budget WHERE ins_discipline_key = 321)
       or bgt_budget_key_van  IN (SELECT bgt_budget_key FROM bgt_budget WHERE ins_discipline_key = 321)
       )
   AND bgt_budgetmutatie_code IS NOT NULL
   AND bgt_budgetmutatie_code = 'R';

------ 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
