Skip to main content
Skip table of contents

Automatic generation of invoice and delivery note

For orders in the printformer Closed Shop, invoices and delivery notes can be generated automatically on the basis of an IDML template.

InDesign-Templates

The following files can be customised as templates and uploaded under Publish > Templates.

delivery-note_PF_Additional_Page.idml delivery-note_PF.idml inovice-template_PF_Additional_Page.idml invoice-template_PF.idml

SC_shop_invoice_delivery.png

There is one template including letterhead and one for the following page(s).

Two layers are created in the files, one for static (background PDF) and one for dynamic content.
The corresponding data keys are already entered in the placeholders for the dynamic content.
Settings, attributes and conditions are also already stored in the InDesign templates.
These should not be changed for a functional invoice or delivery note template.

The text block with the list of order items should only contain one line of text with the required placeholders. These are separated using tabs.

The printformer then duplicates this line automatically for each ordered product (order item).

DataKeys und Attributes

Data-Keys Clients

Input under Integrations > API-Keys

General

pf-client-name

Name of the client in the system

SC_shop_invoice_delivery2.png

Address

pf-client-street

pf-client-zip

pf-client-street-number

pf-client-city

SC_shop_invoice_delivery3.png

Bank Data

pf-client-person

Management

pf-client-bank

Bank

pf-client-bic

BIC

pf-client-iban

IBAN

pf-client-commercial-register

Commercial register

pf-client-vat-id

VAT number

SC_shop_invoice_delivery4.png

Data-Keys Order

1

Billing address

order-billing-company

order-billing-company-extra

order-billing-title

order-billing-first-name

order-billing-last-name

order-billing-street

order-billing-street-number

order-billing-street-additional

order-billing-zip

order-billing-city

order-billing-country

order-billing-state-code

order-billing-phone

SC_shop_invoice_delivery5.png

2

Shipping address

The same DataKeys are used here as in the billing address, but the prefix is order-shipping (instead of order-billing)
(E.g. Street = order-shipping-street)

Rechnungsdaten

order-invoice-number

order-invoice-date

order-item-number

order-item-name

3

order-item-quantity

4

order-item-product-price

5

order-item-sum

6

order-price-net

7

order-standard-vat

order-reduced-vat

8

order-total-standard-vat

order-total-reduced-vat

The standard (19%) or reduced rate (7%) can be selected in the printformer for each product.

order-shipping-price

9

order-price-gross

SC_shop_invoice_delivery6.png

Attributes

Name

Value

Description

Attribute

self-destruct

true, false
(Default: false)

Special attribute for invoice/delivery note feature: as soon as a placeholder has been initially filled, it disappears

media-hunter

static

This media hunter can be used to refer to the one stored in the system (unter Settings > Logos)

data-key-value

pf-client-logo

This attribute is used to output the logo as an image in the subsequent PDF (currently only e-mail logo possible)

separator

(freely selectable)
(Default: , )

Definition of the separator character when using multiple DataKeys within a placeholder, e.g. space.

Settings

The Name of the attribute is always entered as settings, the value must be inserted in JSON format.

text-overflow-behaviour

clip, add-page, clone-page
Default: clip

Only used for PDF generation. This setting controls the behaviour if a text block overflows.

  • clip = Text is cut off

  • clone-page = Page is duplicated, the overflow text ends up in the same block on the new page

  • add-page = this will add the template defined as an additional page as a new page, see Shop settings (if no template is assigned for additional pages, the same page will be added empty)

  • important: the block must have a block-name here! And it must also exist on the new page.

block-name

(freely selectable)

is required for the text-overflow-behaviour attribute so that the overflowing text can be used on the added page

This attribute must be included with the same value in both templates (for invoice/delivery note).

Conditions

Als der Name des Attributs wird immer condition-json eingegeben, der Wert muss im JSON-Format eingefügt werden.

condition-json is always entered as the Name of the attribute; the value must be inserted in JSON format.

CODE
{
  "left": "${pf-meta-page}",
  "operator": "equal",
  "right": "${pf-meta-pages}"
}

This condition ensures that the total invoice amount is only displayed on page 1 if the invoice only requires one page.

CODE
{
  "left": "${order-total-standard-vat}",
  "operator": "not-equal",
  "right": "0,00"
}
CODE
{
  "left": "${order-total-reduced-vat}",
  "operator": "not-equal",
  "right": "0,00"
}

This determines that only the VAT is shown at 19% (DataKey order-total-standard-vat) or 7% (order-total-reduced-vat) if it was used for products included in the invoice.

CODE
{
    "left": "${pf-client-person}",
    "operator": "not-equal",
    "right": ""
}

This deletes the line break (footer) if no management has been specified in the system.

Shop Settings

Two templates can be assigned in the settings under Shop > Invoice or Delivery note; for the first page (incl. letterhead) and for each additional page.

An order number prefix can be entered for invoices

The checkbox (Use default configuration) must be deactivated in each case.

SC_shop_invoice_delivery7.png
SC_shop_invoice_delivery8.png

Generating

There are now buttons on the order that can be used to generate and download the respective invoice or delivery note.

SC_shop_invoice_delivery9.png

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.