Hello, Ghaith. There are two reasons why the transactions are not appearing when selecting a customer. Either the invoice is already paid, or the invoice was not created for the same customer you are using for the credit memo.
Please note that we cannot link a credit memo if the invoice is already paid. To verify, navigate to All apps > Sales & get paid > Invoices. Locate the invoice and check its status.
We also need to ensure that the customer name is identical on both the credit memo and the invoice. If they do not match and the invoice is still unpaid, you can edit the credit memo's customer name:
Go to Customers & leads.
Locate and click on the customer's name to view their transactions.
Find the credit memo and click View/Edit.
Change the customer name, then click Save and close.
Once done, you are ready to link the credit memo to your invoice:
Go to + Create and click Receive payment.
Select the customer's name.
Check both the created credit memo and the invoice.