VLKC#60069 NACHTWERK-taak/CUST03(+CUST02)-noti
svn path=/Customer/trunk/; revision=45940
This commit is contained in:
@@ -3684,7 +3684,33 @@ AS
|
||||
AND bi.bes_srtdeel_key = sd.bes_srtdeel_key(+)
|
||||
AND sd.bes_srtgroep_key = sg.bes_srtgroep_key(+)
|
||||
AND sg.ins_discipline_key = fac.safe_to_number (ud.fac_usrdata_code(+));
|
||||
|
||||
/*
|
||||
-- VLKC#60069:
|
||||
-- Cursor loopt over alle BESOTV-tracking in de voorgaande 24 uur waarvan
|
||||
-- de bijbehorende catalogus voorkomt in de Eigen tabel met key=481; voor
|
||||
-- deze bestellingen wordt een CUST03-noti verstuurd!
|
||||
CURSOR ccust03
|
||||
IS
|
||||
SELECT DISTINCT
|
||||
'[' || TO_CHAR (b.bes_bestelling_key) || '|' || TO_CHAR (ud.fac_usrdata_key) || '] ' aanduiding,
|
||||
b.bes_bestelling_key, ud.fac_usrdata_key, b.prs_perslid_key_voor
|
||||
FROM fac_tracking t,
|
||||
bes_bestelling b,
|
||||
bes_bestelling_item bi,
|
||||
bes_srtdeel sd,
|
||||
bes_srtgroep sg,
|
||||
(SELECT *
|
||||
FROM fac_v_aanwezigusrdata
|
||||
WHERE fac_usrtab_key = 481) ud -- BESOTV catalogi
|
||||
WHERE t.fac_srtnotificatiecode = 8 -- BESOTV
|
||||
AND t.fac_tracking_datum > TRUNC (SYSDATE) + (6 / 24)
|
||||
AND t.fac_tracking_refkey = b.bes_bestelling_key
|
||||
AND b.bes_bestelling_status = 6 -- Geleverd
|
||||
AND b.bes_bestelling_key = bi.bes_bestelling_key
|
||||
AND bi.bes_srtdeel_key = sd.bes_srtdeel_key
|
||||
AND sd.bes_srtgroep_key = sg.bes_srtgroep_key
|
||||
AND sg.ins_discipline_key = fac.safe_to_number (ud.fac_usrdata_code);
|
||||
*/
|
||||
-- Afmelden/verwerken reserveringen (in juiste volgorde)!
|
||||
CURSOR cres
|
||||
IS
|
||||
@@ -3881,14 +3907,14 @@ BEGIN
|
||||
|
||||
bes.updatebestellingstatus (rec.bes_bestelling_key, NULL);
|
||||
|
||||
-- VLKC#60069: BESOTV-noti
|
||||
-- VLKC#60069: CUST03-noti!
|
||||
IF rec.fac_usrdata_key IS NOT NULL
|
||||
THEN
|
||||
BEGIN
|
||||
v_errormsg := 'Fout toevoegen BESOTV-email';
|
||||
v_errormsg := 'Fout toevoegen CUST03-email';
|
||||
fac.putnotificationsrtprio (NULL, -- pfrom
|
||||
rec.prs_perslid_key_voor, -- pto
|
||||
'BESOTV', -- pcode
|
||||
'CUST03', -- pcode
|
||||
rec.bes_bestelling_key, -- pref
|
||||
NULL, -- poptmessage
|
||||
NULL, -- poptstatus
|
||||
@@ -3900,21 +3926,54 @@ BEGIN
|
||||
NULL -- pattach
|
||||
);
|
||||
|
||||
v_errormsg := 'Fout toevoegen BESOTV-track';
|
||||
fac.trackaction ('BESOTV', rec.bes_bestelling_key, NULL, NULL, NULL);
|
||||
v_errormsg := 'Fout toevoegen CUST03-track';
|
||||
fac.trackaction ('CUST03', rec.bes_bestelling_key, NULL, NULL, NULL);
|
||||
EXCEPTION
|
||||
WHEN OTHERS
|
||||
THEN
|
||||
oracle_err_num := SQLCODE;
|
||||
oracle_err_mes := SUBSTR (SQLERRM, 1, 200);
|
||||
v_errormsg := v_errormsg || ' ORACLE (error ' || oracle_err_num || '/' || oracle_err_mes || ')';
|
||||
fac.writelog (p_applname, 'E', rec.aanduiding || v_errormsg, 'BESOTV-noti');
|
||||
fac.writelog (p_applname, 'E', rec.aanduiding || v_errormsg, 'CUST03-noti');
|
||||
COMMIT;
|
||||
END;
|
||||
END IF;
|
||||
END LOOP;
|
||||
COMMIT;
|
||||
/*
|
||||
-- VLKC#60069: CUST03-noti!
|
||||
FOR rec IN ccust03
|
||||
LOOP
|
||||
BEGIN
|
||||
v_errormsg := 'Fout toevoegen CUST03-email';
|
||||
fac.putnotificationsrtprio (NULL, -- pfrom
|
||||
rec.prs_perslid_key_voor, -- pto
|
||||
'CUST03', -- pcode
|
||||
rec.bes_bestelling_key, -- pref
|
||||
NULL, -- poptmessage
|
||||
NULL, -- poptstatus
|
||||
NULL, -- poptemail
|
||||
NULL, -- poptmobile
|
||||
NULL, -- pxref
|
||||
NULL, -- pprio
|
||||
NULL, -- psender
|
||||
NULL -- pattach
|
||||
);
|
||||
|
||||
v_errormsg := 'Fout toevoegen CUST03-track';
|
||||
fac.trackaction ('CUST03', rec.bes_bestelling_key, NULL, NULL, NULL);
|
||||
EXCEPTION
|
||||
WHEN OTHERS
|
||||
THEN
|
||||
oracle_err_num := SQLCODE;
|
||||
oracle_err_mes := SUBSTR (SQLERRM, 1, 200);
|
||||
v_errormsg := v_errormsg || ' ORACLE (error ' || oracle_err_num || '/' || oracle_err_mes || ')';
|
||||
fac.writelog (p_applname, 'E', rec.aanduiding || v_errormsg, 'CUST03-noti');
|
||||
COMMIT;
|
||||
END;
|
||||
END LOOP;
|
||||
COMMIT;
|
||||
*/
|
||||
SELECT COUNT ( * )
|
||||
INTO v_holiday
|
||||
FROM mld_vrije_dagen
|
||||
@@ -4040,15 +4099,11 @@ BEGIN
|
||||
END IF;
|
||||
COMMIT;
|
||||
/*
|
||||
-- VLKC#60657: Cursor loopt over alle RT-objecten die 4 werkdagen "overdue"
|
||||
-- zijn; hiervoor wordt een bundelnotificatie verstuurd via het
|
||||
-- Notificatie-kanaal (en anders het Geen/Overige opdrachten-
|
||||
-- kanaal) bij C-relatie met een contract waaronder de objecten
|
||||
-- vallen.
|
||||
-- VLKC#60657: CUST02-noti!
|
||||
FOR rec IN ccust02
|
||||
LOOP
|
||||
BEGIN
|
||||
v_errormsg := 'Fout toevoegen noti-email';
|
||||
v_errormsg := 'Fout toevoegen CUST02-email';
|
||||
fac.putnotificationsrtprio (NULL, -- pfrom
|
||||
NULL, -- pto
|
||||
'CUST02', -- pcode
|
||||
@@ -4063,7 +4118,7 @@ BEGIN
|
||||
NULL -- pattach
|
||||
);
|
||||
|
||||
v_errormsg := 'Fout toevoegen noti-track';
|
||||
v_errormsg := 'Fout toevoegen CUST02-track';
|
||||
fac.trackaction ('INSUPD', ???, NULL, NULL, 'CUST02-noti naar ' || rec.bedrijf || ' [' rec.ins_srtcontrole_omschrijving || ']');
|
||||
EXCEPTION
|
||||
WHEN OTHERS
|
||||
|
||||
Reference in New Issue
Block a user