Skip to main content
Introducing packages.sweber.dev
All posts
Release2 min read

Summand 0.2.0 released

Summand now speaks German: every EN 16931 rule and every Summand check can be reported in German, from code with lang: "de" or in the CLI with --lang de.

By Seya Weber

Summand 0.2.0 is out. @sweberdev/summand 0.2.0 is on npm under the MIT licence.

Why

The people who fix a rejected e-invoice are mostly bookkeepers, not developers. Until now they got the original CEN messages in English, such as "Amount due for payment (BT-115) = Invoice total amount with VAT (BT-112) -Paid amount (BT-113) +Rounding amount (BT-114)." Only the XRechnung-specific rules were German. Most invoices fail on the EN 16931 rules, though, so the message that matters was usually the English one.

What is new in 0.2.0

  • German messages for every rule. All 1,400+ EN 16931 rule messages for UBL and CII and all of Summand's own checks (PDF, profile, Leitweg-ID) are now available in German. The XRechnung rules were already German.
  • Same ids, same locations. Rule id, severity, XPath and line number are identical in both languages, so you can log in English and show German to your users, or the other way round.
  • German CLI output. summand validate --lang de prints the summary line, the severities and the messages in German.
import { validateInvoice } from "@sweberdev/summand";

const result = validateInvoice(xml, { lang: "de" });
result.errors[0].message;
// "Fälliger Zahlungsbetrag (BT-115) = Gesamtbetrag der Rechnung mit Umsatzsteuer (BT-112)
//  - Gezahlter Betrag (BT-113) + Rundungsbetrag (BT-114)."
npx @sweberdev/summand validate --lang de rechnungen/*.xml rechnungen/*.pdf

The German texts use the terms of the German edition of EN 16931 (Verkäufer, Erwerber, Rechnungsposition, Umsatzsteueraufschlüsselung) and keep business term numbers such as BT-115, so they can be looked up in the standard. They ship inside the rule sets, which adds about 20 KB gzipped to the bundle.

Try it

The live demo has a new "Messages in German" switch. Pick the sample with errors and switch it on.

Next

The next free release adds XML Schema (XSD) validation for UBL and CII ahead of the Schematron rules, so Summand covers everything the KoSIT validator checks. Summand Pro gets a watched inbox folder that sorts invoices into valid, invalid and duplicate, and an export to the DATEV booking batch format.

Upgrade with pnpm add @sweberdev/summand@latest. The docs list the new lang option.

Package in this post

Summand

Validate XRechnung, ZUGFeRD and Factur-X e-invoices against EN 16931 in pure TypeScript: in Node, the browser and at the edge, without Java.

pnpm add @sweberdev/summand
View package

Related posts

Release

Summand 0.3.0 released

Summand now checks the official XML Schema of every invoice before the business rules, like the KoSIT validator: UBL 2.1 and UN/CEFACT CII D16B, in pure TypeScript and in under a millisecond.

Summand
Release

Summand 0.1.0 released

Validate XRechnung, ZUGFeRD and Factur-X e-invoices against the official EN 16931 and XRechnung rules in pure TypeScript: in Node, the browser and at the edge, without Java.

Summand
Release

Summand Pro 0.2.0 released

Summand Pro now watches your inbox folder, sorts every new e-invoice into valid, invalid and duplicate, and exports valid purchase invoices as a DATEV booking batch for your tax advisor.

Summand