From 32a725ce0db70a1bae4f0524cbcc01afca0b555b Mon Sep 17 00:00:00 2001 From: Ruud Lipper Date: Thu, 12 Jan 2017 09:37:43 +0000 Subject: [PATCH] VEBE#38713 rapport tankpassen svn path=/Customer/trunk/; revision=32328 --- VEBE/vebe.sql | 151 +++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 138 insertions(+), 13 deletions(-) diff --git a/VEBE/vebe.sql b/VEBE/vebe.sql index 119406b10..0a8f31610 100644 --- a/VEBE/vebe.sql +++ b/VEBE/vebe.sql @@ -5,9 +5,18 @@ -- -- Support: +31 53 4800710 -set echo on +DEFINE thisfile = 'VEBE.SQL' +DEFINE dbuser = '^VEBE' +DEFINE custid = 'VEBE' -spool vebe.lst +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 -- -- Personen import @@ -1312,7 +1321,127 @@ AS AND c2.cnt_prs_perslid_key = p2.prs_perslid_key(+) AND d.ins_deel_key = co2.cnt_ins_deel_key; - +-- rapportage tankpassen +CREATE OR REPLACE VIEW vebe_v_rap_tankpassen +( + ins_deel_key, + ins_deel_omschrijving, + Pincode, + Pasnummer, + ins_deel_vervaldatum, + cnt_contract_key, + cnt_contract_nummer, + cnt_contract_versie, + cnt_contract_omschrijving, + cnt_contract_opmerking, + cnt_contract_nummer_intern, + cnt_prs_perslid_key, + cnt_contractant, + cnt_eigenaar, + prs_afdeling_omschrijving, + cnt_contract_looptijd_van, + cnt_contract_looptijd_tot, + Fase, + cnt_status_txt, + ovk_aanwezig +) +AS + SELECT ins_deel_key, + ins_deel_omschrijving, + (SELECT ins_kenmerkdeel_waarde + FROM ins_kenmerkdeel + WHERE ins_kenmerk_key = 122 AND ins_deel_key = d.ins_deel_key) + Pincode, + (SELECT ins_kenmerkdeel_waarde + FROM ins_kenmerkdeel + WHERE ins_kenmerk_key = 121 AND ins_deel_key = d.ins_deel_key) + Pasnummer, + ins_deel_vervaldatum, + cnt_contract_key, + cnt_contract_nummer, + cnt_contract_versie, + cnt_contract_omschrijving, + cnt_contract_opmerking, + cnt_contract_nummer_intern, + cnt_prs_perslid_key, + cnt_contractant, + cnt_eigenaar, + prs_afdeling_omschrijving, + cnt_contract_looptijd_van, + cnt_contract_looptijd_tot, + Fase, + cnt_status_txt, + DECODE (COALESCE (cnt_contract_key, 0), 0, 'Nee', 'Ja') + ovk_aanwezig + FROM ins_deel d, + ins_srtdeel sd, + (SELECT c.cnt_contract_key, + cnt_contract_nummer, + cnt_contract_versie, + cnt_contract_omschrijving, + cnt_contract_opmerking, + cnt_contract_nummer_intern, + cnt_prs_perslid_key, + p2.prs_perslid_naam_full cnt_contractant, + prs_perslid_key_eig, + p.prs_perslid_naam_full cnt_eigenaar, + prs_afdeling_omschrijving, + cnt_contract_looptijd_van, + cnt_contract_looptijd_tot, + cnt_ins_deel_key, + DECODE ( + cnt.cnt_contract_status ( + c.cnt_contract_looptijd_van, + cnt.cnt_getrappeldatum (c.cnt_contract_key), + cnt.cnt_getopzegdatum (c.cnt_contract_key), + c.cnt_contract_looptijd_tot), + 0, + lcl.l ('lcl_cnt_future'), + 1, + lcl.l ('lcl_cnt_topical'), + 2, + lcl.l ('lcl_cnt_warn'), + 3, + lcl.l ('lcl_cnt_cancel'), + 4, + lcl.l ('lcl_cnt_past')) + fase, + DECODE ( + c.cnt_contract_status, + 0, + DECODE (fac.getsetting ('cnt_contract_approval'), + 1, lcl.l ('lcl_cnt_active_approval'), + lcl.l ('lcl_cnt_active')), + 1, + lcl.l ('lcl_cnt_inactive'), + 2, + lcl.l ('lcl_cnt_new'), + 3, + lcl.l ('lcl_cnt_forapproval')) + cnt_status_txt + FROM cnt_contract c, + cnt_contract_object co, + prs_v_perslid_fullnames p, + prs_v_perslid_fullnames p2, + prs_afdeling a + WHERE cnt_contract_verwijder IS NULL + AND c.ins_discipline_key = 22 + AND cnt_contract_verwijder IS NULL + AND c.cnt_contract_key = co.cnt_contract_key + AND prs_perslid_key_eig = p.prs_perslid_key + AND a.prs_afdeling_key = prs_afdeling_key_eig + AND c.cnt_prs_perslid_key = p2.prs_perslid_key(+) + AND COALESCE (c.cnt_contract_versie, '0') = + (SELECT COALESCE (MAX (cnt_contract_versie), '0') + FROM cnt_v_aanwezigcontract c2 + WHERE c2.cnt_contract_nummer_intern = + c.cnt_contract_nummer_intern)) cco + WHERE ins_deel_verwijder IS NULL + AND sd.ins_srtdeel_verwijder IS NULL + AND d.ins_srtdeel_key = sd.ins_srtdeel_key + AND sd.ins_srtgroep_key = 3 + AND cco.cnt_ins_deel_key(+) = d.ins_deel_key; + -- LEASECONTRACT NOTIFICATIES naar contractbeheerder, contracteigenaren, (nog) niet naar berijders. -- Elke dag de bij aflopende leaseonctracten notificaties de deur 'uitgooien', die NIET met de standaard noti-jobs gaan (omdat de export nog iets extra's doet, insert of zo). @@ -1980,17 +2109,13 @@ END; -BEGIN fac.registercustversion('vebe', 8); END; -/ +SET DEFINE OFF BEGIN adm.systrackscriptId('$Id$', 0); END; / -show errors; - - -commit; - - -spool off; - +COMMIT; +SET ECHO OFF +SPOOL OFF +SET DEFINE ON +PROMPT Logfile of this upgrade is: &fcltlogfile \ No newline at end of file