Skip to content

Database tables

This page describes a selection of tables that are often needed for analysis, support and connecting surrounding systems. The overview of the schemas is under Database. All tables have an Id column; most also have TenantId for the tenant.

One entry per document with the header data of the invoice.

ColumnMeaning
ExternalIdDocument number or barcode for users. Does not have to be technically unique.
ProcessIdProcess of the document (conf.Processes), for example overhead costs or materials management.
CurrencyCodeCurrency. For every currency used there should be an exchange rate in Mstr.CurrencyExchangeRates.
DocDateInvoice date.
ImportDateTime of import.
SupplierIdSupplier (Mstr master data).
GrossAmountTotalTotal gross amount.
EsrAccount, EsrReference, EsrCodeLineAccount, reference and coding line of a payment slip. For QR invoices the data is in PaymentReference and QrCodeContent.
LastInitializedNodeIdCurrent workflow step.

Tasks in the workflow. Each task belongs to a document and is assigned to a user or a role.

Lines (accounting lines) of a document with account, cost centre and amount.

History of a document: who performed which step and when.

Messages and comments on a document (columns Message, IrCaseId, CreatedUserId, CreatedDateUtc).

Given and rejected approvals per line (IrItemLineId), with user (UserId), level and, for rejections, the reason (Reason).

Absences of users (UserId, StartDateUtc, EndDateUtc).

Queue of the emails invoiceR sends (ReceiverEmail, Subject, SentDate). If SentDate is empty, the email has not been sent yet.

Alternative spellings (SourceText, AlternativeText), for example for recognizing terms.

One entry per file invoiceR has stored. The PDF itself is in the storage, not in the database.

ColumnMeaning
FileNameOriginal file name at upload.
RepositoryHandleIdentifier of the file in the storage, for example a file path or the archive document ID.
DocumentType1 invoice, 2 attachment, 3 report, 4 document.
DocumentRepositoryIdStorage used (conf.DocumentRepositories).
IrCaseIdRelated document.

The columns Name, MimeType, Description, FileSize and IconType are currently not evaluated.

One entry per file sent to a text recognition service (for example Parashift).

ColumnMeaning
State1 registered, 2 in progress, 3 finished, 4 error.
DocumentRecogniserIdText recognition service used (conf.DocumentRecognisers).
ServiceHandleIdentifier of the file at the recognition service, for later status queries.
LastLogLast message about the recognition.
StartTimeUtc, EndTimeUtcStart and end of the recognition.
IrCaseIdRelated document.

Defines which user may open which document in the archive. If there is an entry for user and document, opening is allowed. The table can become very large. The entries are calculated by a recurring job with the stored procedure dbo.CalculateCaseReadRightsForUser.

ColumnMeaning
IrCaseIdDocument.
UserIdUser.
IrCaseReadRightTypeReason for the entry: 1 history, 2 task owner, 3 assignment target, 4 approval target. The standard procedure always sets 1.
CreatorId, ContextOptional, to distinguish different sources. Currently not evaluated.

Connected storages and archives. Described under Document storage and archive.

Recurring jobs. Described under Recurring jobs.

Capture cards on the Reports page. Described under Setting up document capture.

Configuration of background components as JSON in Configuration, for example for the email import (see Mailbox connection).

Folders from which invoiceR imports files as new documents (WatchPath, Enabled). Further columns define default values for the documents (DefaultMandatorCode, DefaultProcessType, DefaultInvoiceType, DefaultSupplierCode) and whether files are split. For splitting a PDF into several documents by separator pages, DocumentSplitting contains a JSON:

{
"SplitDocuments": true,
"DocumentSeparators": [ "InvoiceR" ]
}

Additional buttons on individual fields in the accounting form (Name, Location, OptsIcon, OptsOnClick, AccountingFieldId, EnabledPermission).

Interface for surrounding systems that deliver new documents. The surrounding system writes a row, and invoiceR takes it over as a document shortly afterwards.

  • IndexedDate and ProcessedDate stay empty (NULL) on insert. invoiceR sets IndexedDate when it starts the import and ProcessedDate once the document has been created successfully. If ProcessedDate is still empty after a few minutes, the reason is in the log of the import job in the Hangfire dashboard.
  • Pass values that were not recognized as NULL, not as an empty string.
ColumnMeaning
TenantIdTenant, usually 1.
ExternalIdDocument number. By agreement with enio it can be empty; the database then assigns a number.
MandatorCodeCompany code or client in the ERP.
ProcessTypeGK for overhead costs (default), MM for invoices with an order reference.
DocFilePathLocation of the PDF: file path, UNC path or address with a scheme such as https://….
DocDate, ImportDateInvoice date and import time.
CurrencyCodeCurrency, for example CHF.
SupplierCodeSupplier number.
GrossAmountTotalTotal gross amount. Sufficient if no VAT needs to be shown.
GrossAmount1…4, NetAmount1…4, VatAmount1…4, VatRate1…4Amounts per VAT rate. For one rate only fill the fields ending in 1, for two rates also 2, and so on.
InvoiceTypeR for invoice.
OrderNumbers, DeliveryNumbersFor MM: recognized order and delivery numbers as a JSON array, for example ["B-2910","B-1001"].
INSERT INTO imp.IrCaseImports
(TenantId, ExternalId, MandatorCode, ProcessType, DocFilePath, CurrencyCode,
DocDate, ImportDate, SupplierCode, GrossAmount1, NetAmount1, VatAmount1, VatRate1,
GrossAmountTotal, InvoiceType)
VALUES
(1, N'2026-000123', N'100', N'GK', N'\\<server>\Import\invoice-123.pdf', N'CHF',
'2026-05-28', CURRENT_TIMESTAMP, N'10020', 108.10, 100.00, 8.10, 8.1,
108.10, N'R');

Order and delivery references from a surrounding system (ExternalIrCaseId, ExternalOrderId, OrderDate, ExternalDeliveryId, DeliveryDate). invoiceR sets ProcessedDateUtc after taking them over.