FMHN#78808 Automatische singalering bhv tool bij status verandering van de BHVer

svn path=/Customer/trunk/; revision=60919
This commit is contained in:
Sander Schepers
2023-06-23 09:47:06 +00:00
parent a35088f1d4
commit 25774886c4

View File

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