Skip to content

Write the payment terms description in version 1 again - #71

Open
RST-J wants to merge 1 commit into
halfbyte:mainfrom
RST-J:zugferd1-payment-terms-description
Open

RST-J wants to merge 1 commit into
halfbyte:mainfrom
RST-J:zugferd1-payment-terms-description

Conversation

@RST-J

@RST-J RST-J commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

This result was produced with the help of AI (supervised, not fully automated) and I hope this is acceptable for you.

Problem

main fails CI since #68 was merged. test_invoice_without_gross_price fails on all Ruby versions:

Element 'ram:Description' must occur at least 1 times. - Reference: …/ApplicableSupplyChainTradeSettlement[1]/…/SpecifiedTradePaymentTerms[1]

#68 writes ram:Description only when a payment terms text is given. That is fine for version 2. The ZUGFeRD 1 schema, however, requires the description whenever SpecifiedTradePaymentTerms is written. An invoice with a due date but no payment terms text, like the one in this test, is therefore invalid in version 1. The branch of #68 was green on its own (26620f7). Only the merge result c2cae62 is red, and every PR based on current main inherits the failure (e.g. #63, #70).

Change

In version 1, the description is written as before #68, with "Paid" as the fallback. Version 2 keeps the behaviour of #68. This uses the same version == 1 switch as the other version-specific parts of Invoice#to_xml.

Tests

No new test is needed: test_invoice_without_gross_price covers the case and passes again. The full suite passes (44 runs, 0 failures). A CHANGELOG entry is included.

The ZUGFeRD 1 schema requires ram:Description in SpecifiedTradePaymentTerms.
Since halfbyte#68 it was omitted when no payment terms text was given, so an invoice
with only a due date failed schema validation in version 1
(test_invoice_without_gross_price). Version 1 falls back to "Paid" as before,
version 2 keeps the behaviour of halfbyte#68.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant