Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Facturx 2.3 #63

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions src/zugferd2/Model/AdvancePayment.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

declare(strict_types=1);

namespace Easybill\ZUGFeRD2\Model;

use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\Type;
use JMS\Serializer\Annotation\XmlElement;

class AdvancePayment
{
#[Type(Amount::class)]
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
#[SerializedName('PaidAmount')]
public ?Amount $totalPrepaidAmount = null;

#[Type(FormattedDateTime::class)]
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
#[SerializedName('FormattedReceivedDateTime')]
public ?FormattedDateTime $formattedReceivedDateTime = null;

#[Type(TradeTax::class)]
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
#[SerializedName('IncludedTradeTax')]
public ?TradeTax $includedTradeTax = null;

#[Type(ReferencedDocument::class)]
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
#[SerializedName('InvoiceSpecifiedReferencedDocument')]
public ?ReferencedDocument $referencedDocument = null;
}
5 changes: 5 additions & 0 deletions src/zugferd2/Model/ClassCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ class ClassCode
#[SerializedName('listID')]
public ?string $listID = null;

#[Type('string')]
#[XmlAttribute]
#[SerializedName('listVersionID')]
public string $listVersionID;

#[Type('string')]
#[XmlValue(cdata: false)]
public string $value;
Expand Down
5 changes: 5 additions & 0 deletions src/zugferd2/Model/CreditorFinancialAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,9 @@ class CreditorFinancialAccount
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
#[SerializedName('AccountName')]
public ?string $AccountName = null;

#[Type(Id::class)]
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
#[SerializedName('ProprietaryID')]
public ?Id $proprietaryId = null;
}
2 changes: 1 addition & 1 deletion src/zugferd2/Model/DocumentLineDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class DocumentLineDocument
public string $lineId;

/** @var Note[] */
#[Type('array<Easybill\ZUGFeRD2\Model\Note>')]
#[Type('array<' . Note::class . '>')]
#[XmlList(entry: 'IncludedNote', inline: true, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
public array $notes = [];

Expand Down
2 changes: 1 addition & 1 deletion src/zugferd2/Model/ExchangedDocument.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ExchangedDocument
/**
* @var Note[]
*/
#[Type('array<Easybill\ZUGFeRD2\Model\Note>')]
#[Type('array<' . Note::class . '>')]
#[XmlList(entry: 'IncludedNote', inline: true, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
public array $notes = [];
}
34 changes: 8 additions & 26 deletions src/zugferd2/Model/HeaderTradeAgreement.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,11 @@

namespace Easybill\ZUGFeRD2\Model;

use JMS\Serializer\Annotation\AccessorOrder;
use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\Type;
use JMS\Serializer\Annotation\XmlElement;
use JMS\Serializer\Annotation\XmlList;

#[AccessorOrder(order: 'custom', custom: [
'buyerReference',
'sellerTradeParty',
'buyerTradeParty',
'sellerTaxRepresentativeTradeParty',
'buyerTaxRepresentativeTradeParty',
'buyerOrderReferencedDocument',
'contractReferencedDocument',
'sellerOrderReferencedDocument',
'additionalReferencedDocuments',
'specifiedProcuringProject',
])]
class HeaderTradeAgreement
{
#[Type('string')]
Expand All @@ -34,20 +21,20 @@ class HeaderTradeAgreement
#[SerializedName('SellerTradeParty')]
public TradeParty $sellerTradeParty;

#[Type(TradeParty::class)]
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
#[SerializedName('SellerTaxRepresentativeTradeParty')]
public ?TradeParty $sellerTaxRepresentativeTradeParty = null;

#[Type(TradeParty::class)]
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
#[SerializedName('BuyerTradeParty')]
public TradeParty $buyerTradeParty;

#[Type(TradeParty::class)]
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
#[SerializedName('BuyerTaxRepresentativeTradeParty')]
public ?TradeParty $buyerTaxRepresentativeTradeParty = null;
#[SerializedName('SellerTaxRepresentativeTradeParty')]
public ?TradeParty $sellerTaxRepresentativeTradeParty = null;

#[Type(ReferencedDocument::class)]
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
#[SerializedName('SellerOrderReferencedDocument')]
public ?ReferencedDocument $sellerOrderReferencedDocument = null;

#[Type(ReferencedDocument::class)]
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
Expand All @@ -60,15 +47,10 @@ class HeaderTradeAgreement
public ?ReferencedDocument $contractReferencedDocument = null;

/** @var ReferencedDocument[] */
#[Type('array<Easybill\ZUGFeRD2\Model\ReferencedDocument>')]
#[Type('array<' . ReferencedDocument::class . '>')]
#[XmlList(entry: 'AdditionalReferencedDocument', inline: true, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
public array $additionalReferencedDocuments = [];

#[Type(ReferencedDocument::class)]
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
#[SerializedName('SellerOrderReferencedDocument')]
public ?ReferencedDocument $sellerOrderReferencedDocument;

#[Type(ProcuringProject::class)]
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
#[SerializedName('SpecifiedProcuringProject')]
Expand Down
13 changes: 9 additions & 4 deletions src/zugferd2/Model/HeaderTradeDelivery.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,16 @@ class HeaderTradeDelivery

#[Type(ReferencedDocument::class)]
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
#[SerializedName('DeliveryNoteReferencedDocument')]
public ?ReferencedDocument $deliveryNoteReferencedDocument = null;
#[SerializedName('DespatchAdviceReferencedDocument')]
public ?ReferencedDocument $despatchAdviceReferencedDocument = null;

#[Type(ReferencedDocument::class)]
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
#[SerializedName('DespatchAdviceReferencedDocument')]
public ?ReferencedDocument $despatchAdviceReferencedDocument = null;
#[SerializedName('ReceivingAdviceReferencedDocument')]
public ?ReferencedDocument $receivingAdviceReferencedDocument = null;

#[Type(ReferencedDocument::class)]
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
#[SerializedName('DeliveryNoteReferencedDocument')]
public ?ReferencedDocument $deliveryNoteReferencedDocument = null;
}
68 changes: 38 additions & 30 deletions src/zugferd2/Model/HeaderTradeSettlement.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,41 +24,50 @@ class HeaderTradeSettlement
#[Type('string')]
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
#[SerializedName('TaxCurrencyCode')]
public string $taxCurrencyCode;
public ?string $taxCurrency = null;

#[Type('string')]
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
#[SerializedName('InvoiceCurrencyCode')]
public string $currency;

#[Type('string')]
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
#[SerializedName('InvoiceIssuerReference')]
public ?string $invoiceIssuerReference = null;

#[Type(TradeParty::class)]
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
#[SerializedName('InvoicerTradeParty')]
public ?TradeParty $invoicerTradeParty = null;

#[Type(TradeParty::class)]
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
#[SerializedName('InvoiceeTradeParty')]
public ?TradeParty $invoiceeTradeParty = null;

#[Type(TradeParty::class)]
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
#[SerializedName('PayerTradeParty')]
public ?TradeParty $payerTradeParty = null;

#[Type(TradeParty::class)]
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
#[SerializedName('PayeeTradeParty')]
public ?TradeParty $payeeTradeParty = null;

/**
* @var TradeCurrencyExchange[]
*/
#[Type('array<Easybill\ZUGFeRD2\Model\TradeCurrencyExchange>')]
#[XmlList(entry: 'TaxApplicableTradeCurrencyExchange', inline: true, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
public array $taxApplicableTradeCurrencyExchange = [];

/**
* @var TradeSettlementPaymentMeans[]
*/
#[Type('array<Easybill\ZUGFeRD2\Model\TradeSettlementPaymentMeans>')]
#[Type(TradeCurrencyExchange::class)]
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
#[SerializedName('TaxApplicableTradeCurrencyExchange')]
public ?TradeCurrencyExchange $taxApplicableTradeCurrencyExchange = null;

/** @var TradeSettlementPaymentMeans[] */
#[Type('array<' . TradeSettlementPaymentMeans::class . '>')]
#[XmlList(entry: 'SpecifiedTradeSettlementPaymentMeans', inline: true, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
public array $specifiedTradeSettlementPaymentMeans = [];

/**
* @var TradeTax[]
*/
#[Type('array<Easybill\ZUGFeRD2\Model\TradeTax>')]
/** @var TradeTax[] */
#[Type('array<' . TradeTax::class . '>')]
#[XmlList(entry: 'ApplicableTradeTax', inline: true, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
public array $tradeTaxes = [];

Expand All @@ -67,24 +76,18 @@ class HeaderTradeSettlement
#[SerializedName('BillingSpecifiedPeriod')]
public ?Period $billingSpecifiedPeriod = null;

/**
* @var TradeAllowanceCharge[]
*/
#[Type('array<Easybill\ZUGFeRD2\Model\TradeAllowanceCharge>')]
/** @var TradeAllowanceCharge[] */
#[Type('array<' . TradeAllowanceCharge::class . '>')]
#[XmlList(entry: 'SpecifiedTradeAllowanceCharge', inline: true, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
public array $specifiedTradeAllowanceCharge = [];

/**
* @var LogisticsServiceCharge[]
*/
#[Type('array<Easybill\ZUGFeRD2\Model\LogisticsServiceCharge>')]
/** @var LogisticsServiceCharge[] */
#[Type('array<' . LogisticsServiceCharge::class . '>')]
#[XmlList(entry: 'SpecifiedLogisticsServiceCharge', inline: true, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
public array $specifiedLogisticsServiceCharge = [];

/**
* @var TradePaymentTerms[]
*/
#[Type('array<Easybill\ZUGFeRD2\Model\TradePaymentTerms>')]
/** @var TradePaymentTerms[] */
#[Type('array<' . TradePaymentTerms::class . '>')]
#[XmlList(entry: 'SpecifiedTradePaymentTerms', inline: true, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
public array $specifiedTradePaymentTerms = [];

Expand All @@ -99,7 +102,12 @@ class HeaderTradeSettlement
public ?ReferencedDocument $invoiceReferencedDocument = null;

/** @var TradeAccountingAccount[] */
#[Type('array<Easybill\ZUGFeRD2\Model\TradeAccountingAccount>')]
#[Type('array<' . TradeAccountingAccount::class . '>')]
#[XmlList(entry: 'ReceivableSpecifiedTradeAccountingAccount', inline: true, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
public array $receivableSpecifiedTradeAccountingAccount = [];
public array $tradeAccountingAccount = [];

/** @var AdvancePayment[] */
#[Type('array<' . AdvancePayment::class . '>')]
#[XmlList(entry: 'SpecifiedAdvancePayment', inline: true, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
public array $advancePayments = [];
}
28 changes: 21 additions & 7 deletions src/zugferd2/Model/LineTradeAgreement.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,33 @@

namespace Easybill\ZUGFeRD2\Model;

use JMS\Serializer\Annotation\AccessorOrder;
use JMS\Serializer\Annotation\SerializedName;
use JMS\Serializer\Annotation\Type;
use JMS\Serializer\Annotation\XmlElement;
use JMS\Serializer\Annotation\XmlList;

#[AccessorOrder(order: 'custom', custom: ['buyerOrderReferencedDocument', 'grossPrice', 'netPrice'])]
class LineTradeAgreement
{
#[Type(ReferencedDocument::class)]
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
#[SerializedName('BuyerOrderReferencedDocument')]
public ?ReferencedDocument $buyerOrderReferencedDocument = null;

#[Type(ReferencedDocument::class)]
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
#[SerializedName('QuotationReferencedDocument')]
public ?ReferencedDocument $quotationReferencedDocument = null;

#[Type(ReferencedDocument::class)]
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
#[SerializedName('ContractReferencedDocument')]
public ?ReferencedDocument $contractReferencedDocument = null;

/** @var ReferencedDocument[] */
#[Type('array<' . ReferencedDocument::class . '>')]
#[XmlList(entry: 'AdditionalReferencedDocument', inline: true, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
public array $additionalReferencedDocuments = [];

#[Type(TradePrice::class)]
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
#[SerializedName('GrossPriceProductTradePrice')]
Expand All @@ -21,9 +40,4 @@ class LineTradeAgreement
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
#[SerializedName('NetPriceProductTradePrice')]
public TradePrice $netPrice;

#[Type(ReferencedDocument::class)]
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
#[SerializedName('BuyerOrderReferencedDocument')]
public ?ReferencedDocument $buyerOrderReferencedDocument = null;
}
7 changes: 6 additions & 1 deletion src/zugferd2/Model/LineTradeDelivery.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@ class LineTradeDelivery
#[SerializedName('BilledQuantity')]
public Quantity $billedQuantity;

#[Type(Quantity::class)]
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
#[SerializedName('ChargeFreeQuantity')]
public ?Quantity $chargeFreeQuantity = null;

#[Type(Quantity::class)]
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
#[SerializedName('PackageQuantity')]
public ?Quantity $packageQuantity;
public ?Quantity $packageQuantity = null;

#[Type(SupplyChainEvent::class)]
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
Expand Down
29 changes: 14 additions & 15 deletions src/zugferd2/Model/LineTradeSettlement.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,33 @@

class LineTradeSettlement
{
/**
* @var TradeTax[]
*/
#[Type('array<Easybill\ZUGFeRD2\Model\TradeTax>')]
/** @var TradeTax[] */
#[Type('array<' . TradeTax::class . '>')]
#[XmlList(entry: 'ApplicableTradeTax', inline: true, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
public array $tradeTax = [];

/**
* @var TradeAllowanceCharge[]
*/
#[Type('array<Easybill\ZUGFeRD2\Model\TradeAllowanceCharge>')]
#[XmlList(entry: 'SpecifiedTradeAllowanceCharge', inline: true, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
public array $specifiedTradeAllowanceCharge = [];

#[Type(Period::class)]
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
#[SerializedName('BillingSpecifiedPeriod')]
public ?Period $billingSpecifiedPeriod = null;

/** @var TradeAllowanceCharge[] */
#[Type('array<' . TradeAllowanceCharge::class . '>')]
#[XmlList(entry: 'SpecifiedTradeAllowanceCharge', inline: true, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
public array $specifiedTradeAllowanceCharge = [];

#[Type(TradeSettlementLineMonetarySummation::class)]
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
#[SerializedName('SpecifiedTradeSettlementLineMonetarySummation')]
public TradeSettlementLineMonetarySummation $monetarySummation;

/**
* @var TradeAccountingAccount[]
*/
#[Type('array<Easybill\ZUGFeRD2\Model\TradeAccountingAccount>')]
#[Type(ReferencedDocument::class)]
#[XmlElement(cdata: false, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
#[SerializedName('AdditionalReferencedDocument')]
public ReferencedDocument $referencedDocument;

/** @var TradeAccountingAccount[] */
#[Type('array<' . TradeAccountingAccount::class . '>')]
#[XmlList(entry: 'ReceivableSpecifiedTradeAccountingAccount', inline: true, namespace: 'urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100')]
public array $tradeAccountingAccount = [];
}
Loading
Loading