I have some details why this happen and will walk you through the steps on how you can turn off the option.
In QuickBooks Online, we have a feature called Automatically apply credits. When the option is enabled in the settings, any credits available for the same customer will be applied to the new invoice. Most companies have this option enabled, so they don't have to apply the credits manually.
Let's review your settings by following these steps:
Go to the Gear > Account and settings.
On the left panel, click Advanced.
In the Automation section, check to see if the Automatically apply credits box is checked. You can turn this feature off, and manually apply the credits moving forward.
Hit Save and then Done.
After the steps, follow these instructions to un-link the credit that is attached to the invoice:
Go to Sales > Customers.
Select the customer's name.
Click to open the invoice.
Under the PAID status, click the 1 payment made link.
Select the date of the payment. This will open the Receive Payment window.