Download the PHP package youniwemi/digital-invoice without Composer

On this page you can find all versions of the php package youniwemi/digital-invoice. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package digital-invoice

Digital Invoice

Digital Invoice offers a unified interface for generating and reading e-invoices across all major formats. It wraps easybill/zugferd-php, josemmo/einvoicing, and atgp/factur-x into a single, consistent API.

Supported Formats

Format Profiles Generate Read
Factur-X / ZUGFeRD 2.x MINIMUM, BASIC_WL, BASIC, EN16931, EXTENDED ✓ ✓
ZUGFeRD 1.0 CONFORT, BASIC, EXTENDED ✓ ✓
XRechnung — ✓ ✓
UBL Peppol, NLCIUS, CIUS-RO, CIUS-IT, CIUS-ES-FACE, CIUS-AT-NAT, CIUS-AT-GOV, Malaysia ✓ ✓

Installation

Requires PHP 8.3+ (easybill/zugferd-php 6).

Upgrading to 0.4

Generating an invoice

For UBL:

French e-invoicing (CTC reform)

The French rules (BR-FR, XP Z12-012) require a billing mode, electronic addresses and the legal notes:

In UBL, note subject codes are written as a #PMT#… prefix.

Credit notes

Pass a credit note type code (381, 396, 261…) and reference the credited invoice (BG-3, required by BR-FR-CO-05). Amounts stay positive; UBL output switches to a <CreditNote> document.

When read back, InvoiceData::isCreditNote() and InvoiceData::$precedingInvoices expose them.

Discounts

Add a document level allowance (BG-20) instead of a negative line, prices must stay positive (BR-27, BR-FR-DEC-03). The amount is deducted from the VAT basis of the given rate. Supported by Factur-X (BASIC WL and above) and UBL.

Supporting documents

Attach a supporting document (BG-24), e.g. a delivery note. It is embedded in the XML (base64) and, for PDF output, also attached to the PDF (AFRelationship /Supplement), visible in the attachment pane of Acrobat or Firefox. Supported by Factur-X (EN16931 and EXTENDED) and UBL.

The mime code must be one of AttachmentMimeCode (BR-CL-24): pdf, png, jpeg, csv, xlsx or ods, any other value throws an exception. The id is required, and so are the filename and the mime code when contents are given.

In France, BT-123 must be one of AttachmentDescription (BR-FR-17): BON_LIVRAISON, BON_COMMANDE, DOCUMENT_ANNEXE, RIB, PJA, BORDEREAU_SUIVI, BORDEREAU_SUIVI_VALIDATION, ETAT_ACOMPTE, FACTURE_PAIEMENT_DIRECT, RECAPITULATIF_COTRAITANCE, FEUILLE_DE_STYLE or LISIBLE (readable copy of the invoice, once at most). It is not checked, as it is free text outside France.

Some readers (macOS Preview, Chrome) do not show PDF attachments. To make PDF documents readable everywhere, append their pages after the invoice:

A PDF the free FPDI parser can not read (e.g. PDF 1.5+ with a compressed xref) is silently not appended, the document is still embedded in the XML. Appended pages are copied as is, a document that is not PDF/A may break the PDF/A-3 conformance of the invoice.

Reading an invoice

InvoiceReader auto-detects the format (CII/FacturX, ZUGFeRD 1.0, UBL) and returns a normalised InvoiceData object.

InvoiceData structure

TaxBreakdownData

PartyData

Rendering an invoice to HTML

InvoiceRenderer turns any parsed InvoiceData into a self-contained HTML fragment with inlined CSS. It supports custom templates, custom CSS, and three UI languages out of the box.

The default template (src/templates/invoice.html.php) and stylesheet (src/templates/invoice.css) can be replaced entirely. The template receives these variables:

Variable Type Description
$invoice InvoiceData The parsed invoice
$cur string Currency code
$labels array Translated UI strings
$esc Closure fn(?string): string — HTML-safe output
$fmt Closure fn(?float, string): string — formatted amount
$date Closure fn(?\DateTime): string — formatted date
$schemeLabel Closure fn(string): string — human label for ISO 6523 / tax scheme
$formatLabel Closure fn(string): string — human label for invoice format/profile

Interactive viewer

viewer.php provides a browser-based upload-and-preview page: upload any invoice file on the left, see the rendered HTML on the right, supporting documents can be downloaded. No files are stored server-side.

Key Features

Testing

Generated Factur-X and UBL invoices are also validated with the official FNFE artefacts: Factur-X / EN16931 profile rules, and French BR-FR rules for the French CTC profiles (Factur-X BASIC-WL, EN16931, EXTENDED and test/FrenchRulesTest.php). The rules are XSLT 2.0 and run with Saxon-HE, so Java is required. Download them once, these checks are skipped otherwise:

Development Status

Active development — API may change between minor versions.

Collaboration and contributions are welcome. Open an issue or PR for specific use cases or format requests.

Contributors

Credits


All versions of digital-invoice with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
easybill/zugferd-php Version ^6.0
atgp/factur-x Version ^1.0
milo/schematron Version dev-master
josemmo/einvoicing Version dev-master
jms/serializer Version ^3.30
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package youniwemi/digital-invoice contains the following files

Loading the files please wait ...