From a8451506cd08bf44386d57d2c1dc356ae3af8884 Mon Sep 17 00:00:00 2001 From: Arthur Egberink Date: Tue, 10 May 2016 08:00:29 +0000 Subject: [PATCH] PCHE#36417 -- Exact bestanden automatisch mailen. svn path=/Website/branches/v2016.1/; revision=29336 --- CUST/PCHE/export/gen_export_factuur.bat | 9 ++++++++- CUST/PCHE/export/sendmailFactuur.vbs | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 CUST/PCHE/export/sendmailFactuur.vbs diff --git a/CUST/PCHE/export/gen_export_factuur.bat b/CUST/PCHE/export/gen_export_factuur.bat index abe191cec8..90b44a4936 100644 --- a/CUST/PCHE/export/gen_export_factuur.bat +++ b/CUST/PCHE/export/gen_export_factuur.bat @@ -1,6 +1,6 @@ REM GEN_EXPORT_FACTUUR.BAT REM -REM Exporteert informatie naar een export-bestand en genereert de factuut +REM Exporteert informatie naar een export-bestand en genereert de factuur REM REM Context : roep deze file aan indien nodig, of schedule deze REM Verseist: de randvoorwaarde voor het gebruik van gen_export @@ -19,3 +19,10 @@ CALL ..\..\..\utils\gen_export\gen_export.bat EXACT_KWARTAAL CALL ..\..\..\utils\gen_export\gen_export.bat EXACT_JAAR +copy .\EXACT\exact_20*.xml .\EXACT\backup +del .\EXACT\exact_20*.xml +CALL ..\..\..\utils\gen_export\gen_export.bat EXACT_OUTPUT + +if not exist ".\EXACT\exact_20*.xml" goto einde +cscript sendmailFactuur.vbs +:einde \ No newline at end of file diff --git a/CUST/PCHE/export/sendmailFactuur.vbs b/CUST/PCHE/export/sendmailFactuur.vbs new file mode 100644 index 0000000000..194e0f3fc7 --- /dev/null +++ b/CUST/PCHE/export/sendmailFactuur.vbs @@ -0,0 +1,19 @@ + +Dim fso, folder, files +Set fso = CreateObject("Scripting.FileSystemObject") + +Set folder = fso.GetFolder("d:\Apps\Facilitor\Fplace5i\CUST\PCHE\export\EXACT") +Set files = folder.Files +For each folderIdx In files + If InStrRev(folderIdx.Name, "exact_20") > 0 Then + Set objEmail = CreateObject("CDO.Message") + objEmail.From = "no_reply@pche.facilitor.nl" + objEmail.To = "fa@pch-dienstengroep.nl;a.egberink@sgfacilitor.nl" + objEmail.Subject = "Facilitor: Bestand met factuur gegevens Strijp-S" + objEmail.Textbody = "Automatisch verzonden bestand van factuur gegevens." + objEmail.AddAttachment "d:\Apps\Facilitor\Fplace5i\CUST\PCHE\export\EXACT\" + folderIdx.Name + objEmail.Send + End If +Next + +