easybill / e-invoicing

A library for PHP to generate and read EN16931 conform structured XML data.
MIT License
3 stars 2 forks source link

GLN missing in ElectronicAddressScheme.php #10

Open noone-silent opened 4 hours ago

noone-silent commented 4 hours ago

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

BolZer commented 3 hours ago

Thank you for addressing the issue. I'll take a look in the next couple hours and give you feedback.

BolZer commented 1 hour ago

@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:

https://ec.europa.eu/digital-building-blocks/sites/display/DIGITAL/Registry+of+supporting+artefacts+to+implement+EN16931?preview=/467108974/809173046/EN16931%20code%20lists%20values%20v14%20-%20used%20from%202024-11-15.xlsx#RegistryofsupportingartefactstoimplementEN16931-Codelists

(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?