Skip to content

Commit

Permalink
v 2.0.0 (#60)
Browse files Browse the repository at this point in the history
* Drop support for PHP 7
* Set project php version to 8.1
* Fix issue in ZUGFeRD 10 Trade Agreement
* Remove supported PHP version (7.4) from github actions tests
* Add PHP 8.3 to github actions tests
* Add composer.phar to .gitignore
* Add phpstan as dependency
* Add new make command to run the tests with php83
* Remove deprecated make commands for tests
* Add github action workflow for phpstan
* Fix naming of phpstan workflow
* Use rector to change annotation to attributes
* Fix test using ProcuringProject instead of LogisticsServiceCharge
* Fix code issues in various files
* Fix issues with cs fix
* Fix issues with zugferd10 xml property sorting
* Fix issues with zugferd10 xml property sorting
* Dump php version of github actions to the smallest supported php version of the project
* Add declare strict types
* Drop deprecated Address object
* Add strict types to every php file
* Clean up code in zugferd211
* Add phpstan.neon
* Make phpstan ignore zugferd10
* Fix issue in DocumentLineDocument with the type of the notes property
* Specify type for schemeID in ID
* Add BillingSpecifiedPeriod to HeaderTradeSettlement
* Add new test case to test BillingSpecifiedPeriod and various new things that will be added
* Move references xmls to the appropriate places
* Add missing field ContractReferencedDocument to HeaderTradeAgreement
* Scope rector path only to zugferd211
* Extend on testcase testBuildXRechnung and include the properties BuyerOrderReferencedDocument, ContractReferencedDocument and AdditionalReferencedDocument
* Add missing AppliedTradeAllowanceCharge to TradePrice
* Extend on testcase to include AppliedTradeAllowanceCharge in TradePrice
Add static builder for TradePrice
* Add static constructor to TradeTax 
* Add fields ExemptionReasonCode, TaxPointDate, DueDateTypeCode to TradeTax
* Change Test to include TradeTax with Category G (Export out of eu) and the appropriate vatex exemption reason code
* Use correct ramid in test
* Fix PHPStan

* Add missing model for LegalOrganization
* Add fields RoleCode, Description and SpecifiedLegalOrganization to TradeParty
* Rename namespace Easybill\ZUGFeRD211\ to Easybill\ZUGFeRD2\
* Check in schemas for ZUGFeRD 2.2
* Move old test to legacy subdir
* Check in official ZUGFeRD 2.2 xml examples
* Add test for BASIC_Einfach.xml
* Add test for BASIC_Rechnungskorrektur.xml
* Add test for BASIC_Taxifahrt.xml
* Remove Constants Class. Move consts to builder class
* Add test for example MINIMUM_Rechnung.xml
* Add test for example MINIMUM_Buchungshilfe.xml
* Add test for XRECHNUNG_Einfach.xml 
* Split tests in different files with names signaling the used profile
* Add test for XRECHNUNG_Reisekostenabrechnung.xml
* Add test fir XRECHNUNG_Reisekostenabrechnung
* Add test fir XRECHNUNG_Betriebskostenabrechnung
* Add test for XRECHNUNG_Betriebskostenabrechnung.xml'
* Add test for EXTENDED_InnergemeinschLieferungMehrereBestellungen
* Add BusinessProcessSpecifiedDocumentContextParameter to ExchangedDocumentContext
* Add SellerTaxRepresentativeTradeParty to HeaderTradeAgreement
* Add BuyerOrderReferencedDocument to LineTradeAgreement
* Add LineId to ReferencedDocument
* Add URIUniversalCommunication to TradeParty
* Add test for EN16931_Einfach.xml
* Add reference file for test with legal organisation
* Add testcase for extended profile to included legal organisation
* Fix TradePrice. AppliedTradeAllowanceCharge is unbound.
* Remove broken Test
* Fix cs style
* Update Readme
* Fix SellerAssignedID in ZUGFeRD 1.0
  • Loading branch information
BolZer authored Mar 11, 2024
1 parent e165cb8 commit 30d4bcd
Show file tree
Hide file tree
Showing 218 changed files with 25,098 additions and 11,387 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
include:
- { operating-system: 'ubuntu-latest', php-version: '8.2', dependencies: '' }
- { operating-system: 'ubuntu-latest', php-version: '8.1', dependencies: '' }

name: PHP ${{ matrix.php-version }}

Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/phpstan.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: PHPStan

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
include:
- { operating-system: 'ubuntu-latest', php-version: '8.1', dependencies: '' }

name: PHP ${{ matrix.php-version }}

steps:
- uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
coverage: pcov
tools: composer:v2

- name: Install dependencies
run: |
composer install --no-interaction --prefer-dist --no-progress ${{ matrix.dependencies }}
- name: Analyze code for issues
run: |
php vendor/bin/phpstan analyse src --level 8
4 changes: 2 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
strategy:
matrix:
include:
- { operating-system: 'ubuntu-latest', php-version: '7.4', dependencies: '--ignore-platform-req=php' }
- { operating-system: 'ubuntu-latest', php-version: '8.0', dependencies: '--ignore-platform-req=php' }
- { operating-system: 'ubuntu-latest', php-version: '8.1', dependencies: '' }
- { operating-system: 'ubuntu-latest', php-version: '8.2', dependencies: '' }
- { operating-system: 'ubuntu-latest', php-version: '8.3', dependencies: '' }


name: PHP ${{ matrix.php-version }}

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ vendor
.phpunit.result.cache
.php-cs-fixer.cache
.vscode
composer.phar
20 changes: 13 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,23 @@ make:
test:
./vendor/bin/phpunit

test74:
docker run --rm -v $(current_dir):/app -w /app php:7.4 vendor/bin/phpunit

test8:
docker run --rm -v $(current_dir):/app -w /app php:8.0 vendor/bin/phpunit

test81:
docker run --rm -v $(current_dir):/app -w /app php:8.1 vendor/bin/phpunit

test82:
docker run --rm -v $(current_dir):/app -w /app php:8.2 vendor/bin/phpunit

test83:
docker run --rm -v $(current_dir):/app -w /app php:8.3 vendor/bin/phpunit

cs-fix:
./vendor/bin/php-cs-fixer fix --config .php-cs-fixer.dist.php
PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --config .php-cs-fixer.dist.php

phpstan:
./vendor/bin/phpstan analyse

rector:
./vendor/bin/rector process

rector-dry-run:
./vendor/bin/rector process --dry-run
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ $xml = Builder::create()->getXML($doc);
echo $xml; // Zugferd XML.
```

## Usage ZUGFeRD v2.1
## Usage ZUGFeRD v2

Convert XML to PHP Objects:

```php
use Easybill\ZUGFeRD211\Reader;
use Easybill\ZUGFeRD2\Reader;

$xml = file_get_contents('factur-x.xml');
$obj = Reader::create()->transform($xml);
Expand All @@ -54,7 +54,7 @@ $obj = Reader::create()->transform($xml);
Convert PHP Objects to XML:

```php
use Easybill\ZUGFeRD211\Builder;
use Easybill\ZUGFeRD2\Builder;

$obj = ...;

Expand Down
14 changes: 10 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,14 @@
{
"name": "Patrick Romowicz",
"email": "[email protected]"
},
{
"name": "Jan Nöhles",
"email": "[email protected]"
}
],
"require": {
"php": "^7.4 || ^8.0",
"php": "^8.1",
"jms/serializer": "^3.16",
"ext-dom": "*"
},
Expand All @@ -24,18 +28,20 @@
"require-dev": {
"phpunit/phpunit": "^9.3",
"ext-libxml": "*",
"friendsofphp/php-cs-fixer": "^3.16"
"friendsofphp/php-cs-fixer": "^3.16",
"phpstan/phpstan": "^1.10",
"rector/rector": "^1.0"
},
"autoload": {
"psr-4": {
"Easybill\\ZUGFeRD\\": "src/zugferd10",
"Easybill\\ZUGFeRD211\\": "src/zugferd211"
"Easybill\\ZUGFeRD2\\": "src/zugferd2"
}
},
"autoload-dev": {
"psr-4": {
"Easybill\\ZUGFeRD\\": "tests/zugferd10",
"Easybill\\ZUGFeRD211\\": "tests/zugferd211"
"Easybill\\ZUGFeRD2\\": "tests/zugferd2"
}
},
"config": {
Expand Down
Loading

0 comments on commit 30d4bcd

Please sign in to comment.