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

Summand Pro 0.5.0 released

Summand Pro can now write e-invoices, not only read them: XRechnung and EN 16931 as UBL or CII from a typed invoice object, always checked with Summand, plus ZUGFeRD PDFs and a convert command.

By Seya Weber

Summand Pro 0.5.0 is out. The new package @weber-development/summand-write and version 0.5.0 of summand-read, summand-view and summand-inbox are on GitHub Packages for licence holders.

Why

Since 1 January 2025 every German business has to be able to receive e-invoices, and sending them follows. Most invoice software writes the XML and hopes for the best. Summand already knew how to find every problem in an e-invoice. With 0.5.0 it uses that knowledge on the way out: an invoice you write is checked before it leaves your code.

What is new in 0.5.0

summand-write. writeInvoice() turns a typed Invoice object into XRechnung 3.0 or EN 16931 as UBL 2.1 (Invoice and CreditNote) or CII D16B.

  • The output is checked with Summand. If the invoice has errors, writeInvoice() throws and tells you which, unless you ask for it anyway.
  • The writer is the exact inverse of the reader. After writing, Summand reads the XML back and compares it with your input. A value the target syntax cannot carry throws an error; nothing is dropped silently.
  • computeTotals() calculates the line amounts, the VAT breakdown and the document totals from your lines, with exact decimal arithmetic and correct rounding. It is off by default, so your own numbers are used as given.
  • writeInvoicePdf() produces a ZUGFeRD / Factur-X PDF with the CII XML attached.
import { readInvoice } from "@weber-development/summand-read";
import { writeInvoice } from "@weber-development/summand-write";

const invoice = readInvoice(ublXml);
const { xml, ok } = writeInvoice(invoice, { syntax: "cii", profile: "xrechnung" });

Converting from the command line. summand-inbox convert invoice.xml --to cii --profile xrechnung -o invoice-cii.xml reads an invoice, writes it in the other syntax and checks it.

How well it works. We read, wrote, checked and read back every sample invoice we have: 86 of 86 round trips in the same syntax, 86 of 86 across UBL and CII, and 42 of 42 conversions between the XRechnung and EN 16931 profiles. Two limits are worth knowing: UBL cannot carry an order line reference without an order number, and some CII details have no UBL place. In those cases the writer says so instead of guessing.

Peppol envelopes, the other ZUGFeRD profiles and extensions are not covered yet.

Next

Matching invoices against purchase orders, and keeping the rule sets up to date with notifications. The free package gets the Peppol BIS rules once their licence is cleared.

Licence holders upgrade with pnpm add @weber-development/summand-write@latest. New to Summand Pro? See pricing and licences.

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 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
Release

Summand Pro 0.3.0 released

Summand Pro now fetches e-invoices straight from a mailbox, over IMAP or Microsoft 365, and drops them into the watched inbox folder. Summand Pro is now on sale.

Summand
Release

Summand Pro 0.4.0 released

Summand Pro now writes a proper A4 PDF of every invoice: PDF/A-3b, selectable text, page numbers, the validation report and the original XML attached, so CII invoices stay valid ZUGFeRD files.

Summand