- "e-" as electronic invoice
- "e-" as "€uro invoice" conforming to an european CIUS “Core Invoice Usage Specification”. Of course you can use any currency.
The goal is to have a jar, which can be used to create a valid xml invoice conforming to franco-german XRechnung or european standard EN16931-1:2017.
The goal is not to build a validator for a xml invoice. For this use EN-16931 - Validation artefacts or XRechnung validator.
defines a semantic data model for a core invoice. This "€uro invoice" standard uses two syntax schemes alternatively. You have a choice:
- UN/CEFACT Cross Industry Invoice XML message, SCRDM-CII(zip)
- OASIS Universal Business Language (UBL 2.1) for invoice and credit note, ISO/IEC 19845:2015
Link to eu/cefdigital and a rough overview on CEN/Technical Committee TC 434 and EN 16931. Link to comparison UN/CEFACT vs. UBL.
The EN16931 data model contains many optional elements. Specific countries, groups, or organisations may create individual specifications for the core model in their respective domains (known as a ‘CIUS’).
A “Core Invoice Usage Specification” (CIUS) is a specification that provides a seller with detailed guidance, explanations and examples, as well as rules (business rules) related to the actual implementation and use of structured information elements present in the core invoice model in a specific trading situation. An instance document created following a given CIUS shall always be compliant with the European Standard EN16931-1:2017. [peppol.eu]
- Registry of CIUS (Core Invoice Usage Specifications) and Extensions
- XRechnung(de) is a german specification (CIUS) for EN16931 and is part of ZUGFeRD
- the french counterpart is called Factur-X(en) (fr)
this snippet creates a valid xml invoice similar to (xrechnung-testsuite)
static final String PROFILE_XRECHNUNG = CoreInvoice.PROFILE_XRECHNUNG;
static final DocumentNameCode CommercialInvoice = DocumentNameCode.CommercialInvoice;
static final String EUR = "EUR";
...
CoreInvoice invoice = GenericInvoice.getFactory().createInvoice(PROFILE_XRECHNUNG, CommercialInvoice);
invoice.setId("123456XX");
invoice.setIssueDate("2016-04-04");
invoice.addNote("Es gelten unsere Allgem. Geschäftsbedingungen, die Sie unter […] finden."); // optional
invoice.setDocumentCurrency(EUR);
invoice.setOrderReference("1234567890"); // optional
invoice.setBuyerReference("04011000-12345-34");
...
CoreInvoiceLine line = invoice.createInvoiceLine("1" // invoice line number
, new Quantity("XPP", new BigDecimal(1))
, new Amount(EUR, new BigDecimal(288.79)) // line net amount
, new UnitPriceAmount(EUR, new BigDecimal(288.79)) // price
, "Zeitschrift [...]" // itemName
, TaxCategoryCode.StandardRate, new BigDecimal(7)); // VAT category code, rate 7%
invoice.addLine(line);
...
transformer.fromModel(invoice); // returns byte[] xml
- more de-examples
- in AD-e-invoice the jar is used to create invoices within an ERP-System.