diff --git a/PZEE/PZEE.sql b/PZEE/PZEE.sql index fa431fd6f..37b149d24 100644 --- a/PZEE/PZEE.sql +++ b/PZEE/PZEE.sql @@ -1009,8 +1009,9 @@ AS AND r.res_ruimte_verwijder IS NULL AND ( r.res_ruimte_vervaldatum > SYSDATE OR r.res_ruimte_vervaldatum IS NULL); - + -- Voor de koppeling met BIS is een specifieke opbouw van de rapportage nodig + CREATE OR REPLACE VIEW meeting ( res_date, @@ -1023,6 +1024,7 @@ AS SELECT datum, tijd_van, tijd_tot, titel, ruimte FROM pzee_v_rap_infobord; -- Voor de tijdelijke koppeling inforborden + CREATE OR REPLACE VIEW VERGADERING_2 ( RES_DATE, @@ -1053,6 +1055,7 @@ AS WHERE TRUNC (datum) = TRUNC (SYSDATE) AND datum_tot > SYSDATE; -- Voor de koppeling met Intranet is een specifieke opbouw van de rapportage nodig + CREATE OR REPLACE VIEW VERGADERING ( RES_DATE, @@ -1082,6 +1085,7 @@ AS FROM PZEE_V_RAP_INFOBORD; --- reserveringen met catering + CREATE OR REPLACE VIEW PZEE_V_RAP_CATERING AS SELECT DISTINCT @@ -1246,6 +1250,7 @@ AS ORDER BY res_rsv_ruimte_key; --- catering artikelen die besteld mogen worden conform de gestelde catalogus instellingen + CREATE OR REPLACE VIEW PZEE_V_RAP_CATERING_RGL AS SELECT b.prs_bedrijf_key || rar.res_rsv_ruimte_key extra_key, @@ -1263,7 +1268,7 @@ AS rar.res_rsv_artikel_externsyncdate, cat.ins_discipline_omschrijving, cat_s.res_disc_params_expire_dagen, - cat_s.res_disc_params_expire_tijd, + cat_s.res_disc_params_expire_tijd, t1.t1, TRUNC (fac.datumtijdplusuitvoertijd ( SYSDATE, @@ -1296,6 +1301,7 @@ AS AND ba.prs_bedrijf_key = b.prs_bedrijf_key; -- combinatie van reservering en bestelregels + CREATE OR REPLACE VIEW PZEE_V_RAP_CATERING_ALL AS SELECT CASE @@ -1381,11 +1387,12 @@ AS END leverdag, --- zondag is dag 1 van de week cr.res_rsv_artikel_levering artikel_levering, TO_CHAR (cr.res_rsv_artikel_levering, 'dd-mm-yyyy') leverdatum, - TO_CHAR (cr.res_rsv_artikel_levering, 'hh24:mi') levertijd + TO_CHAR (cr.res_rsv_artikel_levering, 'hh24:mi') levertijd FROM pzee_v_rap_catering c, pzee_v_rap_catering_rgl cr WHERE c.res_rsv_ruimte_key = cr.res_rsv_ruimte_key; -- rapport met bestellingen dat naar de leverancier gestuurd mag worden + CREATE OR REPLACE VIEW PZEE_V_RAP_NOTI_LEVERANCIER AS SELECT c.res_rsv_ruimte_key, @@ -1460,6 +1467,7 @@ AS AND c.res_rsv_ruimte_key = cr.res_rsv_ruimte_key; --- SELECT sender, receiver, text, code, key, xkey, xsender, xemail, xmobile + CREATE OR REPLACE VIEW PZEE_V_NOTI_BAKKERBEST ( SENDER, @@ -1493,13 +1501,13 @@ AS xkey, NULL xsender, - b.mailadres + b.mailadres xemail, NULL xmobile FROM fac_srtnotificatie sn, fac_tracking t, - pzee_v_rap_noti_leverancier b + pzee_v_rap_noti_leverancier b WHERE sn.fac_srtnotificatie_code = 'CUST01' AND b.bedrijfs_key = 1842; CREATE OR REPLACE VIEW PZEE_V_NOTI_SEC_BEST @@ -1541,7 +1549,7 @@ AS xmobile FROM fac_srtnotificatie sn, fac_tracking t, - pzee_v_rap_noti_leverancier b + pzee_v_rap_noti_leverancier b WHERE sn.fac_srtnotificatie_code = 'CUST01' AND b.bedrijfs_key = 1841; CREATE OR REPLACE VIEW PZEE_V_MENTIMETER_ACC @@ -1556,7 +1564,7 @@ AS || ' (' || srt_a.fac_usrdata_omschr || ') ' - || a.ins_kenmerkdeel_waarde accountnaam, + || a.ins_kenmerkdeel_waarde accountnaam, d.ins_deel_verwijder FROM ins_deel d, ins_srtdeel sd, @@ -1580,8 +1588,9 @@ AS AND a.ins_deel_key = d.ins_deel_key AND srt_a.ins_deel_key = d.ins_deel_key; ---- notificatie naar representatie wanneer er een wijziging is in een reserving van een representatieve ruimte +--- notificatie naar representatie wanneer er een wijziging of annulering is van een reserving in een representatieve ruimte --- die in behandeling is door representatie + CREATE OR REPLACE VIEW PZEE_V_NOTI_RESUPD ( SENDER, @@ -1595,18 +1604,18 @@ CREATE OR REPLACE VIEW PZEE_V_NOTI_RESUPD XMOBILE ) AS - SELECT 3 sender, - NULL receiver, + SELECT 3 sender, + NULL receiver, 'Er is een wijziging op reservering ' || r.res_reservering_key || '/' - || r.res_rsv_ruimte_volgnr tekst, - sn.fac_srtnotificatie_code code, - r.res_reservering_key key, - NULL xkey, - NULL xsender, + || r.res_rsv_ruimte_volgnr tekst, + sn.fac_srtnotificatie_code code, + r.res_reservering_key key, + NULL xkey, + NULL xsender, 'representatie@zeeland.nl;ab.kramer@zeeland.nl' xemail, - NULL xmobile + NULL xmobile FROM fac_tracking t, prs_perslid p, res_rsv_ruimte r, @@ -1626,6 +1635,53 @@ AS AND r.res_ruimte_opstel_key = cat.res_ruimte_opstel_key AND r.res_rsv_ruimte_flag IN (1, 2) -- status representatie is in behandeling of voorlopig afgerond AND cat.ins_discipline_key IN (803, 442, 801) + AND t.fac_tracking_datum > + (SELECT fac_notificatie_job_lastrun + FROM fac_notificatie_job + WHERE UPPER (fac_notificatie_job_view) = + 'PZEE_V_NOTI_RESUPD') + AND t.fac_tracking_datum < + (SELECT fac_notificatie_job_nextrun + FROM fac_notificatie_job + WHERE UPPER (fac_notificatie_job_view) = + 'PZEE_V_NOTI_RESUPD') + AND NOT EXISTS + (SELECT ton.prs_perslid_key + FROM prs_perslid ton + WHERE ton.prs_perslid_key = 1225 + AND ton.prs_perslid_key = p.prs_perslid_key) + UNION ALL + SELECT 3 sender, + NULL receiver, + 'Let op: Reservering ' + || r.res_reservering_key + || '/' + || r.res_rsv_ruimte_volgnr + || ' is geannuleerd' tekst, + sn.fac_srtnotificatie_code code, + r.res_reservering_key key, + NULL xkey, + NULL xsender, + 'representatie@zeeland.nl;abkramer@zeeland.nl' xemail, + NULL xmobile + FROM fac_tracking t, + prs_perslid p, + res_rsv_ruimte r, + fac_srtnotificatie sn, + (SELECT d.ins_discipline_key, + d.ins_discipline_omschrijving, + ro.res_ruimte_opstel_key + FROM ins_tab_discipline d, + res_ruimte_opstelling ro, + res_ruimte rr + WHERE ro.res_ruimte_key = rr.res_ruimte_key + AND rr.res_discipline_key = d.ins_discipline_key) cat + WHERE t.fac_srtnotificatie_key = 121 --- RESDEL + AND p.prs_perslid_key = t.prs_perslid_key + AND sn.fac_srtnotificatie_code = 'CUST02' + AND r.res_rsv_ruimte_key = t.fac_tracking_refkey + AND r.res_ruimte_opstel_key = cat.res_ruimte_opstel_key + AND r.res_rsv_ruimte_flag IN (1, 2, 3) -- status representatie is in behandeling, voorlopig afgerond of gereserveerd respresentatie AND t.fac_tracking_datum > (SELECT fac_notificatie_job_lastrun FROM fac_notificatie_job @@ -1675,7 +1731,7 @@ AS pzee_v_rap_noti_leverancier b WHERE sn.fac_srtnotificatie_code = 'CUST01' AND b.res_rsv_artikel_externsyncdate IS NULL - AND b.bedrijfs_key in (1842,1843); + AND b.bedrijfs_key IN (1842, 1843); CURSOR SEC IS SELECT DISTINCT b.reservering, @@ -1721,9 +1777,9 @@ AS TO_CHAR (cr.res_rsv_artikel_levering, 'd') leverdag --- zondag is dag 1 van de week FROM pzee_v_rap_catering_rgl cr - WHERE TRUNC (cr.bestelling_voor) = TRUNC (cr.res_rsv_artikel_levering) - AND cr.res_rsv_artikel_externsyncdate IS NULL; - + WHERE TRUNC (cr.bestelling_voor) = + TRUNC (cr.res_rsv_artikel_levering) + AND cr.res_rsv_artikel_externsyncdate IS NULL; BEGIN v_errorhint := 'init'; @@ -1849,7 +1905,7 @@ EXCEPTION v_errorhint); END; / - + ------ payload end ------ SET DEFINE OFF