GLN missing in ElectronicAddressScheme.php
Closed this issue · 6 comments
According to the documentation of the UBL Standard, there is a schemeID GLN
for addresses, parties etc. This is missing in the ElectronicAddressScheme.php
class and throws an Exception:
private ?Throwable 'previous' (Exception) =>
object(ValueError)[971]
protected 'message' => string '"GLN" is not a valid backing value for enum easybill\eInvoicing\Enums\ElectronicAddressScheme' (length=93)
private string 'string' (Error) => string '' (length=0)
protected 'code' => int 0
protected string 'file' => string '/var/www/vendor/easybill/e-invoicing/src/Handlers/AbstractBackedEnumHandler.php' (length=79)
protected int 'line' => int 57
private array 'trace' (Error) =>
UBL documentation sample with GLN scheme: http://www.datypic.com/sc/ubl21/e-cac_AccountingCustomerParty.html
Thank you for addressing the issue. I'll take a look in the next couple hours and give you feedback.
@noone-silent Could you please explain your use case or provide the UBL document? Are you trying to read / create a EN16931 compliant UBL document?
The official codelist of EN16931 does not state, that the value GLN is supported or to be expected as EAS value.
You may take a look at the list here:
(You should download the list, as it is a xlsx and way easier to navigate in excel).
The enums and the basic principle of the library is to be compliant to EN16931 and not to fully support the specification of UBL or CII. Maybe the value GLN was supported in an older version of EN16931. Maybe it is missing from the codelist?
Thank you for coming back to me. I validated the UBL file with the KOSIT validator and there was no error regarding the schemeID="GLN"
(there have been other errors, but not about this).
The question here is, what is the correct way? Should unknown schemeID
just be ignored (like in the validator) or not?
Edit: I could not attach the file here, so I put it here into a gist: https://gist.github.com/noone-silent/a525a6662943a1425e173dc4f7b0f807
Interesting! Thank your for linking the document. I'll look into it again and check the schematron rules for the case.
I used the following validators:
https://github.com/easybill/en16931-validator (for straight EN16931 validation)
https://hub.docker.com/r/easybill/kosit-validator-xrechnung_3.0.2 (for XRechnung validation)
Both validators return several errors, including the error: BR-CL-25.
{
"rule_id" : "BR-CL-25",
"rule_location" : "/*:Invoice[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:Invoice-2'][1]/*:AccountingSupplierParty[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:Party[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2'][1]/*:EndpointID[namespace-uri()='urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2'][1]",
"rule_severity" : "FATAL",
"rule_messages" : [ "[BR-CL-25]-Endpoint identifier scheme identifier MUST belong to the CEF EAS code list" ]
}
Which is not a warning (which could be ignored), but a fatal error.
You can use the following XRechnung-Validator, which is offered by the federal state of Badem-Würtemberg.
https://erechnungsvalidator.service-bw.de/
You'll receive the same error for the Business-Rule "BR-CL-25".
Which validator did you use for your validation? :)
Sorry, this is my fault. I only used the KoSIT CLI validator (1.5.0) for a quick check and the error message there was truncated. After opening the XML report I get all errors.