Select for credit note.
If invoice has more than 64 rows:
First 64 records have same RecId value in projInvoiceItemDetailTmp and tmpProjTransIdItem. But nexts rows have diferent values for RecId field.
If the invoice has more than 64 (or 128) lines there is a problem, because these fields are used to relate both tables (clicked Credit invoicing button), and system relate to incorrect row.