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
Description
The schematron validation rejects valid
LineStatusCode(BT-X-8) valuesGROUP,DETAIL, andINFORMATIONwhen validating EXTENDED profile invoices.Root cause
In
facturx/xsd/facturx-extended/Factur-X_1.08_EXTENDED_codedb.xml, codelistcl[@id=5](referenced byFactur-X_1.08_EXTENDED-compiled.xslline ~20059 forLineStatusCodevalidation) contains numeric UNTDID 4405 values: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:
GROUPDETAILINFORMATIONThe 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:
Then call
generate_from_binary()(defaultcheck_schematron=True). Validation fails with:Expected behavior
GROUP,DETAIL, andINFORMATIONshould be accepted.Suggested fix
Replace the numeric UNTDID 4405 values in
cl[@id=5]with the three Factur-X textual values:Workaround
Pass
check_schematron=Falsetogenerate_from_binary()/get_xml_from_pdf().Version
factur-x 4.2