BLCC#37691 Facturatieproces M2/deel 4

svn path=/Website/branches/v2017.1/; revision=34597
This commit is contained in:
Maarten van der Heide
2017-07-12 09:08:51 +00:00
parent e86eef45e0
commit a62ea68686
5 changed files with 77 additions and 0 deletions

View File

View File

@@ -0,0 +1,2 @@
::API 'FINVKPDF' wijst naar 'appl\fin\fin_verkoopfactuurkop.asp?mode=print'
phantomjs --ssl-protocol=tlsv1 rasterize.js "https://blcc.facilitor.nl/?API=FINVKPDF&APIKEY=kV6SFYR6skyLztIvZrAtF0cBRxSRY4bH&mode=print&id=%1" %2.pdf A4

View File

@@ -0,0 +1,32 @@
var page = require('webpage').create(),
system = require('system'),
address, output, size;
if (system.args.length < 3 || system.args.length > 5) {
console.log('Usage: rasterize.js URL filename [paperwidth*paperheight|paperformat] [zoom]');
console.log(' paper (pdf output) examples: "5in*7.5in", "10cm*20cm", "A4", "Letter"');
phantom.exit(1);
} else {
address = system.args[1];
output = system.args[2];
page.viewportSize = { width: 600, height: 600 };
if (system.args.length > 3 && system.args[2].substr(-4) === ".pdf") {
size = system.args[3].split('*');
page.paperSize = size.length === 2 ? { width: size[0], height: size[1], margin: '0px' }
: { format: system.args[3], orientation: 'portrait', margin: '1cm' };
}
if (system.args.length > 4) {
page.zoomFactor = system.args[4];
}
page.open(address, function (status) {
if (status !== 'success') {
console.log('Unable to load the address!');
phantom.exit();
} else {
window.setTimeout(function () {
page.render(output);
phantom.exit();
}, 2000);
}
});
}

View File

@@ -0,0 +1,26 @@
REM GEN_EXPORT_PDF_ATT.BAT
REM
REM BLCC
REM
REM Genereert PDF-verkoopfacturen die vervolgens (per factuur) als bijlage met
REM de notificatie worden meegestuurd.
REM NB. Aangezien de datum bij de notificatie op de volgende dag staat, worden
REM de notificaties dan pas verzonden.
REM
REM Context : roep deze file aan indien nodig, of schedule deze
REM Vereist : de randvoorwaarde voor het gebruik van gen_export
REM
REM $Revision$
REM $Id$
REM
REM (c) 2017 Facilitor B.V.
REM
REM === create exportfile gen_pdf_verkoopfactuur.bat
CALL ..\..\..\utils\gen_export\gen_export.bat PDF_ATT
cd PDF
CALL gen_pdf_verkoopfactuur.bat
cd ..

View File

@@ -0,0 +1,17 @@
Dim fso, folder, files
Set fso = CreateObject("Scripting.FileSystemObject")
Set folder = fso.GetFolder("d:\Apps\Facilitor\Fplace5i\CUST\BLCC\export\FACT")
Set files = folder.Files
For each folderIdx In Files
If InStrRev(folderIdx.Name, ".csv") > 0 And folderIdx.Length > 0 Then
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "no_reply@blcc.facilitor.nl"
' objEmail.To = "m.vanderheide@facilitor.nl"
objEmail.To = "accounting1@brightlands.com;roger.treur@brightlands.com;leslie.vandewauw@brightlands.com"
objEmail.Subject = "Facilitor: Maandelijkse aanlevering FACT-bestand"
objEmail.Textbody = "Automatisch verzonden FACT-bestand."
objEmail.AddAttachment "d:\Apps\Facilitor\Fplace5i\CUST\BLCC\export\FACT\" + folderIdx.Name
objEmail.Send
End If
Next