summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexis de Lattre <alexis@via.ecp.fr>2019-07-24 20:52:12 (GMT)
committerGitHub <noreply@github.com>2019-07-24 20:52:12 (GMT)
commita364a127bdc9c35a9b694d489e740df622272d58 (patch)
tree1883e546537a5f5ed2cfe63a9ee58ec774d02a3e
parentc16bc24323b51279287d273f298bfbf951cf476b (diff)
parentb861c89e9eff4faf45ed9774fac14e1e95fd7177 (diff)
downloadfactur-x-a364a127bdc9c35a9b694d489e740df622272d58.zip
factur-x-a364a127bdc9c35a9b694d489e740df622272d58.tar.gz
factur-x-a364a127bdc9c35a9b694d489e740df622272d58.tar.bz2
Merge pull request #12 from lasalesi/compatibility
compatibility to public zugferd samples
-rw-r--r--facturx/facturx.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/facturx/facturx.py b/facturx/facturx.py
index 8f3baa4..9dde536 100644
--- a/facturx/facturx.py
+++ b/facturx/facturx.py
@@ -55,6 +55,7 @@ logger = logging.getLogger('factur-x')
logger.setLevel(logging.INFO)
FACTURX_FILENAME = 'factur-x.xml'
+FACTURX_FILENAME_PATTERN = ['factur-x.xml', 'zugferd-invoice.xml', 'ZUGFeRD-invoice.xml']
FACTURX_LEVEL2xsd = {
'minimum': 'FACTUR-X_EN16931.xsd',
'basicwl': 'FACTUR-X_EN16931.xsd',
@@ -274,7 +275,7 @@ def get_facturx_xml_from_pdf(pdf_invoice, check_xsd=True):
try:
for (filename, file_obj) in embeddedfiles_by_two:
logger.debug('found filename=%s', filename)
- if filename in (FACTURX_FILENAME, 'ZUGFeRD-invoice.xml'):
+ if filename in (FACTURX_FILENAME_PATTERN):
xml_file_dict = file_obj.getObject()
logger.debug('xml_file_dict=%s', xml_file_dict)
tmp_xml_string = xml_file_dict['/EF']['/F'].getData()