This sometimes happens when a Trader has a business account.
First re open the deal if closed making a note of the date closed so when you re close you can close to the same date.
Then you'll need to credit the invoice on the deal, once you have credited the deal you then reinvoice it back out, but change the invoice drop down from personal to "other account" and select the sales ledger account for the customer (As this is a business customer the personal account details are blank).
That will post the invoice onto the account, then you can then clear off the unallocated balance on the account against the invoice.