├── .flake8 ├── .gitignore ├── LICENSE ├── MANIFEST.in ├── README.rst ├── facturx ├── __init__.py ├── facturx.py ├── scripts │ ├── __init__.py │ ├── pdfextractxml.py │ ├── pdfgen.py │ ├── webservice.py │ └── xmlcheck.py ├── xmp │ ├── Factur-X_extension_schema.xmp │ └── ZUGFeRD_extension_schema.xmp └── xsd │ ├── facturx-basic │ ├── Factur-X_1.07.2_BASIC.xsd │ ├── Factur-X_1.07.2_BASIC_urn_un_unece_uncefact_data_standard_QualifiedDataType_100.xsd │ ├── Factur-X_1.07.2_BASIC_urn_un_unece_uncefact_data_standard_ReusableAggregateBusinessInformationEntity_100.xsd │ └── Factur-X_1.07.2_BASIC_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_100.xsd │ ├── facturx-basicwl │ ├── Factur-X_1.07.2_BASICWL.xsd │ ├── Factur-X_1.07.2_BASICWL_urn_un_unece_uncefact_data_standard_QualifiedDataType_100.xsd │ ├── Factur-X_1.07.2_BASICWL_urn_un_unece_uncefact_data_standard_ReusableAggregateBusinessInformationEntity_100.xsd │ └── Factur-X_1.07.2_BASICWL_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_100.xsd │ ├── facturx-en16931 │ ├── Factur-X_1.07.2_EN16931.xsd │ ├── Factur-X_1.07.2_EN16931_urn_un_unece_uncefact_data_standard_QualifiedDataType_100.xsd │ ├── Factur-X_1.07.2_EN16931_urn_un_unece_uncefact_data_standard_ReusableAggregateBusinessInformationEntity_100.xsd │ └── Factur-X_1.07.2_EN16931_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_100.xsd │ ├── facturx-extended │ ├── Factur-X_1.07.2_EXTENDED.xsd │ ├── Factur-X_1.07.2_EXTENDED_urn_un_unece_uncefact_data_standard_QualifiedDataType_100.xsd │ ├── Factur-X_1.07.2_EXTENDED_urn_un_unece_uncefact_data_standard_ReusableAggregateBusinessInformationEntity_100.xsd │ └── Factur-X_1.07.2_EXTENDED_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_100.xsd │ ├── facturx-minimum │ ├── Factur-X_1.07.2_MINIMUM.xsd │ ├── Factur-X_1.07.2_MINIMUM_urn_un_unece_uncefact_data_standard_QualifiedDataType_100.xsd │ ├── Factur-X_1.07.2_MINIMUM_urn_un_unece_uncefact_data_standard_ReusableAggregateBusinessInformationEntity_100.xsd │ └── Factur-X_1.07.2_MINIMUM_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_100.xsd │ ├── orderx-basic │ ├── SCRDMCCBDACIOMessageStructure_100pD20B.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_ISO_ISO3AlphaCurrencyCode_2012-08-31.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_ActionCode_D20A.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_DeliveryTermsCode_2010.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_DeliveryTermsFunctionCode_D20A.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_DocumentNameCode_D20A.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_DocumentStatusCode_D20A.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_MessageFunctionCode_D20A.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_data_standard_QualifiedDataType_128.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_data_standard_ReusableAggregateBusinessInformationEntity_128.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_128.xsd │ └── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_identifierlist_standard_ISO_ISOTwo-letterCountryCode_SecondEdition2006.xsd │ ├── orderx-comfort │ ├── SCRDMCCBDACIOMessageStructure_100pD20B.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_EDIFICAS-EU_AccountingAccountType_D11A.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_EN16931_AllowanceChargeReasonCode_D20A.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_ISO_ISO3AlphaCurrencyCode_2012-08-31.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_ActionCode_D20A.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_ContactFunctionCode_D20A.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_DeliveryTermsCode_2010.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_DeliveryTermsFunctionCode_D20A.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_DocumentNameCode_D20A.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_DocumentStatusCode_D20A.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_DutyTaxFeeTypeCode_D20A.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_DutyorTaxorFeeCategoryCode_D20A.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_MessageFunctionCode_D20A.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_PackageTypeCode_2006.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_PaymentMeansCode_D20A.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_ReferenceTypeCode_D20A.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_data_standard_QualifiedDataType_128.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_data_standard_ReusableAggregateBusinessInformationEntity_128.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_128.xsd │ └── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_identifierlist_standard_ISO_ISOTwo-letterCountryCode_SecondEdition2006.xsd │ ├── orderx-extended │ ├── SCRDMCCBDACIOMessageStructure_100pD20B.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_EDIFICAS-EU_AccountingAccountType_D11A.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_EN16931_AllowanceChargeReasonCode_D20A.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_ISO_ISO3AlphaCurrencyCode_2012-08-31.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_ActionCode_D20A.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_ContactFunctionCode_D20A.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_DeliveryTermsCode_2010.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_DeliveryTermsFunctionCode_D20A.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_DocumentNameCode_D20A.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_DocumentStatusCode_D20A.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_DutyTaxFeeTypeCode_D20A.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_DutyorTaxorFeeCategoryCode_D20A.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_EventTimeReferenceCode_D20A.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_MessageFunctionCode_D20A.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_PackageTypeCode_2006.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_PaymentMeansCode_D20A.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_ReferenceTypeCode_D20A.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_TimePointFormatCode_D19B.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_data_standard_QualifiedDataType_128.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_data_standard_ReusableAggregateBusinessInformationEntity_128.xsd │ ├── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_128.xsd │ └── SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_identifierlist_standard_ISO_ISOTwo-letterCountryCode_SecondEdition2006.xsd │ └── zugferd │ ├── ZUGFeRD1p0.xsd │ ├── ZUGFeRD1p0_urn_un_unece_uncefact_data_standard_QualifiedDataType_12.xsd │ ├── ZUGFeRD1p0_urn_un_unece_uncefact_data_standard_ReusableAggregateBusinessInformationEntity_12.xsd │ └── ZUGFeRD1p0_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_15.xsd ├── pyproject.toml └── requirements.txt /.flake8: -------------------------------------------------------------------------------- 1 | [flake8] 2 | max-line-length = 88 3 | max-complexity = 50 4 | # B = bugbear 5 | # B9 = bugbear opinionated (incl line length) 6 | select = C,E,F,W,B,B9 7 | ignore = W504,E123 8 | per-file-ignores= 9 | __init__.py:F401 10 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | 49 | # Translations 50 | *.mo 51 | *.pot 52 | 53 | # Django stuff: 54 | *.log 55 | local_settings.py 56 | 57 | # Flask stuff: 58 | instance/ 59 | .webassets-cache 60 | 61 | # Scrapy stuff: 62 | .scrapy 63 | 64 | # Sphinx documentation 65 | docs/_build/ 66 | 67 | # PyBuilder 68 | target/ 69 | 70 | # Jupyter Notebook 71 | .ipynb_checkpoints 72 | 73 | # pyenv 74 | .python-version 75 | 76 | # celery beat schedule file 77 | celerybeat-schedule 78 | 79 | # SageMath parsed files 80 | *.sage.py 81 | 82 | # dotenv 83 | .env 84 | 85 | # virtualenv 86 | .venv 87 | venv/ 88 | ENV/ 89 | 90 | # Spyder project settings 91 | .spyderproject 92 | .spyproject 93 | 94 | # Rope project settings 95 | .ropeproject 96 | 97 | # mkdocs documentation 98 | /site 99 | 100 | # mypy 101 | .mypy_cache/ 102 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016-2023, Alexis de Lattre 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * The name of the authors may not be used to endorse or promote products 12 | derived from this software without specific prior written permission. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 15 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 16 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 17 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 18 | HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 19 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 20 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 21 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 22 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 23 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | -------------------------------------------------------------------------------- /facturx/__init__.py: -------------------------------------------------------------------------------- 1 | from .facturx import generate_from_file, \ 2 | generate_facturx_from_file, \ 3 | generate_from_binary, \ 4 | generate_facturx_from_binary, \ 5 | get_xml_namespaces, \ 6 | get_facturx_flavor, \ 7 | get_flavor, \ 8 | get_facturx_level, \ 9 | get_level, \ 10 | check_facturx_xsd, \ 11 | xml_check_xsd, \ 12 | get_facturx_xml_from_pdf, \ 13 | get_orderx_xml_from_pdf, \ 14 | get_xml_from_pdf, \ 15 | get_orderx_type 16 | -------------------------------------------------------------------------------- /facturx/scripts/__init__.py: -------------------------------------------------------------------------------- 1 | # Make this a module. 2 | -------------------------------------------------------------------------------- /facturx/scripts/pdfextractxml.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | # Copyright 2017-2023 Alexis de Lattre 3 | 4 | import argparse 5 | import sys 6 | from facturx import get_xml_from_pdf 7 | from facturx.facturx import logger 8 | import logging 9 | from os.path import isfile, isdir 10 | 11 | __author__ = "Alexis de Lattre " 12 | __date__ = "March 2021" 13 | __version__ = "0.2" 14 | 15 | 16 | def pdfextractxml(args): 17 | if args.log_level: 18 | log_level = args.log_level.lower() 19 | log_map = { 20 | 'debug': logging.DEBUG, 21 | 'info': logging.INFO, 22 | 'warn': logging.WARN, 23 | 'error': logging.ERROR, 24 | } 25 | if log_level in log_map: 26 | logger.setLevel(log_map[log_level]) 27 | else: 28 | logger.error( 29 | 'Wrong value for log level (%s). Possible values: %s', 30 | log_level, ', '.join(log_map.keys())) 31 | sys.exit(1) 32 | 33 | pdf_filename = args.facturx_orderx_file 34 | out_xml_filename = args.xml_file_to_create 35 | if not isfile(pdf_filename): 36 | logger.error('Argument %s is not a filename', pdf_filename) 37 | sys.exit(1) 38 | if isdir(out_xml_filename): 39 | logger.error( 40 | '2nd argument %s is a directory name (should be a the ' 41 | 'output XML filename)', out_xml_filename) 42 | sys.exit(1) 43 | pdf_file = open(pdf_filename, 'rb') 44 | check_xsd = True 45 | if args.disable_xsd_check: 46 | check_xsd = False 47 | # The important line of code is below ! 48 | try: 49 | (xml_filename, xml_string) = get_xml_from_pdf( 50 | pdf_file, check_xsd=check_xsd) 51 | except Exception as e: 52 | logger.error(e) 53 | sys.exit(1) 54 | if xml_filename and xml_string: 55 | if isfile(out_xml_filename): 56 | logger.warning( 57 | 'File %s already exists. Overwriting it!', out_xml_filename) 58 | xml_file = open(out_xml_filename, 'wb') 59 | xml_file.write(xml_string) 60 | xml_file.close() 61 | logger.info('File %s generated', out_xml_filename) 62 | else: 63 | logger.warning('File %s has not been created', out_xml_filename) 64 | sys.exit(1) 65 | 66 | 67 | def main(args=None): 68 | if args is None: 69 | args = sys.argv[1:] 70 | usage = "facturx-pdfextractxml " 71 | epilog = "Author: %s - Version: %s" % (__author__, __version__) 72 | description = "This extracts the XML file from a Factur-X or Order-X PDF file." 73 | parser = argparse.ArgumentParser( 74 | usage=usage, epilog=epilog, description=description) 75 | parser.add_argument( 76 | '-l', '--log-level', dest="log_level", default='info', 77 | help="Set log level. Possible values: debug, info, warn, error. " 78 | "Default value: info.") 79 | parser.add_argument( 80 | '-d', '--disable-xsd-check', dest='disable_xsd_check', 81 | action='store_true', 82 | help="De-activate XML Schema Definition check on Factur-X/Order-X XML file " 83 | "(the check is enabled by default)") 84 | parser.add_argument( 85 | "facturx_orderx_file", help="PDF Factur-X or Order-X file") 86 | parser.add_argument( 87 | "xml_file_to_create", 88 | help="Filename of the XML file that will be extracted from the PDF") 89 | args = parser.parse_args() 90 | pdfextractxml(args) 91 | 92 | 93 | def run(): 94 | if __name__ == '__main__': 95 | main() 96 | 97 | 98 | run() 99 | -------------------------------------------------------------------------------- /facturx/scripts/pdfgen.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | # Copyright 2017-2023 Alexis de Lattre 3 | 4 | import argparse 5 | import sys 6 | from facturx import generate_from_file 7 | from facturx.facturx import logger 8 | import logging 9 | from os.path import isfile, isdir, basename 10 | 11 | __author__ = "Alexis de Lattre " 12 | __date__ = "March 2021" 13 | __version__ = "0.6" 14 | 15 | 16 | def pdfgen(args): 17 | if args.log_level: 18 | log_level = args.log_level.lower() 19 | log_map = { 20 | 'debug': logging.DEBUG, 21 | 'info': logging.INFO, 22 | 'warn': logging.WARN, 23 | 'error': logging.ERROR, 24 | } 25 | if log_level in log_map: 26 | logger.setLevel(log_map[log_level]) 27 | else: 28 | logger.error( 29 | 'Wrong value for log level (%s). Possible values: %s', 30 | log_level, ', '.join(log_map.keys())) 31 | sys.exit(1) 32 | 33 | pdf_filename = args.regular_pdf_file 34 | xml_filename = args.xml_file 35 | output_pdf_filename = args.facturx_orderx_pdf_file 36 | additional_attachment_filenames = args.optional_attachments 37 | for filename in [pdf_filename, xml_filename] + additional_attachment_filenames: 38 | if not isfile(filename): 39 | logger.error('Argument %s is not a filename', filename) 40 | sys.exit(1) 41 | if isdir(output_pdf_filename): 42 | logger.error( 43 | '3rd argument %s is a directory name (should be a the ' 44 | 'Factur-X or Order-X PDF filename)', output_pdf_filename) 45 | sys.exit(1) 46 | xml_file = open(xml_filename, 'rb') 47 | check_xsd = True 48 | if args.disable_xsd_check: 49 | check_xsd = False 50 | pdf_metadata = None 51 | if ( 52 | args.meta_author or 53 | args.meta_keywords or 54 | args.meta_title or 55 | args.meta_subject): 56 | pdf_metadata = { 57 | 'author': args.meta_author, 58 | 'keywords': args.meta_keywords, 59 | 'title': args.meta_title, 60 | 'subject': args.meta_subject, 61 | } 62 | if isfile(output_pdf_filename): 63 | if args.overwrite: 64 | logger.warning( 65 | 'File %s already exists. Overwriting it.', 66 | output_pdf_filename) 67 | else: 68 | logger.error( 69 | 'File %s already exists. Exit.', output_pdf_filename) 70 | sys.exit(1) 71 | attachments = {} 72 | for additional_attachment_filename in additional_attachment_filenames: 73 | attachments[basename(additional_attachment_filename)] = { 74 | 'filepath': additional_attachment_filename} 75 | lang = args.lang or None 76 | try: 77 | # The important line of code is below ! 78 | generate_from_file( 79 | pdf_filename, xml_file, check_xsd=check_xsd, 80 | flavor=args.flavor, level=args.level, orderx_type=args.orderx_type, 81 | pdf_metadata=pdf_metadata, lang=lang, output_pdf_file=output_pdf_filename, 82 | attachments=attachments, afrelationship=args.afrelationship) 83 | except Exception as e: 84 | logger.error('factur-x lib call failed. Error: %s', e) 85 | sys.exit(1) 86 | 87 | 88 | def main(args=None): 89 | if args is None: 90 | args = sys.argv[1:] 91 | usage = "facturx-pdfgen "\ 92 | " " 93 | epilog = "Author: %s - Version: %s" % (__author__, __version__) 94 | description = "This script generate a Factur-X or Order-X PDF from a "\ 95 | "regular PDF/A document and a Factur-X or Order-X XML file. "\ 96 | "It can also include additional embedded files in the PDF. "\ 97 | "To generate a valid PDF/A-3 document as requested by the "\ 98 | "Factur-X/Order-X standards, you need to give a valid PDF/A "\ 99 | "document as input."\ 100 | "\n\nIf you use one of the --meta-* arguments, you should specify "\ 101 | "all the meta-* arguments because the default values for "\ 102 | "metadata only apply if none of the meta-* arguments are used." 103 | parser = argparse.ArgumentParser( 104 | usage=usage, epilog=epilog, description=description) 105 | parser.add_argument( 106 | '-l', '--log-level', dest='log_level', default='info', 107 | help="Set log level. Possible values: debug, info, warn, error. " 108 | "Default value: info.") 109 | parser.add_argument( 110 | '-d', '--disable-xsd-check', dest='disable_xsd_check', 111 | action='store_true', 112 | help="De-activate XML Schema Definition check on XML file " 113 | "(the check is enabled by default)") 114 | parser.add_argument( 115 | '-f', '--flavor', dest='flavor', default='autodetect', 116 | help="Specify if you want to generate a Factur-X or Order-X PDF file. " 117 | "Default: autodetect. If you specify a particular flavor instead of " 118 | "using autodetection from the XML, you will win a very small amount of time " 119 | "(less than 1 millisecond). " 120 | "Possible values: order-x, factur-x or autodetect.") 121 | parser.add_argument( 122 | '-n', '--level', '--facturx-level', dest='level', default='autodetect', 123 | help="Specify the Factur-X or Order-X level of the XML file. " 124 | "Default: autodetect. If you specify a particular level instead of " 125 | "using autodetection, you will win a very small amount of time " 126 | "(less than 1 millisecond). " 127 | "Possible values for Factur-X: minimum, basicwl, basic, en16931, extended." 128 | "Possible values for Order-X: basic, comfort, extended." 129 | ) 130 | parser.add_argument( 131 | '-p', '--orderx-type', dest='orderx_type', default='autodetect', 132 | help="When you generate an Order-X document, specify the order type. " 133 | "Default: autodetect. If you specify a particular order type instead of " 134 | "using autodetection, you will win a very small amount of time " 135 | "(less than 1 millisecond). " 136 | "Possible values: order, order_change, order_response.") 137 | parser.add_argument( 138 | '-g', '--lang', dest='lang', 139 | help="Set the language identifier as RFC 3066 to specify the " 140 | "natural language of the PDF document. Example: en-US.") 141 | parser.add_argument( 142 | '-r', '--afrelationship', dest='afrelationship', default='data', 143 | help="Set the AFRelationship PDF property of the Factur-X/Order-X XML file. " 144 | "Possible values: data, source, alternative. " 145 | "Default value: data.") 146 | parser.add_argument( 147 | '-a', '--meta-author', dest='meta_author', 148 | help="Specify the author for PDF metadata. Default: use the vendor " 149 | "name extracted from the XML file.") 150 | parser.add_argument( 151 | '-k', '--meta-keywords', dest='meta_keywords', 152 | help="Specify the keywords for PDF metadata. " 153 | "Default for Factur-X: 'Invoice, Factur-X'." 154 | "Default for Order-X: 'Order Change, Order-X' where 'Order Change' is " 155 | "the order type.") 156 | parser.add_argument( 157 | '-t', '--meta-title', dest='meta_title', 158 | help="Specify the title of PDF metadata. " 159 | "Default: generic English title with information extracted from " 160 | "the XML file such as: 'Akretion: Invoice I1242'") 161 | parser.add_argument( 162 | '-s', '--meta-subject', dest='meta_subject', 163 | help="Specify the subject of PDF metadata. " 164 | "Default: generic English subject with information extracted from the " 165 | "XML file such as: " 166 | "'Factur-X invoice I1242 dated 2017-08-17 issued by Akretion'") 167 | parser.add_argument( 168 | '-w', '--overwrite', dest='overwrite', action='store_true', 169 | help="Overwrite output PDF file if it already exists.") 170 | parser.add_argument("regular_pdf_file", help="Regular PDF invoice") 171 | parser.add_argument("xml_file", help="Factur-X or Order-X XML file") 172 | parser.add_argument( 173 | "facturx_orderx_pdf_file", help="Generated Factur-X or Order-X PDF file") 174 | parser.add_argument( 175 | "optional_attachments", nargs='*', 176 | help="Optional list of additionnal attachments") 177 | args = parser.parse_args() 178 | pdfgen(args) 179 | 180 | 181 | def run(): 182 | if __name__ == '__main__': 183 | main() 184 | 185 | 186 | run() 187 | -------------------------------------------------------------------------------- /facturx/scripts/webservice.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | # Copyright 2020-2023 Alexis de Lattre 3 | # Published under the BSD licence 4 | # REST webservice to generated Factur-X invoice 5 | # 6 | # If you deploy it in production, follow these instructions: 7 | # https://flask.palletsprojects.com/en/2.3.x/deploying/ 8 | # Here is a good tutorial (in French) about the deployment of a Flask 9 | # application in production with Gunicorn + Nginx: 10 | # https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-gunicorn-and-nginx-on-ubuntu-20-04-fr 11 | # 12 | # Sample client request: 13 | # curl -X POST -F 'pdf=@/home/alexis/invoice_test.pdf' 14 | # -F 'xml=@/home/alexis/factur-x.xml' -o result_facturx.pdf 15 | # http://localhost:5000/generate_facturx 16 | 17 | from flask import Flask, request, send_file 18 | from tempfile import NamedTemporaryFile 19 | from facturx import generate_from_file 20 | from facturx.facturx import logger as fxlogger 21 | import argparse 22 | import logging 23 | import sys 24 | from logging.handlers import RotatingFileHandler 25 | 26 | MAX_ATTACHMENTS = 3 # TODO make it a cmd line option 27 | app = Flask(__name__) 28 | 29 | 30 | @app.route('/generate_facturx', methods=['POST']) 31 | def generate_facturx(): 32 | app.logger.debug('request.files=%s', request.files) 33 | attachments = {} 34 | for i in range(MAX_ATTACHMENTS): 35 | attach_key = 'attachment%d' % (i + 1) 36 | if request.files.get(attach_key): 37 | with NamedTemporaryFile(prefix='fx-api-attach-') as attach_file: 38 | request.files[attach_key].save(attach_file.name) 39 | attach_file.seek(0) 40 | attachments[request.files[attach_key].filename] = { 41 | 'filedata': attach_file.read(), 42 | } 43 | attach_file.close() 44 | 45 | with NamedTemporaryFile(prefix='fx-api-xml-', suffix='.xml') as xml_file: 46 | request.files['xml'].save(xml_file.name) 47 | app.logger.debug('xml_file.name=%s', xml_file.name) 48 | xml_file.seek(0) 49 | xml_byte = xml_file.read() 50 | xml_file.close() 51 | res = '' 52 | with NamedTemporaryFile(prefix='fx-api-pdf-', suffix='.pdf') as pdf_file: 53 | with NamedTemporaryFile( 54 | prefix='fx-api-outpdf-', suffix='.pdf') as output_pdf_file: 55 | request.files['pdf'].save(pdf_file.name) 56 | app.logger.debug('pdf_file.name=%s', pdf_file.name) 57 | app.logger.debug('output_pdf_file.name=%s', output_pdf_file.name) 58 | app.logger.debug('attachments keys=%s', attachments.keys()) 59 | generate_from_file( 60 | pdf_file, xml_byte, output_pdf_file=output_pdf_file.name, 61 | attachments=attachments) 62 | output_pdf_file.seek(0) 63 | res = send_file(output_pdf_file.name, as_attachment=True) 64 | app.logger.info( 65 | 'Factur-X or Order-X document successfully returned by webservice') 66 | output_pdf_file.close() 67 | pdf_file.close() 68 | return res 69 | 70 | 71 | def main(args=None): 72 | if args is None: 73 | args = sys.argv[1:] 74 | usage = "facturx_webservice.py [options]" 75 | epilog = "Script written by Alexis de Lattre. "\ 76 | "Published under the BSD licence." 77 | description = "This is a Flask application that exposes a REST "\ 78 | "webservice to generate a Factur-X invoice from a PDF file and an "\ 79 | "XML file." 80 | parser = argparse.ArgumentParser( 81 | usage=usage, epilog=epilog, description=description) 82 | parser.add_argument( 83 | '-s', '--host', dest='host', default='127.0.0.1', 84 | help="The hostname to listen on. Defaults to '127.0.0.1': " 85 | "the webservice will only accept connexions from localhost. Use " 86 | "'0.0.0.0' to have the webservice available from a remote host (but " 87 | "it is recommended to listen on localhost and use an HTTPS proxy to " 88 | "listen to remote connexions).") 89 | parser.add_argument( 90 | '-p', '--port', dest='port', type=int, default=5000, 91 | help="Port on which the webservice listens. You can select " 92 | "any port between 1024 and 65535. Default port is 5000.") 93 | parser.add_argument( 94 | '-d', '--debug', dest='debug', action='store_true', 95 | help="Enable debug mode.") 96 | parser.add_argument( 97 | '-l', '--logfile', dest='logfile', 98 | help="Logs to a file instead of stdout.") 99 | parser.add_argument( 100 | '-n', '--loglevel', dest='loglevel', default='info', 101 | help="Log level. Possible values: critical, error, warning, " 102 | "info (default), debug.") 103 | args = parser.parse_args() 104 | if args.logfile: 105 | formatter = logging.Formatter( 106 | "[%(asctime)s] %(levelname)s %(message)s") 107 | handler = RotatingFileHandler(args.logfile) 108 | if args.loglevel == 'debug': 109 | level = logging.DEBUG 110 | elif args.loglevel == 'critical': 111 | level = logging.CRITICAL 112 | elif args.loglevel == 'warning': 113 | level = logging.WARNING 114 | elif args.loglevel == 'error': 115 | level = logging.ERROR 116 | else: 117 | level = logging.INFO 118 | handler.setLevel(level) 119 | handler.setFormatter(formatter) 120 | fxlogger.setLevel(level) 121 | fxlogger.addHandler(handler) 122 | app.logger.addHandler(handler) 123 | app.logger.info('Start webservice to generate Factur-X invoices') 124 | app.run(debug=args.debug, port=args.port, host=args.host) 125 | 126 | 127 | def run(): 128 | if __name__ == '__main__': 129 | main() 130 | 131 | 132 | run() 133 | -------------------------------------------------------------------------------- /facturx/scripts/xmlcheck.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | # Copyright 2017-2023 Alexis de Lattre 3 | 4 | import argparse 5 | import sys 6 | from facturx import xml_check_xsd 7 | from facturx.facturx import logger 8 | import logging 9 | from os.path import isfile 10 | 11 | __author__ = "Alexis de Lattre " 12 | __date__ = "March 2021" 13 | __version__ = "0.3" 14 | 15 | 16 | def xmlcheck(args): 17 | if args.log_level: 18 | log_level = args.log_level.lower() 19 | log_map = { 20 | 'debug': logging.DEBUG, 21 | 'info': logging.INFO, 22 | 'warn': logging.WARN, 23 | 'error': logging.ERROR, 24 | } 25 | if log_level in log_map: 26 | logger.setLevel(log_map[log_level]) 27 | else: 28 | logger.error( 29 | 'Wrong value for log level (%s). Possible values: %s', 30 | log_level, ', '.join(log_map.keys())) 31 | sys.exit(1) 32 | 33 | if not isfile(args.xml_file): 34 | logger.error('%s is not a filename', args.xml_file) 35 | sys.exit(1) 36 | xml_file = open(args.xml_file, 'rb') 37 | # The important line of code is below ! 38 | try: 39 | xml_check_xsd( 40 | xml_file, flavor=args.flavor, level=args.level) 41 | except Exception as e: 42 | logger.error(e) 43 | sys.exit(1) 44 | 45 | 46 | def main(args=None): 47 | if args is None: 48 | args = sys.argv[1:] 49 | usage = "facturx-xmlcheck " 50 | epilog = "Author: %s - Version: %s" % (__author__, __version__) 51 | description = "This script checks the Factur-X or Order-XML XML against the XML "\ 52 | "Schema Definition." 53 | parser = argparse.ArgumentParser( 54 | usage=usage, epilog=epilog, description=description) 55 | parser.add_argument( 56 | '-l', '--log-level', dest='log_level', default='info', 57 | help="Set log level. Possible values: debug, info, warn, error. " 58 | "Default value: info.") 59 | parser.add_argument( 60 | '-f', '--flavor', dest='flavor', default='autodetect', 61 | help="Set XML flavor. Possible values: factur-x, zugferd, order-x or autodetect. " 62 | "Default value: autodetect.") 63 | parser.add_argument( 64 | '-n', '--facturx-level', dest='level', 65 | default='autodetect', 66 | help="Specify the level of the Factur-X or Order-X XML file. " 67 | "Default: autodetect. If you specify a particular level instead of " 68 | "using autodetection, you will win a very small amount of time " 69 | "(less than 1 millisecond). " 70 | "Possible values for Factur-X: minimum, basicwl, basic, en16931, extended. " 71 | "Possible values for Order-X: basic, comfort, extended.") 72 | parser.add_argument( 73 | "xml_file", help="Factur-X or Order-X XML file to check") 74 | args = parser.parse_args() 75 | xmlcheck(args) 76 | 77 | 78 | def run(): 79 | if __name__ == '__main__': 80 | main() 81 | 82 | 83 | run() 84 | -------------------------------------------------------------------------------- /facturx/xmp/Factur-X_extension_schema.xmp: -------------------------------------------------------------------------------- 1 | 24 | 25 | 26 | 27 | 28 | BASIC 29 | factur-x.xml 30 | INVOICE 31 | 1.0 32 | 33 | 34 | 36 | 40 | 41 | 42 | 43 | 44 | Factur-X PDFA Extension Schema 45 | urn:factur-x:pdfa:CrossIndustryDocument:invoice:1p0# 46 | fx 47 | 48 | 49 | 50 | DocumentFileName 51 | Text 52 | external 53 | name of the embedded XML invoice file 54 | 55 | 56 | DocumentType 57 | Text 58 | external 59 | INVOICE 60 | 61 | 62 | Version 63 | Text 64 | external 65 | The actual version of the Factur-X XML schema 66 | 67 | 68 | ConformanceLevel 69 | Text 70 | external 71 | The conformance level of the embedded Factur-X data 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /facturx/xmp/ZUGFeRD_extension_schema.xmp: -------------------------------------------------------------------------------- 1 | 44 | 45 | 46 | 47 | 48 | BASIC 49 | ZUGFeRD-invoice.xml 50 | INVOICE 51 | 1.0 52 | 53 | 54 | 56 | 60 | 61 | 62 | 63 | 64 | ZUGFeRD PDFA Extension Schema 65 | urn:ferd:pdfa:CrossIndustryDocument:invoice:1p0# 66 | zf 67 | 68 | 69 | 70 | DocumentFileName 71 | Text 72 | external 73 | name of the embedded XML invoice file 74 | 75 | 76 | DocumentType 77 | Text 78 | external 79 | INVOICE 80 | 81 | 82 | Version 83 | Text 84 | external 85 | The actual version of the ZUGFeRD XML schema 86 | 87 | 88 | ConformanceLevel 89 | Text 90 | external 91 | The conformance level of the embedded ZUGFeRD data 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | -------------------------------------------------------------------------------- /facturx/xsd/facturx-basic/Factur-X_1.07.2_BASIC.xsd: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /facturx/xsd/facturx-basic/Factur-X_1.07.2_BASIC_urn_un_unece_uncefact_data_standard_QualifiedDataType_100.xsd: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /facturx/xsd/facturx-basic/Factur-X_1.07.2_BASIC_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_100.xsd: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /facturx/xsd/facturx-basicwl/Factur-X_1.07.2_BASICWL.xsd: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /facturx/xsd/facturx-basicwl/Factur-X_1.07.2_BASICWL_urn_un_unece_uncefact_data_standard_QualifiedDataType_100.xsd: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /facturx/xsd/facturx-basicwl/Factur-X_1.07.2_BASICWL_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_100.xsd: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /facturx/xsd/facturx-en16931/Factur-X_1.07.2_EN16931.xsd: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /facturx/xsd/facturx-en16931/Factur-X_1.07.2_EN16931_urn_un_unece_uncefact_data_standard_QualifiedDataType_100.xsd: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /facturx/xsd/facturx-en16931/Factur-X_1.07.2_EN16931_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_100.xsd: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /facturx/xsd/facturx-extended/Factur-X_1.07.2_EXTENDED.xsd: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /facturx/xsd/facturx-extended/Factur-X_1.07.2_EXTENDED_urn_un_unece_uncefact_data_standard_QualifiedDataType_100.xsd: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | -------------------------------------------------------------------------------- /facturx/xsd/facturx-extended/Factur-X_1.07.2_EXTENDED_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_100.xsd: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /facturx/xsd/facturx-minimum/Factur-X_1.07.2_MINIMUM.xsd: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /facturx/xsd/facturx-minimum/Factur-X_1.07.2_MINIMUM_urn_un_unece_uncefact_data_standard_QualifiedDataType_100.xsd: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /facturx/xsd/facturx-minimum/Factur-X_1.07.2_MINIMUM_urn_un_unece_uncefact_data_standard_ReusableAggregateBusinessInformationEntity_100.xsd: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /facturx/xsd/facturx-minimum/Factur-X_1.07.2_MINIMUM_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_100.xsd: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-basic/SCRDMCCBDACIOMessageStructure_100pD20B.xsd: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Order-X Basic 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-basic/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_ISO_ISO3AlphaCurrencyCode_2012-08-31.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-basic/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_ActionCode_D20A.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-basic/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_DeliveryTermsCode_2010.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-basic/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_DeliveryTermsFunctionCode_D20A.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-basic/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_DocumentStatusCode_D20A.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-basic/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_MessageFunctionCode_D20A.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-basic/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_data_standard_QualifiedDataType_128.xsd: -------------------------------------------------------------------------------- 1 | 2 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-basic/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_128.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-comfort/SCRDMCCBDACIOMessageStructure_100pD20B.xsd: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Order-X Comfort 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-comfort/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_EDIFICAS-EU_AccountingAccountType_D11A.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-comfort/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_EN16931_AllowanceChargeReasonCode_D20A.xsd: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-comfort/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_ISO_ISO3AlphaCurrencyCode_2012-08-31.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-comfort/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_ActionCode_D20A.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-comfort/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_ContactFunctionCode_D20A.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-comfort/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_DeliveryTermsCode_2010.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-comfort/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_DeliveryTermsFunctionCode_D20A.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-comfort/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_DocumentStatusCode_D20A.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-comfort/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_DutyTaxFeeTypeCode_D20A.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-comfort/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_DutyorTaxorFeeCategoryCode_D20A.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-comfort/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_MessageFunctionCode_D20A.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-comfort/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_PaymentMeansCode_D20A.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-comfort/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_128.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-extended/SCRDMCCBDACIOMessageStructure_100pD20B.xsd: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Order-X Extended 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-extended/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_EDIFICAS-EU_AccountingAccountType_D11A.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-extended/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_EN16931_AllowanceChargeReasonCode_D20A.xsd: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-extended/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_ISO_ISO3AlphaCurrencyCode_2012-08-31.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-extended/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_ActionCode_D20A.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-extended/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_ContactFunctionCode_D20A.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-extended/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_DeliveryTermsCode_2010.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-extended/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_DeliveryTermsFunctionCode_D20A.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-extended/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_DocumentStatusCode_D20A.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-extended/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_DutyTaxFeeTypeCode_D20A.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-extended/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_DutyorTaxorFeeCategoryCode_D20A.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-extended/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_EventTimeReferenceCode_D20A.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-extended/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_MessageFunctionCode_D20A.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-extended/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_PaymentMeansCode_D20A.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-extended/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_codelist_standard_UNECE_TimePointFormatCode_D19B.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /facturx/xsd/orderx-extended/SCRDMCCBDACIOMessageStructure_100pD20B_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_128.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /facturx/xsd/zugferd/ZUGFeRD1p0.xsd: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /facturx/xsd/zugferd/ZUGFeRD1p0_urn_un_unece_uncefact_data_standard_QualifiedDataType_12.xsd: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | -------------------------------------------------------------------------------- /facturx/xsd/zugferd/ZUGFeRD1p0_urn_un_unece_uncefact_data_standard_UnqualifiedDataType_15.xsd: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [project] 2 | name = "factur-x" 3 | version = "3.6" 4 | description = "Factur-X and Order-X: electronic invoicing and ordering standards" 5 | authors = [{name = "Alexis de Lattre", email = "alexis.delattre@akretion.com"}] 6 | readme = "README.rst" 7 | classifiers = [ 8 | "Programming Language :: Python", 9 | "Topic :: Office/Business :: Financial :: Accounting", 10 | "Development Status :: 5 - Production/Stable", 11 | "Intended Audience :: Developers", 12 | "License :: OSI Approved :: BSD License", 13 | "Operating System :: OS Independent", 14 | ] 15 | keywords = ["e-invoice", "ZUGFeRD", "Factur-X", "Order-X", "e-procurement"] 16 | license = {file = "LICENSE"} 17 | requires-python = ">=3.7" 18 | dynamic = ["dependencies"] 19 | 20 | # Needed if we enable facturx-webservice 21 | # [project.optional-dependencies] 22 | # web = [ 23 | # "flask" 24 | # ] 25 | 26 | [project.urls] 27 | Homepage = "https://github.com/akretion/factur-x" 28 | Source = "https://github.com/akretion/factur-x" 29 | Issues = "https://github.com/akretion/factur-x/issues" 30 | 31 | [project.scripts] 32 | facturx-pdfgen = "facturx.scripts.pdfgen:main" 33 | facturx-pdfextractxml = "facturx.scripts.pdfextractxml:main" 34 | facturx-xmlcheck = "facturx.scripts.xmlcheck:main" 35 | # I consider the webservice scripts as a proof of concept, not real clean code 36 | # facturx-webservice = "facturx.scripts.webservice:main" 37 | 38 | [build-system] 39 | requires = ["hatchling", "hatch-requirements-txt"] 40 | build-backend = "hatchling.build" 41 | 42 | [tool.hatch.metadata.hooks.requirements_txt] 43 | files = ["requirements.txt"] 44 | 45 | [tool.hatch.build.targets.wheel] 46 | packages = ["facturx"] 47 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | pypdf>=3.15.0 2 | lxml 3 | --------------------------------------------------------------------------------