From 25774886c4bd81ab4bb3e63f989fe2a5793c7434 Mon Sep 17 00:00:00 2001 From: Sander Schepers Date: Fri, 23 Jun 2023 09:47:06 +0000 Subject: [PATCH] FMHN#78808 Automatische singalering bhv tool bij status verandering van de BHVer svn path=/Customer/trunk/; revision=60919 --- FMHN/fmhn.sql | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/FMHN/fmhn.sql b/FMHN/fmhn.sql index bba1401fa..88f41428d 100644 --- a/FMHN/fmhn.sql +++ b/FMHN/fmhn.sql @@ -21649,6 +21649,80 @@ AS res_deel_omschrijving, res_deel_opmerking; +CREATE OR REPLACE VIEW FMHN_V_NOTI_BHVERS +( + CODE, + SENDER, + RECEIVER, + TEXT, + KEY, + XKEY, + XSENDER, + XEMAIL, + XMOBILE +) +AS + SELECT DISTINCT 'CUST27', + NULL, + NULL, + 'Automatische bericht bij status verandering van aspirant naar basis bhv', + d.ins_deel_key, + NULL, + NULL, + x.xemail, + NULL + FROM fac_tracking t, + ins_deel d, + (SELECT fac_usrdata_omschr2 AS xemail + FROM fac_usrdata + WHERE fac_usrtab_key = 901 -- Eigen tabel 'NotificatieBHVERS' + AND fac_usrdata_verwijder IS NULL) x + WHERE d.ins_deel_key = t.fac_tracking_refkey + AND INSTR (UPPER (t.fac_tracking_oms), + 'ASPIRANT BHV --> BASIS BHV') > + 0 -- Het profiel Aspirant BHV gezet naar Basis BHV + AND t.fac_srtnotificatie_key = 128 --INSUPD + AND t.fac_tracking_datum BETWEEN (SELECT fac_notificatie_job_lastrun + FROM fac_notificatie_job + WHERE UPPER ( + fac_notificatie_job_view) = + 'FMHN_V_NOTI_BHVERS') + AND (SELECT fac_notificatie_job_nextrun + FROM fac_notificatie_job + WHERE UPPER ( + fac_notificatie_job_view) = + 'FMHN_V_NOTI_BHVERS') + UNION ALL + SELECT DISTINCT 'CUST28', + NULL, + NULL, + 'Automatisch bericht bij locatieverandering bhv’er in de bhv tool', + d.ins_deel_key, + NULL, + NULL, + x.xemail, + NULL + FROM fac_tracking t, + ins_deel d, + (SELECT fac_usrdata_omschr2 AS xemail + FROM fac_usrdata + WHERE fac_usrtab_key = 901 -- Eigen tabel 'NotificatieBHVERS' + AND fac_usrdata_verwijder IS NULL) x + WHERE d.ins_deel_key = t.fac_tracking_refkey + AND INSTR (UPPER (t.fac_tracking_oms), 'BHV-ER VOOR LOCATIE: ') > + 0 -- Het profiel Aspirant BHV gezet naar Basis BHV + AND t.fac_srtnotificatie_key = 128 --INSUPD + AND t.fac_tracking_datum BETWEEN (SELECT fac_notificatie_job_lastrun + FROM fac_notificatie_job + WHERE UPPER ( + fac_notificatie_job_view) = + 'FMHN_V_NOTI_BHVERS') + AND (SELECT fac_notificatie_job_nextrun + FROM fac_notificatie_job + WHERE UPPER ( + fac_notificatie_job_view) = + 'FMHN_V_NOTI_BHVERS'); + ------ payload end ------ SET DEFINE OFF