Payment Writeoff

When I am entering a payment, if the customer underpays and I want to write that off, I assumed I would add this in the write off section of the payment entry. However I’m noticing that the invoice remains open with an overdue balance of the under payment. I want the invoice to close as fully paid. Am I missing a step somewhere or doing this incorrectly?