Download the PHP package mahdiabderraouf/facturx-php without Composer
On this page you can find all versions of the php package mahdiabderraouf/facturx-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mahdiabderraouf/facturx-php
More information about mahdiabderraouf/facturx-php
Files in mahdiabderraouf/facturx-php
Package facturx-php
Short Description A PHP package for managing Factur-x/ZUGFeRD compliant PDF invoices
License MIT
Homepage https://github.com/mahdiabderraouf/facturx-php
Informations about the package facturx-php
Factur-X PHP
A PHP library for managing Factur-x/ZUGFeRD compliant PDF invoices.
Table of Contents
- Factur-X PHP
- Table of Contents
- Features
- Requirements
- Installation
- Using composer
- Documentation
- Usage
- Generate minimum profile XML
- Validate XML against XSD
- Generate a Factur-X PDF
- Parse Factur-X PDF
- Bug reports
- Contributions
- Roadmap
Features
- XML generation: Generate Factur-X XML file from an
Invoice
object, supportsminimum
,basicwl
andbasic
profiles. - PDF generation: Generate PDF-A3b Factur-X invoice from a given PDF file and a generated/provided XML file.
- XML validation: Validates Factur-X XML against the offical Extension Schema Definition (XSD).
- Parsing: Extract XML file from a Factur-X.
Requirements
- PHP version:
>= 8.1
- poppler-utils for XML extraction
Installation
Using composer
Documentation
The full documentation can be found here.
Usage
Here are some quick examples of usage. For advanced usage please refer to the documentation
Generate minimum profile XML
Validate XML against XSD
Validate Factur-X XML against XSD. The XML source can be either a PDF file path, an XML file path or an XML string.
Generate a Factur-X PDF
Using the static method Generator::generate
you can embed an XML into a PDF file to generate a Factur-X file.
To ensure the integrity of every Factur-X file, the XML is validated before being embedded, so there is no need to validate it beforehand.
Please note about attachment relationship:
- The only relationships that can be used for the XML file are
Data
,Source
andAlternative
. - In Germany the only relationship allowed is
Alternative
. - For profiles
minimum
andbasicwl
only the relationshipData
is allowed. - It is not recommanded to use the relationship
UNSPECIFIED
when adding additional attachments.
If you are generating invoices in Germany, the profiles minimum
and basicwl
are not considered legally as an invoice since they don't contain enough information. Same rule will be applied in France in the future so you should be using at least the basic
profile.
Parse Factur-X PDF
Parse a Factur-X PDF file, the parser will look by default for files factur-x.xml
and zugferd-invoice.xml
.
Please note that the filename zugferd-invoice.xml
is not used since the version 2.3 of ZUGFeRD.
You can specify the files you want to search for
Bug reports
Create an issue using the bug report template.
Contributions
Contributions are welcome, here are some guidelines:
- Code must be PSR-12
- Provide an explanation of the changes
- Provide the reason for the changes
- If needed, update the documentation and provide an example.
Roadmap
- Add support for generating
en16931
andextended
profiles - Factur-X parsing: parse a Factur-X file to an
Invoice
object.