Invoice the order too many times (it's a bug that this happens). On the order line it should say that Qty Invoiced > Delivered Qty.
The generate invoices (manual) doesn't pick up this problem. It shows the order that has Qty Invoiced > Delivered Qty but no invoice is created.
Create the Credit Memo and use create from order.
The Qty Invoiced value will be increased and not decreased as it should.
Suggested patch (version 2.0), might apply to later versions as well.
Open to log time.
To detect if there are data errors, the following query can help:
And the corresponding update can help to fix the data: