Hello and welcome to the Community forum, billib-iafrica-c.
Let me share some information on how to unlink the credit that has been applied to the wrong invoice in QuickBooks Online.
We'll have to delete the payment to unassign the credit to the invoice. Then, we can use the credit in the future invoice and allocate it to the right transaction. Let me show you how to do it. Here's how:
Go to Sales on the left panel.
Find the name of the customer.
Open the payment by clicking it.
Click More at the bottom part of the page. Then, select Delete.
Hit Yes to confirm.
Here are the sample screenshots for additional reference:
Note: We can turn off the Automatically invoice unbilled activity feature in the Account and Settings. It'll stop QuickBooks from applying the available credits to the open invoices automatically. See the steps below on how to turn it off:
Go to the Gear icon.
Select Account and Settings under Your Company.
In the Advanced tab, click the Automation edit icon.
Make sure the check-mark in the Automatically invoice unbilled activity box is removed.