akretion/factur-x

facturx-pdfgen [ERROR] list index out of range

nyov opened this issue · 1 comments

nyov commented

facturx-pdfgen errors out with a weird list index error.

wget -N "https://raw.githubusercontent.com/konik-io/konik/master/src/test/resources/ZUGFeRD-invoice.sample.xml"

$ facturx-xmlcheck ZUGFeRD-invoice.sample.xml 
2019-12-18 18:32:24,326 [INFO] Factur-X flavor is zugferd (autodetected)
2019-12-18 18:32:24,353 [INFO] Factur-X XML file successfully validated against XSD

$ facturx-pdfgen -l debug testinvoice.pdf ZUGFeRD-invoice.sample.xml invoice.pdf
2019-12-18 18:42:22,074 [DEBUG] generate_facturx_from_file with factur-x lib 1.5
2019-12-18 18:42:22,074 [DEBUG] 1st arg pdf_invoice type=<class 'str'>
2019-12-18 18:42:22,074 [DEBUG] 2nd arg facturx_xml type=<class '_io.BufferedReader'>
2019-12-18 18:42:22,074 [DEBUG] optional arg facturx_level=autodetect
2019-12-18 18:42:22,074 [DEBUG] optional arg check_xsd=True
2019-12-18 18:42:22,074 [DEBUG] optional arg pdf_metadata=None
2019-12-18 18:42:22,074 [DEBUG] optional arg additional_attachments={}
2019-12-18 18:42:22,075 [ERROR] list index out of range

$ head -n 1 /home/testlab/.local/bin/facturx-pdfgen
#!/usr/bin/python3

Also it would be great if the project included some sample files, if not actually test cases.

There is now an explicit error. The XML file is ZUGFeRD 1.X and this lib only support the generation of ZUGFeRD 2.X pdf invoices.