As invoice is “printed” when invoice is posted, report invoice could be added as attachment in the ubl peppol bis 3 file. Here’s an example with a report saved as pdf file (still needs improvements).
Adding a property to convert report in base64 in account_invoice/invoice.py
class Invoice(metaclass=PoolMeta):
__name__ = 'account.invoice'
@property
def base64_report(self):
if self.invoice_report_cache:
return (base64.b64encode(self.invoice_report_cache)).decode('ascii')
For me it is a matter to use the European tax identifier instead of the local tax identifier on the invoice.
Now I do not know how I could enforce this except by removed national identifier from the tax identifiers (but it is not backward compatible).
I seems it should be at least one of <cbc:BuyerReference> or <cac:OrderReference> / <cbc:ID>.
I guess for <cbc:BuyerReference> we could fill with the Invoice.reference if filled.
And for <cac:OrderReference> / <cbc:ID> it should be the origin but the problem is that Tryton may have multiple origins.
As far as I understand despite the documentation for <cbc:DocumentTypeCode> saying that the default value is 130 (which was the reason I set it to this value).
This code 130 seems to indicate that the document is not attached but just providing via the <cbc:ID>.
I do not find such rule in Peppol BIS Billing 3.0 - May 2025 Release
And it will be strange to have to prefix with the country code a number that is already defined as being from this country with the schemeID.
I found this Peppol Code Lists - Participant identifier schemes with some validation (the 0208 is defined as to validate like in python-stdnum ) but there are no validation for all the EU schemeID starting at 99xx.
I have opened a ticket to https://peppol.org/ about the missing of clear formatting for those values.
But I’m not sure it is a problem because we base the assumption on the Peppol directory for which the participant ID is probably sanitized and formatted.