Giter Site home page Giter Site logo

easybill / zugferd-php Goto Github PK

View Code? Open in Web Editor NEW
55.0 18.0 33.0 3.07 MB

ZUGFeRD PHP SDK (Factur-X, XRechnung)

Home Page: https://www.easybill.de

License: MIT License

PHP 31.71% Makefile 0.06% XSLT 68.23%
zugferd-php zugferd xrechnung factur-x

zugferd-php's Introduction

ZUGFeRD PHP

Latest Stable Version Total Downloads Latest Unstable Version License Gitter

ZUGFeRD PHP SDK (Factur-X, XRechnung) - Convert PHP Objects to XML and back.

Look @ Tests for more details

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.

zugferd-php's People

Contributors

bitbirddev avatar blackgwe avatar bolzer avatar chrisb9 avatar derklaro avatar guillaume-sainthillier avatar maximiliankresse avatar mxsxs2 avatar olleharstedt avatar patromo avatar peter279k avatar t-r3x avatar upsite4k avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zugferd-php's Issues

Missing dependency doctrine/annotations since jms/serializer:3.30.0

In version 3.30.0 of jms/serializer the dependency on doctrine/annotations was dropped. (See schmittjoh/serializer#1471)

This causes the parsing of xml to fail because the serializer cannot read the annotations anymore if the project using this library does not explicitly require doctrine/annotations.

This issue could be solved by either depending on doctrine/annotations or by converting the annotations to php attributes.

FeatureRequest: Add TradeParty->GlobalID and Testindicator

First of all, thanks for this great package! I'm using it for a little test project right now. for this project i've to use the comfort version of zugferd - which requires a schemeID for the GlobalID-Node in the TradeParty-Node. Can you please add the possibility to add a value for the schemaID?

Would it also be possible to add the Testindicator-Node?

That would be just wonderful!

Missing ExemptionReason in TradeTaxType

In the file "FACTUR-X_EN16931_urn_un_unece_uncefact_data_standard_ReusableAggregateBusinessInformationEntity_100.xsd" there is a "ExemptionReason" in "TradeTaxType", that is missing in zugferd211/Model/TradeTax.php.

PHP 7.4 required?

Any critical constructs used from PHP 7.4 that makes this library unusable for PHP 7.2?

Bug in src/zugferd10/Model/Trade/Agreement.php

Hi,

in file

src/zugferd10/Model/Trade/Agreement.php

the function has an error:

Is:

public function getBuyerReference() { return $this->name; }

Should be:

public function getBuyerReference() { return $this->buyerReference; }

Uncaught Error: Class 'DOMDocument' not found

[Wed Nov 25 22:50:36.855512 2020] [proxy_fcgi:error] [pid 26804:tid 140112159565568] [client 93.208.26.207:50344] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught Error: Class 'DOMDocument' not found in /srv/www/vhosts/domain/httpdocs/xrechnung/vendor/jms/serializer/src/XmlSerializationVisitor.php:99\nStack trace:\n#0 /srv/www/vhosts/domain/httpdocs/xrechnung/vendor/jms/serializer/src/XmlSerializationVisitor.php(90): JMS\Serializer\XmlSerializationVisitor->createDocument()\n#1 /srv/www/vhosts/domain/httpdocs/xrechnung/vendor/jms/serializer/src/Visitor/Factory/XmlSerializationVisitorFactory.php(47): JMS\Serializer\XmlSerializationVisitor->__construct()\n#2 /srv/www/vhosts/domain/httpdocs/xrechnung/vendor/jms/serializer/src/Serializer.php(146): JMS\Serializer\Visitor\Factory\XmlSerializationVisitorFactory->getVisitor()\n#3 /srv/www/vhosts/domain/httpdocs/xrechnung/vendor/jms/serializer/src/Serializer.php(158): JMS\Serializer\Serializer->getVisitor()\n#4 /srv/www/vhosts/domain/httpdocs/xrechnung/vendor/easybill/zugferd-php/src/zugferd211/Builder.php(20): JMS\Ser...'

Missing ReceivableSpecifiedTradeAccountingAccount, BT-133

Hi!

Thanks for your nice library! It seems like a field is missing for our use-case, correct me if I'm wrong.

System is German, GIZ Lieferantenporal.

Required field is BT-133, which seems to be called ReceivableSpecifiedTradeAccountingAccount

It should belong to this class, I think: https://github.com/easybill/zugferd-php/blob/master/src/zugferd211/Model/LineTradeSettlement.php

My source: https://portal3.gefeg.com/projectdata/invoice/deliverables/installed/publishingproject/factur-x%20%28zugferd%202.0%29%20%5Bdraft%5D/factur-x%3B%20draft%3B%20en16931-conformant-extended.scm/html/021.htm?https://portal3.gefeg.com/projectdata/invoice/deliverables/installed/publishingproject/factur-x%20%28zugferd%202.0%29%20%5Bdraft%5D/factur-x%3B%20draft%3B%20en16931-conformant-extended.scm/html/0244.htm

But there is says, name = "Booking reference". ๐Ÿค”

Another source says BT-133 = "Invoice line Buyer accounting reference"

Would you accept a PR?

PHP 7.4, unexpected 'ExchangedDocumentContext' (T_STRING)

Hi,

when I try to build a document I get this error:

PHP Parse error: syntax error, unexpected 'ExchangedDocumentContext' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in /var/app/data/vendor/easybill/zugferd-php/src/zugferd211/Model/CrossIndustryInvoice.php on line 26

I've tried php 7.2 to 8.1 but only got a progress on php 7.4. But there I get this error.

I've installed zugferd-php by composer and checked php modules. I'm using autoloader.

What am I doing wrong?

Add AllowanceCharge

Thanks for this package! Would it also be possible to add the AllowanceCharge (used in HeaderTradeSettlement)? I'll supply my implementation as a pull request.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.