Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for UBL #36

Closed
wants to merge 7 commits into from
Closed

Support for UBL #36

wants to merge 7 commits into from

Conversation

duskybomb
Copy link

I have done some work on UBL, till now reading, editing of fields and export is working.
@m3nu can you check it and tell what is missing and what should I do differently?

Issue #26

@duskybomb
Copy link
Author

example:

from facturx import *
from datetime import datetime as dt


factx = FacturX('no_xml_invoice.pdf', 'ubl2-1', '2.1')
print(factx['date'])
factx['date'] = dt.now()
print(factx['date'])
factx['currency'] = 'INR'
print(factx['currency'])

@m3nu
Copy link
Collaborator

m3nu commented Jul 13, 2018

Why is the version number needed 2x? (2.1?)

Why are there so many new files?

@duskybomb
Copy link
Author

duskybomb commented Jul 13, 2018

Why is the version number needed 2x? (2.1?)

One way of doing UBL support is by having 2.0 and 2.1 as levels, but the problem with it is, they follow different XPaths for same fields (sometimes). For Example:

currency
        ubl2-0: //cac:PaymentMeans/cbc:CurrencyCode
        ubl2-1: //cbc:DocumentCurrencyCode

It's not suitable to use them as levels under a single standard UBL. Hence, the need of version number.

Why are there so many new files?

The UBL has two folders inside it's xsd folder: common and maindoc. Common contains files like
CodeList_CurrencyCode_ISO_7_04.xsd and CodeList_LanguageCode_ISO_7_04.xsd through which it validates the xml. Common contains 12 and 14 such files for 2.0 and 2.1 respectively. Hence so many new files. I haven't tested it without those file, I should. Thanks for the pointer

@duskybomb
Copy link
Author

I tried it without those files and it didn't work, hence, these files are needed.

@m3nu
Copy link
Collaborator

m3nu commented Aug 9, 2018

Passing on this one.

@m3nu m3nu closed this Aug 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants