Details
-
Type: New Feature
-
Status: Open
-
Priority: Major
-
Resolution: Unresolved
-
Affects Version/s: 5.10.0
-
Fix Version/s: 5.13.0-b1
-
Component/s: Client Interface, Staff Interface
-
Labels:None
Description
Some countries are requiring e-invoice, digital invoice formats. A common one that we've received the most requests for is "UBL XML". There is likely to be other formats in the future, so this should be as modular as possible, using a template type of file for the "UBL XML" file, with the ability to drop in other files for different formats.
This was requested here: https://requests.blesta.com/topic/user-defined-invoice-formats
Attached are a couple example UBL XML invoices. A UBL XML invoice can be tested here https://test.erechnung.gv.at/erb/en_GB/tec_test_upload to see if it meets the requirements. Though, there appears to be issues with these 3 examples included in this task.
Examples:
https://www.erechnung.gv.at/files/xml/example-peppol-ubl.xml
https://docs.oasis-open.org/ubl/os-UBL-2.1/xml/UBL-Invoice-2.1-Example.xml
https://github.com/Tradeshift/tradeshift-ubl-xsd/blob/master/src/test/resources/org/oasis-open/ubl/examples/UBL-Invoice-2.1-Example-Trivial.xml
More Specs:
http://www.datypic.com/sc/ubl22/e-ns47_Invoice.html
Potentially Useful Article:
https://www.vatcalc.com/romania/romania-b2b-ro-e-invoicing-efactura-update/
Admin Area
Settings
Under Settings > Company > Billing/Payment, add a new subnav item called "Electronic Invoices".
The page should check the file system in the designated spot for any digital invoice templates. Each template type should be in its own directory with a json file that includes the name of the format, the file extension, and possibly version. There should be at least 1 more file in this directory that constitutes the template which will be used for generating the digital invoice.
Each format can be enabled or disabled here. If they are enabled
Invoice Caching
If invoice caching is enabled, a cache of this file format should be written to the cache with the JSON or PDF versions as well, and this version should be downloaded from the cache if it is cached. Although, it may be better if caching is enabled to populate the file from the JSON file that is already cached- the reason is that if caching is enabled prior to enabling this feature, the cached file will not match the other cached files. So, if possible instead of caching the file, simply generate it on fly from the data in the JSON file that is already cached.
Client Area
Under the client area, within the invoices widget is a drop down to view and download the PDF version of the invoice. For any digital invoice formats that are available and enabled, there should be an option called "UBL XML", or whatever the name of the format is called. Like the "Download" option, clicking "UBL XML" (or the name of the format) will download the file to the clients computer.