josemmo / einvoicing

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

Question about BaseQuantity #21

Closed KlemenPal closed 2 years ago

KlemenPal commented 2 years ago

Hi! Just a question - is there a specific reason why BaseQuantity in InvoiceLine isn't added to the XML if value is 1? https://github.com/josemmo/einvoicing/blob/967d57e75715729b62b7bec01d8bb339eb1a3ce7/src/Writers/UblWriter.php#L947

josemmo commented 2 years ago

Hello @KlemenPal,

Yes, by default the base quantity of an item is 1. If the <cbc:BaseQuantity /> UBL element is omitted from a document, it fallbacks to the default value.

By convention, the <cbc:BaseQuantity /> element is omitted if it has a value of 1.

KlemenPal commented 2 years ago

Thanks for the information 👍