61 lines
2.5 KiB
SQL
61 lines
2.5 KiB
SQL
--
|
|
-- $Id$
|
|
--
|
|
-- Customer specific once-script BLCC#59857.SQL.
|
|
DEFINE thisfile = 'BLCC#59857.SQL'
|
|
DEFINE dbuser = '^BLCC'
|
|
|
|
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
|
|
|
|
------ payload begin ------
|
|
|
|
-- BLCC#59857: Verstuur factuurnotificaties van 22/10 opnieuw mét PDF-bijlage (op 29/10).
|
|
INSERT INTO fac_notificatie (fac_srtnotificatie_key,
|
|
fac_notificatie_status,
|
|
fac_notificatie_receiver_email,
|
|
fac_notificatie_oms,
|
|
fac_notificatie_refkey,
|
|
fac_notificatie_prioriteit,
|
|
fac_notificatie_datum,
|
|
fac_notificatie_sender_email,
|
|
fac_notificatie_attachments)
|
|
SELECT 341, -- CUST02-noti
|
|
2, -- Mail
|
|
DECODE ( -- To-adres
|
|
b.prs_bedrijf_email,
|
|
NULL, 'accountsreceivable@brightlands.com',
|
|
b.prs_bedrijf_email || ';accountsreceivable@brightlands.com'),
|
|
'Factuur ' || vf.fin_verkoopfactuur_id || ' ' || vf.fin_verkoopfactuur_maand || ' ' || vf.prs_debiteur_naam,
|
|
vfk.fin_verkoopfactuurkop_key,
|
|
2, -- Prioriteit
|
|
TRUNC (SYSDATE + 1) + (7 / 24),
|
|
'accountsreceivable@brightlands.com', -- From-adres
|
|
'/../../Fplace5i/CUST/BLCC/export/PDF/Backup/' || vfk.fin_verkoopfactuurkop_id || '.pdf'
|
|
FROM fin_verkoopfactuur vf, fin_verkoopfactuurkop vfk, prs_bedrijf b
|
|
WHERE SUBSTR (vf.fin_verkoopfactuur_id, 1, 1) = '3'
|
|
AND vf.fin_verkoopfactuurkop_key = vfk.fin_verkoopfactuurkop_key
|
|
AND vf.prs_bedrijf_key = b.prs_bedrijf_key
|
|
AND TO_CHAR (vf.fin_verkoopfactuur_aanmaak, 'dd-mm-yyyy') = '22-10-2019' -- Mislukt op 22/10
|
|
ORDER BY vf.fin_verkoopfactuur_id;
|
|
|
|
COMMIT;
|
|
|
|
------ payload end ------
|
|
|
|
SET DEFINE OFF
|
|
BEGIN adm.systrackscriptId ('$Id$', 1); END;
|
|
/
|
|
|
|
COMMIT;
|
|
SET ECHO OFF
|
|
SPOOL OFF
|
|
SET DEFINE ON
|
|
PROMPT Logfile of this upgrade is: &fcltlogfile
|