Extended
This profile constitutes an extension of EN16931 aimed at supporting complex business processes (i.e. invoices which are being invoiced across multiple deliveries or delivery locations, structured terms of payment, further details at item level to facilitate warehousing etc.), and any business case inventoried in France (gathered in a subset named EXTENDED B2B FR and its subset EXTENDED-CTC-FR, as referenced by the French Tax Administration and National Platform PPF – Portail Public de Facturation). This includes additional code lists values which are not part of the European Norm EN 16931 code lists.
Basic Usage
Install the Profile
npm install @node-zugferd/extended@betaSetup the Profile
Register the profile when creating your zugferd instance:
import { basicWL } from "@node-zugferd/extended";
import { zugferd } from "node-zugferd";
export const invoicer = zugferd({
profiles: [extended],
});Define Invoice Data
Provide invoice data that satisfies the requirements of this profile.
import type { invoicer } from "@/lib/invoicer";
const data: typeof invoicer.$Infer.Input.Extended = {
exchangedDocument: {
invoiceNumber: "471102",
// ...
},
// ...
};Generate Invoice
Create the invoice and embed it into a PDF/A document or serialize it for further processing.
import { invoicer } from "@/lib/invoicer";
import { data } from "./data";
import { readFile } from "node:fs/promises";
const invoice = await invoicer.create("extended", data);
const xml = invoice.toXML();
const pdfA = await invoice.toPDF(
await readFile("./my-invoice.pdf"),
);