josemmo / einvoicing

Library for reading and creating European-compliant electronic invoices (EN 16931)
https://josemmo.github.io/einvoicing/
MIT License
116 stars 30 forks source link

Missing Field in UBL XML Generation #59

Closed francessergi closed 1 month ago

francessergi commented 3 months ago

It appears that the library is missing a field in the generated UBL XML files. Specifically, the Invoice/cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:TaxLevelCode field is not being generated.

Steps to Reproduce: Generate an invoice using the library. Check the generated XML file. Observe that the TaxLevelCode field within the PartyTaxScheme of the AccountingSupplierParty is missing.

Expected Behavior: The generated XML should include the Invoice/cac:AccountingSupplierParty/cac:Party/cac:PartyTaxScheme/cbc:TaxLevelCode field with the appropriate value.

Actual Behavior: The TaxLevelCode field is missing from the generated XML.

XML Example: Here is a snippet of the expected XML structure for reference:

<Invoice>
  <cac:AccountingSupplierParty>
    <cac:Party>
      <cac:PartyTaxScheme>
        <cbc:TaxLevelCode>XYZ</cbc:TaxLevelCode>
      </cac:PartyTaxScheme>
    </cac:Party>
  </cac:AccountingSupplierParty>
</Invoice>
josemmo commented 3 months ago

Hello @francessergi,

The library doesn't support the <cbc:TaxLevelCode /> element at the moment. What CIUS are you using that needs it? I've tried finding a BT-* mapping for it in the EN 16931 standard and I couldn't.

francessergi commented 3 months ago

Hello Josemmo,

I found this node in the EN16931 Italian extension. I am leaving you a link where more information is available: https://peppol-docs.agid.gov.it/docs/xml/ITA/peppol-bis-invoice-3/agid-ubl-invoice.html

In the link I passed you, there are also a series of nodes that are not found in the library, I am referring to the <ext:*> nodes.

For now, I have opted to extend some of the classes in your library and decorate them with the missing elements. Do you think these nodes will be added to the library in the future?

Thank you for your work and best regards.

josemmo commented 2 months ago

Do you think these nodes will be added to the library in the future?

Honestly, I might not be able to. I'm maintaining this library in my spare time, and this feature seems like it would require a significant effort.

Do you have any suggestions as to what modifications would need to be made to the library to accommodate these sorts of changes related to CIUS? I'm particularly thinking about modifying the AbstractPreset class.