-- Customer specific once-script BLCC14.
--
-- (c) 2016 Facilitor B.V.
--
-- Support: +31 53 4800700
SET ECHO ON
SPOOL xBLCC14.lst
SET DEFINE OFF

-- BLCC#38235: Import vanuit Strukton
CREATE TABLE blcc_imp_opdrstat_strukton
(
   mld_opdr_key    NUMBER (10),
   extern_nummer   VARCHAR2 (100),
   status          NUMBER (10),
   datumtijd       DATE,
   opmerking       VARCHAR2 (1000),
   totaal          NUMBER (8, 2)
);

COMMIT;

INSERT INTO prs_perslid (prs_perslid_key,
                         prs_perslid_module,
                         prs_srtperslid_key,
                         prs_afdeling_key,
                         prs_perslid_naam,
                         prs_perslid_voornaam,
                         prs_perslid_nr,
                         prs_perslid_oslogin,
                         prs_perslid_dienstverband)
   SELECT 5,
          prs_perslid_module,
          prs_srtperslid_key,
          prs_afdeling_key,
          'Pseudo-user tbv. Strukton-koppeling',
          '-',
          'NIET VERWIJDEREN',
          '_STRUKTON',
          prs_perslid_dienstverband
     FROM prs_perslid
    WHERE prs_perslid_oslogin = '_FACILITOR';

COMMIT;

INSERT INTO fac_import_app (fac_import_app_code,
                            fac_import_app_oms,
                            fac_import_app_xsl,
                            fac_functie_key,
                            fac_import_app_folder,
                            fac_import_app_files,
                            fac_import_app_prefix)
    VALUES ('OPDRSTAT_STRUKTON',
            'Importeren opdrachtstatus vanuit Strukton',
            'import/strukton.xsl',
            92, -- PRSSYS
            'D:\Apps\Facilitor\Fplace5i\CUST\BLCC\import',
            'strukton*.xml',
            'BLCC');

/* Handmatige inrichting in overleg met Brightlands/Strukton!
INSERT INTO prs_bedrijfadres (prs_bedrijf_key,
                              prs_bedrijfadres_type,
                              mld_typeopdr_key,
                              prs_bedrijfadres_url,
                              prs_bedrijfadres_ordermode,
                              prs_bedrijfadres_certificate,
                              prs_bedrijfadres_xsl,
                              prs_bedrijfadres_username,
                              prs_bedrijfadres_password)
   SELECT 188,                                          -- Strukton Worksphere
          'O',
          mld_typeopdr_key,
          'https://b2bws.strukton.com/XISOAPAdapter/MessageServlet?channel=Facilitor:BS_ServiceRequest:S_WS_CREATE',
          13,
          NULL, --'LOCAL_MACHINE\My\Facilitor:Facilitor:G@s2(VoyPt',
          'xsl/strukton.xsl',
          'Facilitor',
          'G@s2(VoyPt'
     FROM mld_typeopdr
    WHERE mld_typeopdr_key IN (5, 101, 102, 103);
*/
COMMIT;
BEGIN adm.systrackscriptId('$Id$'); END;
/
SPOOL OFF
@blcc.sql
