-
Notifications
You must be signed in to change notification settings - Fork 40
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
AdditionalDocumentReference error #68
Comments
Same error message also exists when I completely omit the |
@idilalemdar sorry for the late response. Can you please share the document you want to parse. It seems like the order of elements is incorrect according to the XML Schema. |
No problem. I cannot share the whole document but I have 2 AdditionalDocumentReference's, rigth before them I have these lines:
And after the two AdditionalDocumentReference, I have fields like cac:Signature, cac:AccountingSupplierParty, cac:AccountingCustomerParty etc. |
Sorry, I can't make sense of the error message. |
The example XML I have has xmlns="" as namespace under most of direct children of invoice, including AdditionalDocumentREference, like:
However the invoice I create does not include it:
Besides, the example XML2s namespaces look like this:
whereas the invoice I generate:
Could it be that these differences would cause any error in UBLTR? Also mentioned about this here: #56 (comment) |
The empty <cac:AdditionalDocumentReference xmlns="">
<cbc:ID>1234567</cbc:ID>
<cbc:IssueDate>yyyy-mm-dd</cbc:IssueDate>
<cbc:DocumentType></cbc:DocumentType>
</cac:AdditionalDocumentReference> As this example uses the This also applies to your second example: the namespace prefix list does not matter. You could also use the following namespace prefixes, and the example would be identical, as long as the <hugo:AdditionalDocumentReference xmlns="">
<bla:ID>1234567</bla:ID>
<bla:IssueDate>yyyy-mm-dd</bla:IssueDate>
<bla:DocumentType></bla:DocumentType>
</hugo:AdditionalDocumentReference> Think of namespace prefixes as "macros" that make the file shorter when you serialize it to disk. The "in-memory" representation always uses the URLs resolved from the namespace prefixes |
For those who might encounter the same problem in the future, here is the solution: Turns out that UBLTR invoice also requires the element cbc:LineCountNumeric, where it denotes the number of invoice lines. Example invoice did not have that field, so I didn't add it at first but adding LineCountNumeric field solved my problem. |
Hello,
I have been trying to create an Invoice with UBL2.1, specifically UBLTR. Everything UBLTR asks is OK in my invoice, except when I try to send my invoice to the provider, the response body shows me this error:
I do not understand,
AdditionalDocumentReference
is a valid field under Invoice type and the example XML I have, which is a valid UBLTR Invoice, also has this field. I have been able to resolve all other UBL schematron errors but I am clueless on this one. Any help is deeply appreciated, thank you very much in advance.The text was updated successfully, but these errors were encountered: