If you create a Sales Invoice from a Sales order there is a column called “Invoice Reference” which shows the Sales order Number when the Sales Invoice is Printed using the Standard Sales Order invoice layouts. This is either printed in the header of the Sales Invoice if the Sales invoice has been created from one Sales order:
Or it is printed next to the description if it has been created from more than one Sales Order
You can add the Invoice Reference field to the Sales Invoice entry form in order to see what Sales Order the invoice was created from.
If you have added this field to the Sales Order entry form and entered your own Invoice Reference number, this is then overwritten with the Sales Order number when the Sales Invoice is created.