ZUGFeRD / mustangproject

Open Source Java e-Invoicing library, validator and tool (Factur-X/ZUGFeRD, UNCEFACT/CII XRechnung)
http://www.mustangproject.org
Apache License 2.0
207 stars 115 forks source link

Add URIUniversalCommunication on TradeParty for Peppol EndpointId #282

Closed chris-webert-its4u closed 2 years ago

chris-webert-its4u commented 2 years ago

Hello, we're using Mustang to generate Factur-X invoices in our solution and it works great so far. We'd like to send Factur-X documents outside of France (mainly Luxemburg for now) as well, through the Peppol Network, but it doesn't seem to be possible as for right now.

From what I've gathered from the "OpenPeppol Invoice CII" ruleset and this mapping file between UBL and CII for Peppol, both seller and buyer trade parties require an electronic address ram:URIUniversalCommunication/ram:URIID with schemeId to the EAS list.

Would it be possible to add this as an optional feature? Thank you!

jstaerk commented 2 years ago

Hi, new attributes are easy but we are currently focussed on UN/CEFACT Cross Industry Invoice, but the invoice cii ruleset is completely new doesn't Peppol require UBL? Mustang does contain Philip Helgers CII2UBL functionality, though, which may be based on that mapping, are you planning on using that?

chris-webert-its4u commented 2 years ago

I thought Peppol required UBL too, but since the ruleset for CII exists I imagine Peppol must accept CII as well? I got this schematron from the Peppol BIS Billing 3.0 github (I'm honestly lost between all the regulations, we're going step-by-step and if we can stick to CII with Factur-X for both Chorus Pro and Peppol it'd be awesome).

We haven't try the CIIToUBL converter yet, maybe there is a way to achieve what we want with it indeed. But to my understanding it works by converting an existing XML file? We're using the Mustang classes to generate the Factur-X pdf right now, since it's more convenient for our customers. Is there a way to embed an UBL xml file to the pdf using Mustang? I know you can provide a custom XML, can we generate the UBL version with the Mustang classes and the CIIToUBL converter, or do we have to export it as CII xml first and then use the converter? I haven't found much documentation for it on the website, sorry.

Thank you.

jstaerk commented 2 years ago

Apparently one can opt to receive CII from Peppol (https://docs.peppol.eu/poacc/billing/3.0/bis/#_cross_industry_invoice) but sending muss happen in UBL. Yes its possible you have to specify a file, potentially due to the library I would have to check. And no, there is no way to embed UBL in PDF because there is no Standard for that, Factur-x/ zugferd is (even in Referenzprofil Xrechnung) CII only.

chris-webert-its4u commented 2 years ago

UBL seems to be the way to go then, although I don't really understand how you could receive CII if you can't send it through Peppol in the first place.

After tinkering a bit with Helger's converter, we managed to successfully convert our CII xml into a UBL one and passed the Peppol BIS validation test. For context: we tried at first to specify a GlobalId on both seller and buyer and use the CIIToUBL converter from Mustang (the mapper is supposed to map the GlobalId from CII to a URIUniversalCommunication in UBL), but we weren't successful. So we used the CIIToUBL22Converter from Helgers directly instead and set the EndpointId ourselves through the JAXB classes before saving the file back to XML, and it worked! Also, we had to change the CustomizationId to urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0 because the default value was deprecated (it was updated in v1.4.2 of en16931-cii2ubl, Mustang is currently using v1.3.0).

We decided to generate Factur-X by default for now, and we added an option to download the UBL xml file as well for customers that use Peppol.

Thank you for your time, I'll close the issue since it doesn't seem to make sense to add the URIUniversalCommunication for UN/CEFACT CII if Peppol doesn't accept it anyway.

Best regards.