EInvoice for Pascal 0.9.0-beta.2: e-invoices for Delphi and Free Pascal EInvoice for Pascal is an open-source library for electronic invoices according to EN 16931, for Delphi 6 through Delphi 13 and Free Pascal 3.2.2+ (Windows, Linux, macOS), from one code base. It reads, writes, checks and validates XRechnung, ZUGFeRD / Factur-X and Peppol BIS Billing, without Java, without MSXML and without a DLL. XML is handled by LandrixXML for Pascal (MIT licence), included as a submodule.
Repository: https://github.com/LandrixSoftware/EInvoice-for-Pascal Release: https://github.com/LandrixSoftware/EInvoice-for-Pascal/releases/tag/v0.9.0-beta.2 This is a beta: the API may still change until 1.0. WHAT IT DOES Read and write - XRechnung 3.0.2 (UBL and CII), ZUGFeRD 2.5.2 / Factur-X 1.09.2 (MINIMUM to EXTENDED) and Peppol BIS Billing 3.0.21. - Read the invoice embedded in a ZUGFeRD / Factur-X PDF (the library does not write PDF). - Three levels: the semantic model TLandrixInvoice (the TInvoice of XRechnung-for-Delphi) and the syntax models generated from the schemas, TLandrixCII... (everything Factur-X EXTENDED has) and TLandrixUBL..., for what the semantic model does not cover. Check before writing - About 380 rule identifiers (EN 16931, XRechnung, Peppol BIS with its national rules) and the 366 Factur-X code list asserts. Every rule family is compared with an official reference: the KoSIT test suite, the KoSIT validator, the OpenPEPPOL unit tests. - An invalid invoice is not written; it is refused with the findings. Validate without Java - Documents against the official KoSIT configurations (XML schema and Schematron), natively in Pascal, with the same verdict as the KoSIT validator. Reports as XML and HTML. - For ZUGFeRD / Factur-X PDFs also the embedding of the invoice and the XMP metadata (the BR-HYBRID rules of the specification). - New in 0.9.0-beta.2: the KoSIT report itself, made with the configuration's report stylesheet and the XSLT 2.0 engine of LandrixXML. Compared byte for byte with the KoSIT validator's on more than 3,000 documents; only what differs by nature may differ (time, engine name, document reference, wording of parser messages, form of the locations for Peppol and ZUGFeRD). - New in 0.9.0-beta.2: the KoSIT XRechnung visualization (UBL or CII to HTML, German or English), byte for byte the same as Saxon, checked on the KoSIT test invoices and about 1,100 further examples. Show - Invoices as HTML or Markdown, in English or German, with every field of the model. Move over - Compatibility units for XRechnung-for-Delphi (same names, change the uses clause) and a guide for ZUGFeRD-for-Delphi users. - Examples for Delphi and Lazarus, among them Workbench: a window (VCL and LCL) to create, open, check and show invoices. Tested with - Delphi 6, 7 and 13 (Win32 and Win64, also with range checks), Delphi 13 macOS ARM64 (compile only), Free Pascal 3.2.2, 3.2.4 and 3.3.1 on Windows (x86, x64, ARM64), Linux and macOS. SMALL EXAMPLE uses LandrixEInvoiceTypes, LandrixEInvoiceSpecs, LandrixEInvoiceInvoice, LandrixEInvoice; // write TLandrixEInvoice.SaveToFile(Invoice, 'invoice.xml', TLandrixEInvoiceTargets.XRechnung('3.0', esy_UBL)); // read XML or a ZUGFeRD / Factur-X PDF Doc := TLandrixEInvoice.LoadFromFile('invoice.pdf'); try WriteLn(string(Doc.Invoice.InvoiceNumber)); finally Doc.Free; end; DOWNLOAD git clone --recurse-submodules https://github.com/LandrixSoftware/EInvoice-for-Pascal.git or the ZIP on the release page (EInvoice-for-Pascal-0.9.0-beta.2.zip), which, unlike GitHub's source archives, contains LandrixXML. Then add "source" and "external/landrix-xml/source" to the search path; see docs/getting-started.md. WHAT COMES NEXT Planned: - Native PDF/A-3 checking: the PDF/A conformance of a ZUGFeRD / Factur-X PDF, with veraPDF as the reference. First file structure, actions and forms and the XMP metadata, then colour, transparency and fonts. The material for it (veraPDF and its test corpus) is already set up. - The way to 1.0: freeze the API. Before that we decide on the last extensions of the model, such as several payment terms, or card and account in one means of payment. Under consideration: - More national formats: Croatia (CIUS-HR on UBL) and the Polish KSeF, at first for reading only. - PDF output as an add-on outside the core, also for a visible ZUGFeRD / Factur-X PDF with the XML embedded. LICENCE AND FEEDBACK Dual licence: GPL-3.0-or-later or the Landrix Software Commercial License (see the README). Feedback, bug reports and files that break something are welcome as GitHub issues. Please report security problems privately (see SECURITY.md), and never attach real invoices with personal data. _______________________________________________ fpc-pascal maillist - [email protected] https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
