FacturXInvoice

data class FacturXInvoice(val invoiceNumber: String, val issueDateYyyymmdd: String, val sellerName: String, val buyerName: String, val currencyCode: String, val taxBasisTotal: String, val taxTotal: String, val grandTotal: String, val duePayable: String, val typeCode: String = "380", val sellerVatId: String? = null, val sellerCountryCode: String? = null)

Minimal ZUGFeRD / Factur-X invoice carrying the fields of the EN 16931 MINIMUM profile — the smallest conformance level a Factur-X factur-x.xml may declare.

The MINIMUM profile is deliberately tiny: it covers the parties, the document identity, the currency, and the four monetary totals a tax authority needs to recognise the document as an invoice. It is not sufficient for fully automated booking (no line items, no payment terms) — for those, model the richer BASIC / EN 16931 / EXTENDED profiles.

Build the XML with toXml and embed it next to the human-readable pages with PdfTools.attachFacturX (JVM/Desktop) so a single PDF carries both the visual invoice and its machine-readable companion.

Honest scope: this models the MINIMUM profile only and performs no semantic validation (it will happily emit totals that do not add up). Run the output through a Factur-X validator (e.g. the Mustangproject validator or the FNFE-MPE online checker) before relying on it in production.

Monetary amounts are passed as already-formatted decimal strings (e.g. "100.00") so the caller controls rounding and decimal separator — the XML requires a .-separated decimal with no thousands separator.

Constructors

Link copied to clipboard
constructor(invoiceNumber: String, issueDateYyyymmdd: String, sellerName: String, buyerName: String, currencyCode: String, taxBasisTotal: String, taxTotal: String, grandTotal: String, duePayable: String, typeCode: String = "380", sellerVatId: String? = null, sellerCountryCode: String? = null)

Properties

Link copied to clipboard

the buyer's trading name (ram:BuyerTradeParty).

Link copied to clipboard

the invoice currency as an ISO 4217 code, e.g. "EUR".

Link copied to clipboard

the amount actually due for payment (ram:DuePayableAmount), as a decimal string — usually equal to grandTotal unless a prepayment was made.

Link copied to clipboard

the invoice total including tax (ram:GrandTotalAmount), as a decimal string.

Link copied to clipboard

the invoice identifier (ram:ID). Required.

Link copied to clipboard

the issue date as a yyyyMMdd string (the format MINIMUM mandates, format="102"), e.g. "20260607".

Link copied to clipboard

the seller's ISO 3166-1 alpha-2 country code, e.g. "DE".

Link copied to clipboard

the seller's trading name (ram:SellerTradeParty).

Link copied to clipboard
val sellerVatId: String? = null

the seller's VAT registration id (schemeID="VA"); null omits the VAT registration element.

Link copied to clipboard

the sum of all line net amounts before tax (ram:TaxBasisTotalAmount), as a decimal string.

Link copied to clipboard

the total tax amount (ram:TaxTotalAmount), as a decimal string. MINIMUM requires the currency on this element specifically.

Link copied to clipboard

the UNTDID 1001 document type code; defaults to "380" (commercial invoice). "381" is a credit note.

Functions

Link copied to clipboard

Builds the CrossIndustryInvoice XML for this invoice, declaring the Factur-X MINIMUM profile (urn:factur-x.eu:1p0:minimum).