--
-- $Id$
--
-- Customer specific once-script VLKC#53893.SQL.

DEFINE thisfile = 'VLKC#55659.SQL'
DEFINE dbuser   = '^VLKC'

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 fin_factuur f
   SET f.fin_factuur_statuses_key = 7                                    -- AV
 WHERE f.cnt_contract_key IS NOT NULL                   -- Factuur op contract
       AND f.fin_factuur_statuses_key = 6                           -- Akkoord
       AND fac.gettrackingdate ('FINFOK', f.fin_factuur_key) < TO_DATE ('01012019', 'ddmmyyyy');

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