Refund

There does seem a few steps backwards to get any overpayments on a supplier account to a position where they are refundable from a specific supplier account.

The glitch is payments have been paid via direct debit each month, but when the account is closed (transferrred to another supplier) you will be holding pre-payments (unallocated payments) , as the final bill does not include this money or shows that a refund will be given for the overpayments.

So a final line added to the final bill from the supplier for the balance of pre-payments on the account. Then create a credit note from the invoice and remove the lines that are legitmate usage lines and just issue the credit note for the final line from the final bill.

Also this knowledgebase article might provide some background about the subject Managing credit notes