When importing sales invoices from 3rd party systems that generate their own invoices numbers and using standard D365 sales order processing that there was a setup/configuration that used the 3rd party application invoice reference as the D365 invoice number reference.
I believe there have been customizations in the past trying to use number sequences.
https://community.dynamics.com/forums/thread/details/?threadid=a83a4fc3-ab58-4ba8-a074-f06d2f4cf7ce
It may be a simpler solution of allowing the 3rd party invoice number reference to be captured on the Sales Order and a flag on the sales order to use the 3rd party invoice reference as the D365 invoice number when posting the Sales Order.
There is some other parameters such as the invoice date to be the same as the confirmed delivery date.
Also please reference idea
https://experience.dynamics.com/ideas/idea/?ideaid=a3ed1281-9b9d-e911-80e7-0003ff688f4e
Ideally the the setup should be able to cater for standard D365 OOTB functionality and to import 3rd party sales order and their invoice posting using the 3rd party invoice reference.