Adding ZUGFeRD 2.5 and Factur-X 1.09#203
Draft
andesk wants to merge 9 commits into
Draft
Conversation
…stment, ManufacturerTradeParty, PayerSpecifiedDebtorFinancialInstitution) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Populates each new field's XSD-sequence siblings so a misordered declaration fails schema validation (verified: moving any of the three new properties triggers an 'element not expected' XSD error).
…ntName, ReferencedProduct ID, SequenceNumeric, BasisQuantity) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…n TradeProduct The XSD TradeProductType sequence places IndividualTradeProductInstance before OriginTradeCountry/ManufacturerTradeParty; the property was declared last, so a product setting both serialized as XSD-invalid. The EXTENDED end-to-end test now sets individualTradeProductInstance to lock in the order.
PayerPartyDebtorFinancialAccount/ApplicableTradeSettlementFinancialCard were declared out of the TradeSettlementPaymentMeansType sequence, so invoices placing PayerPartyDebtorFinancialAccount before PayeePartyCreditorFinancialAccount serialized as XSD-invalid. Reordered to: TypeCode, Information, ApplicableTradeSettlementFinancialCard, PayerPartyDebtorFinancialAccount, PayeePartyCreditorFinancialAccount, PayerSpecifiedDebtorFinancialInstitution, PayeeSpecifiedCreditorFinancialInstitution. Adds the 3 official X01 Dauermietrechnung 1.09 EXTENDED examples as round-trip fixtures.
AttachmentBinaryObject attribute order (mimeCode/filename) is semantically insignificant but differs between our serializer and some official examples. Rather than contort the model (no single order satisfies all example files), reformatXml now sorts each element's non-namespaced attributes so both sides of the round-trip comparison normalize identically. Adds the 2 official XRECHNUNG 1.09 examples (Elektron, Reisekostenabrechnung) as fixtures.
andesk
commented
Jul 7, 2026
Comment on lines
+29
to
+33
| // Attribute order is not significant in XML, but the official examples and our serializer | ||
| // emit some attributes (e.g. mimeCode/filename on AttachmentBinaryObject) in different orders. | ||
| // Normalise by sorting each element's non-namespaced attributes so byte comparison ignores order. | ||
| // Elements carrying prefixed attributes (e.g. xsi:*) are left untouched to preserve bindings. | ||
| private static function sortElementAttributes(\DOMElement $element): void |
Member
Author
There was a problem hiding this comment.
Not sure if we want/need to add this. cc @BolZer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds the latest ZUGFeRD and Factur-X versions to the lib's support.