Multiple printers
To be able to print e-invoices from more than one legal company/unit, you need one printer per company/unit. To create more than one printer you need to run the installation manually from the command line, feeding the install program parameters needed to create separate printers. Depending on how you plan to send the files to Pagero Online, the folder structure may look a little different.
Please read this section in its entirety before starting the set up.
Start by getting the printer install program. Pagero Printer is available at the Pagero Online web site. Log on, and go to Support -> Downloads. Click the printer symbol to download the installation file. Follow the instructions on the page, to install the printer as a standalone printer; but note the following extra parameters needed since you are installing two or more printers:
- /portname (the name the printer will display, in the printer selection list available in most Windows applications)
- /printname (a folder to which the printer will save the PDF files that are created when printing)
Assuming you downloaded the installation to your C:drive, this is what your command will look like: C:\setuppageroprinter.exe /portname=port1 /printname=<companyName1_prod>
/PageroVersion=<version number> /javabin=”<path to java.exe>” /LANG=EN
NOTE: the given /printname parameter corresponds to a directory in the filesystem (see printTargetStandalonePrinter below) and must be created manually.
To install the second (and third, …) printer, just issue the command again, giving different values to the
/portame and /printname parameters. C:\setuppageroprinter.exe /portname=port2 /printname=
< companyName2_prod >/PageroVersion=<version number> /javabin=<path to java.exe> /LANG=EN
Now go to the printer configuration file located at:
$ProgramFiles\PageroConnect\printersettings.ini
Here you decide what main folder your printers will put the PDF files in.
printTargetStandalonePrinter=<main folder> (Create the folder manually).
Also add the following row to the printersettings.ini file:
fileNameFormat=$env{REDMON_PRINTER}\\$date{yyyyMMddHHmmss}.pdf
This parameters sets the name pattern for the PDF files that are created.
Your printersettings.ini should look like this:
printTargetStandalonePrinter=c:\\pagero
temporaryPdfAsFileOrDir=file
fileNameFormat=$env{REDMON_PRINTER}\\$date{yyyyMMddHHmmss}.pdf
The following shall be created if printers with name companyName1_prod and companyName2_prod are installed:
C:\pagero\ companyName1_prod c:\pagero\ companyName2_prod
To test the printers; open a text file using for example Notepad. Print the file using all of the printers (one at a time) and make sure the files are printed to the corresponding folder set as above. For the files to be sent to the Pagero e-invoice service, configure the communication software to read the folders where the PDF files are saved.
NOTE: If you are using Pagero Server Connect to communicate the files, please note that you need separate printers for production and test. The test printer should be named companyName1_test, and the corresponding folder should be c:\pagero\companyName1_test. The corresponding folder should be configured for reading test files in the server connect.
Example Server Connect configuration is given below:
<outbox active="true" prodPath="C:/Pagero/companyName1_prod/" testPath="C:/Pagero/companyName1_test/" workPath="C:/Pagero/work/companyName1/" subDocAware="false" masterDocRegexp="(.*)\.xml" subDocRegexp="(.*)\.pdf" subDocPresentationRegexp="(.*)\.png">
Configure SAP to Pagero’s network printer
You can find the installation guide: Pagero Printer for SAP, here
Filesplitter
For files that need to be split (Batch files containing multiple invoices), enriched or where you have sections that need to be removed you can use module Filesplitter. This module must be scheduled before ServerConnect. There is a file called FileSplitt.bat that starts the module. Before you run FileSplitt.bat you need to setup a configurationfile and edit FileSplitt.bat. Set configuration- and log-file in FileSplitt.bat. Create your configurationfile for FileSplitter, this will tell filesplitter what to do. You can make a copy of config_fs.xml and set your configuration.
Example of configuration file
<fpclient>
<log mode="FILE" path="c:/Temp/log/filsplitter.log">
<filename pattern="MERFL.*xml">
<defaultEncoding charset="ISO-8859-15">
<path verbose="false">
<incomming path="c:/Temp/incoming"/>
<outgoing path="c:/Temp/outgoing"/>
<temporary path="c:/Temp/temp"/>
<backup path="c:Temp/backup"/>
</path>
<xmltag verbose="false">
<removeTag pattern="^S[O-P].*"/>
<splitTag pattern="Finvoice"/>
<attachmentTag pattern="InvoiceFreeText" group="(.*)" filename="${1}"/>
<savedBatchDataTag pattern="sectionInfo"
appendAfterSplit="</section></batch>"/>
<CSVTag header="TRUE" csvIdentifier="14" useCSVIndex="TRUE"
invoiceIdentifier="/Finvoice/InvoiceDetails/AgreementIdentifier"/>
<modTag xpath="/Finvoice/BuyerPartyDetails/BuyerOrganisationName"
action="BEFORE" value="A"/>
<modTag xpath="/Finvoice/BuyerPartyDetails/BuyerOrganisationName"
action="AFTER" value="B"/>
<modTag xpath="/Finvoice/BuyerPartyDetails/BuyerOrganisationTaxCode"
action="REPLACE" value="C"/>
<modTag xpath="/Finvoice/BuyerPartyDetails/buyerExtra" action="CREATE"
value="D"/>
<modTag
xpath="/Finvoice/MessageTransmissionDetails/MessageSenderDetails/FromIntermediator"
action="BEFORE" value="1" useCSV="TRUE" useCSVIndex="TRUE"/>
<modTag
xpath="/Finvoice/MessageTransmissionDetails/MessageSenderDetails/FromIntermediator"
action="AFTER" value="InvoiceNumber" useCSV="TRUE" useCSVIndex="FALSE"/>
<modTag
xpath="/Finvoice/MessageTransmissionDetails/MessageSenderDetails/FromIntermediator[2]"
action="REPLACE" value="3" useCSV="TRUE" useCSVIndex="TRUE"/>
</xmltag>
</fpclient>
This example will search for files in C:/Temp/incoming/in path that have filename MERFL.*.xml, i.e. MERFL_123.xml. When a file is found we will remove SOAP tag and split content in different files.
Every new file have starttag and endtag Finvoice. Filesplitter will match invoice with attachment with help of tag InvoiceFreeText. Filesplitter will also identify a CSV file for invoice. Information in CSVTag tells Filesplitter how CSV is connected to an invoice. Index in CSV file should match value /Finvoice/InvoiceDetails/AgreementIdentifier in Invoice.
Values in CSV is used to enrich values in invoice. When all files successfully have been parsed, split invoices will be created in C:/Temp/outgoing and original files will be moved to C:/Temp/backup.
Description of tags and attributes in configurationfile
TAG | ATTRIBUTE | VALUE |
---|---|---|
Log | Mode | FILE for writing to file and SYSTEM to write to eventlog on Windows and syslog for a linux machine. |
Log | Path | Where logfile will be saved, path must exist but not the file. |
filename | Pattern | Regexp, Scan invoices file matching this pattern |
path | Vervbose | false for information and true for extended information |
incomming | Path | where original unspitted/unprocessed invoices and attachments are stored. |
defaultEncoding | charset | Valid charset name. E.g ISO-8859-15 or UTF-8. This will be used as default encoding if FileSplitter fail to detect encoding from invoice or batch. |
outgoing | Path | where to store spitted/processed invoices and attachments files. |
temporary | Path | Working folder. |
backup | Path | Path where to move original files from incomming. All processed files from incomming will be moved to this path when successful processed. |
xmltag | verbose | false for information and true for extended information. |
removeTag | pattern | Regexp, start and end of expression shoud be removed. |
splitTag | pattern | Start and end tag that identifies a invoice in batch. |
attachmentTag | pattern | To match attachments filename to an invoice you need to configure attachmentTag with attribute pattern, group and filename. Pattern is a regular expression. Set pattern to a xmltag, then we will use group and filename to parse out that textvalue. |
attachmentTag | groups |
Create groups with regular expression. These groups will be used in attribute filename. l.e. ([a-z0-9A-Z-]*)\
([a-z0-9A-Z-]*) will create 2 groups.
|
attachmentTag | filename | Here we create the filenames you will match to your invoice. l.e. Test{1]_{2].pdf will use group 1 and group 2 that are specified in attribute groups. |
CSVTag | header | true if CSV file have a header otherwise false |
CSVTag | csvIdentifier | index of csv value (starts with 0) or header name for value in CSV |
CSVTag | useCSVIndex | true if csvIdentifier use index otherwise false. |
CSVTag | csvFilenameIdentifier | True if we want to match value in invoice with filename of CSV, otherwise FALSE. |
CSVTag | invoiceIdentifier | XPath to identify value in XML file. |
CSVTag | invoiceIdentifierGroups | Create groups with regular expression. l.e. [a-z0-9A-Z-]*\ ([a-z0-9A-Z-]*). Will get one group in textvalue. |
CSVTag | invoiceIdentifierFilename | Parsed text to use for finding CSV as filename or use value inside CSV file. l.e. ${1}.csv will use group 1 and replace ${1} with that value. |
modTag | Xpath | XPath to find in XML file that will be enriched. |
modTag | Action | Can be one of following values BEFORE – Add value infront of textvalue. AFTER – Add value after textvalue. REPLACE – Replace all textvalue with new value, if xpath does not exist a new tag will be created. CREATE – Create new xml tag that is the valid xpath with values. |
modTag | Value | New text to use when enrich XML file. If no useCSVIndex and useCSV is used then this static text will used to replace value in XML. |
modTag | useCSVIndex | true to use index, false to use header name. |
modTag | useCSV | true when using CSV file for enrichment otherwize false. |
saveBatchDataTag | Pattern | RegExp, to detect last node in batch before every single invoice. |
SaveBatchDataTag | AppendAfterSplit | Node or nodes that must be appended at end of every splitted invoice. This string must exist in the original batch. Also notice that you can’t write xml tags within configuration file. So instead using character <or> you MUST enter < or > so </INVOICES<>/CONTENT_FRAME></INOICE_CENTER> should be entered as </INVOICES></CONTENT_FRAME>/INVOICE_CENTER> |
You can enrich XML with static text or with values in a CSV file. If you enrich XML with static text you only need to add modTags to configurationfile and set xpath, action and value.
For example
<modtag xpath="/Finvoice/BuyerPartyDetails/ByerOrganisationName" action="BEFORE" value="A"/> <modTag xpath="/Finvoice/BuyerPartyDetails/BuyerOrganisationName" action="AFTER" value="B"/> <modTag xpath="/Finvoice/BuyerPartyDetails/BuyerOrganisationTaxCode" action="REPLACE" value="C"/> <modTag xpath="/Finvoice/BuyerPartyDetails/buyerExtra" action="CREATE" value="D"/>
Here we will try to find xpath /Finvoice/BuyerPartyDetails/BuyerOrganisationName and add value A before and B after existing value. We also try to find xpath
/Finvoice/BuyerPartyDetails/BuyerOrganisationTaxCode and replace existing value with C. The last line will create a new tag if xpath is valid and set value D.
To enrich XML with a CSV you need to add CSVtag and describe how to connect CSV with invoice. You can connect csv file with value inside csv or use its filename. To use its filename you should add attribute
csvFilenameIdentifier and set it to TRUE. Now Filesplitter will try to find value in invoice and match it to CSV filename.
To match CSV with invoice based on information inside files you must use attribute csvIdentifier and useCSVIndex.
With these two attributes Filesplitter will try to find value in CSV with given index or name and match to a invoice value that exist in given xpath. In modTag we set useCSV to true. We can then set useCSVIndex to true and value to a index number or we set useCSVIndex to falseand value to header name.
Filesplitter will now lookup value in CSV and enrich XML with found value.
CSV file must use “;” to separate values in file.
For example
<CSVTag header="TRUE" csvIdentifier="14" useCSVIndex="TRUE" invoiceIdentifier="/Finvoice/InvoiceDetails/AgreementIdentifier"/> <modTag xpath="/Finvoice/MessageTransmissionDetails/MessageSenderDetails/FromIntermediator" action="AFTER" value="InvoiceNumber" useCSV="TRUE" useCSVIndex="FALSE"/> <modTag xpath="/Finvoice/MessageTransmissionDetails/MessageSenderDetails/FromIntermediator[2]" action="REPLACE" value="3" use CSV="TRUE" useCSVIndex="TRUE"/>
Here we will connect CSV file with help of index 14 and xpath
/Finvoice/InvoiceDetails/AgreementIdentifier.
If they have same value they are connected and csv will be used to enrich invoice. First modTag will append value in CSV that have header invoiceNumber second modtag will replace value in
/Finvoice/MessageTransmissionDetails/MessageSenderDetails/FromIntermediator [2] with value in index 3 in CSV file.
Here is an example how a configuration of CSVTag can look like when matching with CSV filename.
<CSVTag header="TRUE" csvFilenameIdentifier="TRUE" invoiceIdentifierGroups="[a-z0-9A-Z-]*\ ([a-z0-9A-Z-]*)." invoiceIdentifierFilename="${1}.csv" invoiceIdentifier="/Finvoice/InvoiceDetails[1]/InvoiceFreeText[1]"/ >
First will invoiceIdentifier get the value between xml tags. Then will we apply this reg expr. [a-z0-9A-Z-]*\ ([a-z0-9A-Z-]*). On value and get one group. After this we format our value with invoiceIdentifierFilename and use values inside groups that we have parsing out. I.e. value is “Test 123 ABC” then group 1 will get value 123 and last we apply ${1}.csv and get 123.csv as final value.
To run both Filesplitter and Serverconnect use FileSplitt_AND_ServerConnect.bat
To disable command prompt to be shown we use invis.vbs that takes the bat file as argument, i.e.
Run both Filesplitter and Serverconnect –
“C:\WINDOWS\system32\wscript.exe<install path>\invis.vbs<install path>\FileSplitt_And_ServerConnect.bat
Example configfile for TEAPPS.
<fpclient <log mode="FILE" path="/tmp/fileSplitter/log/startconf.log"/> <filename pattern="teappsInvoice.*xml"/> <defaultEncoding charset="ISO-8859-15"/> <path verbose="false"> <incomming path="/tmp/fileSplitter/incoming"/> <outgoing path="/tmp/fileSplitter/outgoing"/> <temporary path="/tmp/fileSplitter/temp"/> <backup path="/tmp/fileSplitter/backup"/> </path> <xmltag verbose="false"> <removeTag pattern="^S[OP].*"/> <splitTag pattern="^INVOICE$"/> <!--BGC-Invoice save batchdata when split → <saveBatchDataTag pattern="^INVOICES$" appendAfterSplit="<;/INVOICES>;<;/CONTENT_FRAME>;<;/INVOICE_CENTER>;"/> </xmltag> </fpclient>
Example configfile for BGCInvoice
<fpclient> <log mode="FILE" path="/tmp/fileSplitter/log/startconf.log"/> <filename pattern="BGCInvoice.*xml"/> <defaultEncoding charset="ISO-8859-15"/> <path verbose="false"> <incomming path="/tmp/fileSplitter/incoming"/> <outgoing path="/tmp/fileSplitter/outgoing"/> <temporary path="/tmp/fileSplitter/temp"/> <backup path="/tmp/fileSplitter/backup"/> </path> <xmltag verbose="false"> <removeTag pattern="^S[OP].*"/> <splitTag pattern="^document$"/> <!--BGC-Invoice save batchdata when split → <saveBatchDataTag pattern="sectionInfo" appendAfterSplit="<;/section>;<;/batch>;"/> </xmltag> </fpclient>