Once you delete the refund, use the credit note to pay another invoice.
Use the From and To boxes to adjust the date range. Select More and under Type choose the relevant transaction type.
Now you've delete the refund. You can match the credit note to the correct invoice.