easybill / zugferd-php
ZUGFeRD PHP SDK (Factur-X, XRechnung) - Convert PHP Objects to XML and back.
Installs: 163 865
Dependents: 3
Suggesters: 0
Security: 0
Stars: 76
Watchers: 20
Forks: 35
Open Issues: 5
Language:XSLT
Requires
- php: ^8.1
- ext-dom: *
- jms/serializer: ^3.16
Requires (Dev)
- ext-libxml: *
- friendsofphp/php-cs-fixer: ^3.16
- phpstan/phpstan: ^1.10
- phpstan/phpstan-strict-rules: ^1.5
- phpunit/phpunit: ^9.3
- rector/rector: ^1.0
- symfony/finder: ^5.4
Suggests
- ext-libxml: Needed for XSD validation
- dev-master
- v2.1.1
- v2.1.0
- v2.0.1
- v2.0.0
- v1.13.1
- v1.13.0
- v1.12.0
- v1.11.0
- v1.10.0
- v1.9.0
- v1.8.0
- v1.7.0
- v1.6.0
- v1.5.0
- v1.4.0
- v1.3.0
- v1.2.0
- v1.1.1
- v1.1.0
- v1.0.0
- v0.15-alpha
- v0.14-alpha
- v0.13-alpha
- v0.12-alpha
- v0.11-alpha
- v0.10-alpha
- v0.9-alpha
- v0.8-alpha
- v0.7-alpha
- v0.6-alpha
- v0.5-alpha
- v0.4-alpha
- v0.3-alpha
- v0.2-alpha
- v0.1.1-alpha
- v0.1-alpha
- dev-factur-x-2.3
- dev-dev
- dev-order-number
This package is auto-updated.
Last update: 2024-12-07 09:00:30 UTC
README
ZUGFeRD PHP SDK (Factur-X, XRechnung) - Convert PHP Objects to XML and back.
Installation
The recommended way of installing this library is using Composer.
Add this repository to your composer information using the following command
composer require easybill/zugferd-php
Usage ZUGFeRD v1
Convert XML to PHP Objects:
use Easybill\ZUGFeRD\Reader; $document = Reader::create()->getDocument('zugferd-file.xml'); echo $document->getHeader()->getId(); // Get invoice No.
Convert PHP Objects to XML:
use Easybill\ZUGFeRD\Builder; use Easybill\ZUGFeRD\Model\Document; $doc = new Document(Document::TYPE_COMFORT); $doc->getHeader()->setId('RE1337'); // Set invoice No. $xml = Builder::create()->getXML($doc); echo $xml; // Zugferd XML.
Usage ZUGFeRD v2
Convert XML to PHP Objects:
use Easybill\ZUGFeRD2\Reader; $xml = file_get_contents('factur-x.xml'); $obj = Reader::create()->transform($xml);
Convert PHP Objects to XML:
use Easybill\ZUGFeRD2\Builder; $obj = ...; $xml = Builder::create()->transform($obj); echo $xml; // Zugferd XML.
Contributing
Please feel free to send bug reports and pull requests.
License
Published as open source under the terms of MIT License.