I've tried 3 ways
pay the invoice and then record a debit offsetting the payment. Messes up the totals but the balance is the same.
pay the invoice and then apply a 100% refund in the payment screen. This doesn't seem to work as the invoice is not marked as pay.
us a credit note. I've created a new invoice then marked it as a credit note type. I've hit pay on the invoice that needs to be written off and selected the credit note. It doesn't apply the credit note.