Pagero Server Connect - Testing the installation of Pagero Printer

Checklist
  • Is Pagero Printer listed among the installed printers?
  • Are you able to choose Pagero Printer when printing in the ERP/Financial system?
  • Can all the Users both Read & Write in
    C:\Documents and Settings\All Users\Application Data\Pagero\USER
    ?
  • Is the Pagero PrinterListener running for all the users (check Task Manager)?
  • Can you find a PDF in
    C:\Documents and Settings\Application Data\Pagero Connect\VirtualPrinter\In?
  • Is the Pagero Connect application starting automatically (It should not be running before you carry out this test)?
Testing the printer
To test the installation, test the printer.Test: Open a document (of any kind). Print it by choosing File/Print… Then select Pagero Printer's printer driver. Result: The document should print. If you are using Pagero Connect for communication, the application should start, and the document show up with a progress bar and a status showing that the document was sent. If you are using Pagero Server Connect for communication; the file should be sent (but no GUI displays status). In either case above, to check that the document was sent to Pagero Online, log on to Pagero Online. Go to Invoice history/Handle error batches. The file should be displayed in the list.
Testing attachment handling in Server Connect
The purpose of the test is to make sure your regular expressions for binding the main document to its attachments.First a quick operational note: For the application to function as desired (that main documents are connected to attachments and transferred together to the Pagero Online processing platform), attachments need to be written to their destination folder first; and last the main document must be put in its place.The important thing here is to identify how the files names will allow you to tie the documents together. This is done by letting parts of the file name be the same for files that belong together, in a way that eliminates ambiguity. In other words, the part of the name that is used to die documents together, must be unique. Make sure the flag subDocumentAware is set to true under the outbox-tag in the configuration file. Then define the regular expression needed to identify your file names.Put files that are named according to your regular expressions (and that mirrors the file naming you will use in production) into the file folders used for testing of your outbox. Send the files to Pagero Online. Then log on to the Pagero Online portal, to check whether your files came across correctly.
Example 1: Invoice with one general attachment in PDF format.
masterDocRegexp=(.*).xml subDocRegexp=(.*).pdf
Example 2: Invoice with one presentation attachment (invoice image) and general attachments.
masterDocRegexp=INVOICE_(.*).xml subDocRegexp=ATTACHMENT_(.*)[_\d]?.pdf subDocPresentationRegexp=IMAGE_(.*).pdf
Troubleshooting
  • The most common error is that Users do not have sufficient user rights in
    Document and Settings\All Users\application Data\Pagero
    . The Users need to be able to both Read & Write.
  • PageroPrinterListener needs to be running for all Users. This is easily verified through checking the Task Manager.
  • If the printed invoice (PDF file) is blank, a possible reason could be that a pcl-driver is used. Pagero Printer demands postscript.
  • To check if the printed PDF file actually was saved to
    Documents and Settings\All Users\application Data\Pagero\User
    , check the logfile in
    C:\WINDOWS\TempPageroPrintingNNNNNlog (txt)
    .
  • The Log file for Pagero PrinterListener is found in
    C:\Documents and Settings\USER\Local Settings\Temp
    and is called PageroPrinterListener.log.
  • To check if the PDF was moved to the Virtual Printer directory in Pagero Connect, check if there is a *.pdfACK file in
    Documents and Settings\All Users\application Data\Pagero\USER
    .
Understanding the Pagero Printer normal flow
  1. The customer chooses to print an invoice, which results in a print dialogue being opened.
  2. Pagero Printer is chosen.
  3. Pagero Printer receives the data to be printed and creates a PDF, that is saved in
    Documents and Settings\All Users\application Data\Pagero\USER
    .
  4. PageroPrinterListener detects the new PDF file (the invoices) and moves it to
    Documents and Settings\USER\Application Data\Pagero Connect\VirtualPrinter\In
    .
  5. PageroPrinterListener notices or starts Pagero Connect and informs that there is a new PDF file (new invoices), that is ready to be sent.
  6. Pagero Connect sends the PDF files (invoices) to Pagero Online.
Advanced Features
Multiple printers setup
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
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.
Example Server Connect configuration is given below: 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
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="&lt;/ section&gt;&lt;/ batch&gt;"/> <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 &lt; or &gt; so </INVOICES<>/CONTENT_FRAME></INOICE_CENTER> should be entered as &lt;/INVOICES&gt;&lt;/CONTENT_FRAME&gt;/INVOICE_CENTER&gt;
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.
<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="&lt;/ INVOICES&gt;&lt;/ CONTENT_FRAME&gt;&lt;/ INVOICE_CENTER&gt;"/> </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="&lt;/ section&gt;&lt;/ batch&gt;"/> </xmltag> </fpclient>

Related Content