13 Save to Database

13.1 Overview

The Save to database task transfers the invoice data into a Microsoft SQL Server table - optionally with an additional dedicated table for the invoice line items. The data is then directly available for analyses, dashboards, or follow-up systems.

Save to database task with the Database, Fields, and Options tabs

13.2 "Database" tab

Setting Meaning
Connection The database connection to use. Connections are managed centrally in the program options (see chapter 40.15); New… takes you straight there.
Database Target database on the server
Table Target table; Create new… creates a new table with the selected fields as columns
Line item table Only with line item saving enabled (see section 13.4)

13.3 "Fields" tab

The selected fields are stored as columns in the table. The field catalog is grouped by topic (invoice data, seller, buyer, amounts, payment, ...).

Fields tab of the database task with the grouped field catalog

The fields marked with * form the duplicate key (invoice number + invoice date + seller) and are always active.

13.4 "Options" tab

Setting Meaning
If an entry already exists (same invoice number, same invoice date, same seller) Overwrite entry, Skip (do not save again), or Skip and do not execute the following tasks (as of version 2.6.0) - this keeps the table free of duplicates even when the same invoice is processed again. The section below the table describes the difference between the two ways of skipping.
Additionally save invoice line items to a separate table Writes one row per invoice line item to the configured line item table (linked to the invoice entry). Columns: Invoice_ID, Position, Article number, Name, Description, Quantity, Unit, Unit price (net), Tax rate, Total amount and - for sub-lines (ZUGFeRD 2.5 EXTENDED) - Parent position and Line type. The table is created when needed; missing columns are added

Skipping: with or without the following tasks

  • Skip (do not save again): The following tasks of the profile continue. This fits catch-up: the invoice is already in the database, but is, for example, filed or printed again.
  • Skip and do not execute the following tasks: The following tasks no longer run for this file. If the database task comes first, the duplicate key thus protects the whole profile from processing the same invoice more than once - during catch-up as well (see chapters 8.3.2 and 60.2.3). Tasks that come before the database task run in any case.

Important with "Skip and do not execute the following tasks"

If a later task fails, for example sending, the record is already in the database. When the file is processed again and during catch-up, the program then skips the invoice completely - including the task that had failed. How to catch up the invoice:

  • Delete the record in the database and process the file again (see chapter 6.4), or
  • temporarily switch the choice to Skip (do not save again) and process the file again.