your going to need to use 2 separate record sets.
one to return the invoices and another to return the products.
the products record set will need to be inside the first repeat slection loop and filter using the value returned from the invoices recordset.
If you are comfortable hand coding PHP code and creating recordsets, this should not be to difficult to accomplish, if you are not comfortable hand coding PHP, I would suggest signing up for a premier ticket where you could work one on one with an engineer to create the code.