--
-- $Id$
--
-- Script containing customer specific sql statements for the AASA database
-- Foutief ingelegde meldingen omhangen naar juiste stdmelding incl opdr en facturen

DEFINE thisfile = 'AASA#52600.SQL'
DEFINE dbuser   = '^AASA'

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

BEGIN
FAC.INITSESSION('NL');
END;
/

UPDATE mld_melding
   SET mld_stdmelding_key = 2001
 WHERE mld_melding_key IN (135315, 135317, 135318);

INSERT INTO fac_tracking (fac_tracking_datum,
                          fac_srtnotificatie_key,
                          fac_tracking_refkey,
                          fac_tracking_oms)
   SELECT SYSDATE,
          28,
          mld_melding_key,
          'Standaardmelding correctie i.v.m. foutieve kostensoort (CV CONS SERV --> CV CAT HOS) AASA#52600'
     FROM mld_melding
    WHERE mld_melding_key IN (135315, 135317, 135318);
    
------ payload end   ------

SET DEFINE OFF
BEGIN adm.systrackscriptId ('$Id$', 0); END;
/

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