In Spain it is legally possible that billing documents to be issued by a third party or by the recipient of the operation (customer).
https://sede.agenciatributaria.gob.es/Sede/iva/facturacion-registro/facturacion-iva/facturas-expedidas-destinatario-terceros.html
For these cases, the customer generates the invoice on behalf of the billing party and the invoice number created by the customer should be identified and not an automatic invoice number.
Maybe enabling already existing feature in other localizations could be useful
https://learn.microsoft.com/en-us/dynamics365/finance/localizations/europe/emea-edit-invoice-id-sales-orders
This invoices should have specific consideration in the SII.
Se deberá consignar en el Libro registro de Facturas Expedidas la clave “S” correspondiente a “Factura emitida por terceros”.