pixi

Retrieve External PDF Invoices


In the pixi Invoice application, you can set up whether you want to use external invoices instead of invoices generated in pixi. Instead of the pixi invoice, you can print already existing invoices in PDF format.


External PDF Files Instead of the Invoice Print in pixi

This functionality enables the printing of invoices from a partner company stored locally on a PC, i.e. the PDF invoices have already been created by one of your partners and transferred to you in form of PDF files. You must now save these files in a folder on your hard drive. If the functionality is activated, the pixi Invoice application searches for external PDF invoices based on the shop order number. If an external PDF invoice is found in the local folder, pixi prints it according to the selected printing rule.


Configuration

  1. In the first step, the partner's invoices must be saved as PDF in a directory on a PC. The invoices are then printed from this directory.

  2. In the Invoices application, open the menu item: Tools > Options > PDF Invoices > Print external PDF Invoices:


  3. Activate the option Print external PDF Invoices.

  4. Select the Folder where external invoices are stored containing the existing PDF invoices.

  5. Select the syntax for naming the new files.

  6. If you only want to print external invoices, select the checkbox for Don't print pixi invoice when printing external PDF invoice.


Back to top

Print external PDF invoices from an URL destination

This advanced functionality in pixi downloads the external PDF invoices from a web server and prints them according to the selected printing rule. The PDF invoice is generated on the PDF server when the request is executed.

Note:
- Extended Printing Rules are required to use this functionality!
- To print external PDF, the Software Adobe Acrobat Reader must be installed!
- For Microsoft Print to PDF to show a Save As dialogue, Adobe Acrobat Reader must be defined as the Standard application for PDF files in Windows.


Create a printing rule for printing external PDF invoices from an URL destination

  1. Open pixi Invoices > Tools > Options.

  2. Now select Invoice Printing > Button Printing Rules.

  3. You'll see the window Invoice Printing Rules opening. Click New rule to see the window to edit the Printing Rules:


  4. Select the Shop for which the PDF invoices are required.

  5. Define the parameters for this rule: Payment Type, Country, Shipping Vendor and/or Location.

  6. Now choose "External PDF Invoices from URL" as the Template Type.

  7. In the URL entry field, you must now enter the appropriate URL, which should be structured according to one of the following options (replacing "invoiceserver" with the corresponding domain):

    • http://invoiceserver/printpdf.php?InvoiceNR=%%InvoiceNR%%

    • http://invoiceserver/printpdf.php?OrderNr=%%OrderNr%%&InvoiceNR=%%InvoiceNR%%

    • http://invoiceserver/printpdf.php?OrderNr=%%OrderNr%%&BoxNR=%%BoxNR%%&InvoiceNR=%%InvoiceNR%%

    Note: The variable OrderNr must contain the shop order number.


  8. By clicking on Choose Template... you can now choose a template that will be used if the PDF invoice does not exist or if you've entered the wrong URL.

  9. Now click Printer Settings and select a printer.

  10. Save the new rule.

Notes:
- If the PDF invoice does not exist, or you have entered the wrong URL, the default template for printing invoices will be used. This is also used if the server does not respond within 15 seconds (server time-out). Also, note that directory authentication via HTACCESS is not possible through the URL. Please adapt your script accordingly, so that an authentication is not necessary, or can happen via parameters in the URL.
- The time-out can be defined with a database setting “External/URL Printing - Time-out in Seconds” (pixi Control Center > Database Settings > Invoices)


Note: External PDF invoices are downloaded to a temporary folder (C:\Users\username\AppData\Local\pixi) and deleted after printing.


Additional pages (Invoice 2nd page, Invoice 3rd page, Return, Gift / Voucher message) will also be printed if the invoice itself was retrieved from an external URL. If the printing rules for the additional pages are set up, the corresponding template of the print rules is being applied, otherwise the default templates for the respective shop are coming into play.


Back to top

Download of external PDF invoices

You can select whether to download invoices accessed via an external URL via the Downloader built into pixi Invoices, or to use an external application to download the invoices.


Integrated Downloader

Activate the option "Through application's built-in downloader" if you do not want to use an external program to download the PDF invoices.


External Program

If PDF invoices can't be downloaded via the Downloader integrated into the application, you have the option of using an external program for downloading PDF invoices. Activate the option "Use external program to download" and enter the complete path to the executable file of the external program. The parameters ensure that the external program is called in the correct configuration. Please read the manual of the external program for which you have decided to use the parameters for.

Our recommendation for downloading PDF invoices via an external program is "curl". You can download this program for free and extract it to any folder. For example, if you extract the content to the C:\curl\ directory, then the "External Program Path" is C:\curl\bin\curl.exe

Which parameters you can use in conjunction with curl can be found on this website. To be able to use the program curl immediately, enter the following parameters: --insecure -o "%SaveAs%" "%Url%"

An explanation of the --insecure and -o options is described in the curl program documentation. When printing the invoice, the two values in quotation marks are automatically replaced by the pixi Invoices application as follows:

  • "%SaveAs%": "Invoice-Number".pdf (e.g. PIX100152)

  • "%URL%": C:\Users\%USERNAME%\AppData\Local\pixi

Note: If you use the invoice download via an external program, it may happen that the PDF invoice is not displayed after the first call. Please carry out the printing again in this case. The invoice should then be called automatically.


Back to top