I am not sure why you want to create 1 invoice for multiple sales order. Or what is the business requirement.
But you can have a custom field on the invoice body or and in the sublist line that tags each sales order.
Ideally what some of the business wants is instead of sending multiple invoices to the customer, send only one.
So it will be easier for you to generate the pdf of the invoices in grouped form.