Skip to content

EXTENDED codedb.xml: LineStatusCode (BT-X-8) uses UNTDID 4405 numeric codes instead of Factur-X textual values #70

@tristandaeschner

Description

@tristandaeschner

Description

The schematron validation rejects valid LineStatusCode (BT-X-8) values GROUP, DETAIL, and INFORMATION when validating EXTENDED profile invoices.

Root cause

In facturx/xsd/facturx-extended/Factur-X_1.08_EXTENDED_codedb.xml, codelist cl[@id=5] (referenced by Factur-X_1.08_EXTENDED-compiled.xsl line ~20059 for LineStatusCode validation) contains numeric UNTDID 4405 values:

<cl id="5">
    <enumeration value="1"/>
    <enumeration value="2"/>
    <enumeration value="3"/>
    ...
    <enumeration value="15"/>
</cl>

However, the Factur-X 1.08 specification (chapter 7.6.2) defines its own codelist EXT-FR-FE-163 with textual values for BT-X-8:

Code Meaning
GROUP Ligne de regroupement
DETAIL Ligne de détail
INFORMATION Ligne d'information

The Business Rules BR-FXEXT-05 through BR-FXEXT-27 all reference these textual values (e.g. BR-FXEXT-06: "LineStatusCode doit être renseigné avec la valeur GROUP, DETAIL ou INFORMATION").

How to reproduce

Generate a valid Factur-X EXTENDED invoice containing:

<ram:LineStatusCode>GROUP</ram:LineStatusCode>

Then call generate_from_binary() (default check_schematron=True). Validation fails with:

Value of 'ram:LineStatusCode' is not allowed.

Expected behavior

GROUP, DETAIL, and INFORMATION should be accepted.

Suggested fix

Replace the numeric UNTDID 4405 values in cl[@id=5] with the three Factur-X textual values:

<cl id="5">
    <enumeration value="GROUP"/>
    <enumeration value="DETAIL"/>
    <enumeration value="INFORMATION"/>
</cl>

Workaround

Pass check_schematron=False to generate_from_binary() / get_xml_from_pdf().

Version

factur-x 4.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions