This is usually the case when a customer has an open credit on your end, and the system automatically applies it to a new invoice @Cliff1965.
QuickBooks Online (QBO) has a feature that does this type of operation, and it's enabled by default.
To check, follow the steps below:
Go to the Gear icon.
Select Account and settings.
Tap the Advanced tab.
Look for the Automation section, then click to view the options available.
Ensure the Automatically apply credits option is disabled.
Hit Save, then Done.
The next thing you'd want to do is remove the payment from the invoice. Here's how:
Highlight the Sales tab.
Select Invoices.
Locate the invoice in question, then tap the drop-down menu under the Action column.
Choose View/Edit.
Press the link under the PAID status.
Click the link that shows up on the pop-up window.
This will open the Receive payment window. From here, you need to scroll down the page, then press the Clear Payment button. This will reopen the invoice, with no payment attached to it.