-
-
Notifications
You must be signed in to change notification settings - Fork 201
Description
Problem
Mustang can generate ram:IncludedNote, but the subjectCode field is typed as SubjectCode (an enum). The enum currently does not expose all required UNTDID 4451 values.
As a result, it is not possible to generate the three subject codes required by the French CTC-FR validation rules:
PMT (exists in the enum)
PMD (missing)
AAB (missing)
This prevents producing Factur-X invoices that pass CTC-FR validation, even though these codes are valid UNTDID 4451 values and allowed by Factur-X.
Expected behavior
Mustang should allow setting ram:IncludedNote/ram:SubjectCode to at least:
PMT
PMD
AAB
so that a caller can generate the mandatory French legal notes.
Actual behavior
SubjectCode enum is missing PMD and AAB, so the API cannot produce these values (unless users fork/patch or bypass the enum).
References
Factur-X 1.08: BT-21 is based on UNTDID 4451 subject code list (CII ram:IncludedNote/ram:SubjectCode).
Factur-X 1.08 codedb includes AAB, PMD, PMT as allowed enumerations.
French CTC-FR Schematron (Flux 2, CII) requires presence/uniqueness of notes with SubjectCode = PMT / PMD / AAB (BR-FR-05 / BR-FR-06). (local file: 20251114_BR-FR-Flux2-Schematron-CII_V1.2.0.sch)
Proposed fix
Option A (minimal, backward compatible):
Add AAB and PMD constants to org.mustangproject.SubjectCode.
Option B (more future-proof):
Allow a free-text / custom subject code (String) in IncludedNote, keeping the enum as a convenience wrapper.
Acceptance criteria
A user can create 3 IncludedNote entries using AAB, PMD, PMT.
Generated XML contains:
ram:IncludedNoteram:SubjectCodeAAB</ram:SubjectCode>…</ram:IncludedNote>
ram:IncludedNoteram:SubjectCodePMD</ram:SubjectCode>…</ram:IncludedNote>
ram:IncludedNoteram:SubjectCodePMT</ram:SubjectCode>…</ram:IncludedNote>