diff --git a/composer.json b/composer.json index 81372b6..4515132 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "easybill/e-invoicing", - "version": "0.2.2", - "description": "A package to read and create the formats: factur-x, Peppol BIS Billing, XRechnung (CII/UBL)", + "version": "0.2.3", + "description": "A package to read and create EN16931 e-invoices or CIUS like: XRechnung, ZUGFeRD etc.", "type": "library", "license": "MIT", "keywords": [ diff --git a/composer.lock b/composer.lock index 0a29aee..2710b79 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "5b17d51c5100bb0528bcb9475b334094", + "content-hash": "2fdb66387273df3d8a9ee0869283f74b", "packages": [ { "name": "doctrine/instantiator", @@ -602,24 +602,24 @@ }, { "name": "composer/semver", - "version": "3.4.2", + "version": "3.4.3", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6" + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/c51258e759afdb17f1fd1fe83bc12baaef6309d6", - "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6", + "url": "https://api.github.com/repos/composer/semver/zipball/4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", + "reference": "4313d26ada5e0c4edfbd1dc481a92ff7bff91f12", "shasum": "" }, "require": { "php": "^5.3.2 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^1.4", - "symfony/phpunit-bridge": "^4.2 || ^5" + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" }, "type": "library", "extra": { @@ -663,7 +663,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.2" + "source": "https://github.com/composer/semver/tree/3.4.3" }, "funding": [ { @@ -679,7 +679,7 @@ "type": "tidelift" } ], - "time": "2024-07-12T11:35:52+00:00" + "time": "2024-09-19T14:15:21+00:00" }, { "name": "composer/xdebug-handler", @@ -2307,16 +2307,16 @@ }, { "name": "phpstan/phpstan", - "version": "1.12.3", + "version": "1.12.4", "source": { "type": "git", "url": "https://github.com/phpstan/phpstan.git", - "reference": "0fcbf194ab63d8159bb70d9aa3e1350051632009" + "reference": "ffa517cb918591b93acc9b95c0bebdcd0e4538bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpstan/zipball/0fcbf194ab63d8159bb70d9aa3e1350051632009", - "reference": "0fcbf194ab63d8159bb70d9aa3e1350051632009", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/ffa517cb918591b93acc9b95c0bebdcd0e4538bd", + "reference": "ffa517cb918591b93acc9b95c0bebdcd0e4538bd", "shasum": "" }, "require": { @@ -2361,7 +2361,7 @@ "type": "github" } ], - "time": "2024-09-09T08:10:35+00:00" + "time": "2024-09-19T07:58:01+00:00" }, { "name": "phpunit/php-code-coverage", diff --git a/src/CII/Models/HeaderTradeSettlement.php b/src/CII/Models/HeaderTradeSettlement.php index 37b84a0..c4a6f67 100644 --- a/src/CII/Models/HeaderTradeSettlement.php +++ b/src/CII/Models/HeaderTradeSettlement.php @@ -70,12 +70,10 @@ final class HeaderTradeSettlement #[XmlList(entry: 'SpecifiedLogisticsServiceCharge', inline: true, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')] public array $specifiedLogisticsServiceCharge = []; - /** - * @var TradePaymentTerms[] - */ - #[Type('array')] - #[XmlList(entry: 'SpecifiedTradePaymentTerms', inline: true, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')] - public array $specifiedTradePaymentTerms = []; + #[Type(TradePaymentTerms::class)] + #[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')] + #[SerializedName('SpecifiedTradePaymentTerms')] + public ?TradePaymentTerms $specifiedTradePaymentTerms = null; #[Type(TradeSettlementHeaderMonetarySummation::class)] #[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')] diff --git a/tests/Integration/CIITest.php b/tests/Integration/CIITest.php index bd1e412..1f91c5a 100644 --- a/tests/Integration/CIITest.php +++ b/tests/Integration/CIITest.php @@ -143,7 +143,7 @@ function () { $headerTax2->calculatedAmount = Amount::create('37.62'); $headerTax2->rateApplicablePercent = '19.00'; - $invoice->supplyChainTradeTransaction->applicableHeaderTradeSettlement->specifiedTradePaymentTerms[] = $paymentTerms = new TradePaymentTerms(); + $invoice->supplyChainTradeTransaction->applicableHeaderTradeSettlement->specifiedTradePaymentTerms = $paymentTerms = new TradePaymentTerms(); $paymentTerms->description = 'Zahlbar innerhalb 30 Tagen netto bis 04.04.2018, 3% Skonto innerhalb 10 Tagen bis 15.03.2018'; $invoice->supplyChainTradeTransaction->applicableHeaderTradeSettlement->specifiedTradeSettlementHeaderMonetarySummation = $summation = new TradeSettlementHeaderMonetarySummation();