Skip to content

Commit

Permalink
Fix SpecifiedTradePaymentTerms in HeaderTradeSettlement cardinality (#9)
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Nöhles <jan.noehles@easybill.de>
  • Loading branch information
BolZer authored Sep 20, 2024
1 parent b436e92 commit 148b287
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 23 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
28 changes: 14 additions & 14 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 4 additions & 6 deletions src/CII/Models/HeaderTradeSettlement.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<easybill\eInvoicing\CII\Models\TradePaymentTerms>')]
#[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')]
Expand Down
2 changes: 1 addition & 1 deletion tests/Integration/CIITest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 148b287

Please sign in to comment.