It transpired that the purchase invoice wasn't actually for us so the company sent us a cheque to repay the payment.
I can't figure out how to treat the transaction. Do I leave the invoice on the purchase ledger as the supplier account is at a nil balance and code the cheque received to the expense code of the original invoice, or do I have to cancel the invoice which will then leave the payment outstanding on their account, and if I do that what do I do with the cheque received?
If yes, then you should raise a credit note against the invoice. Then debit the bank and credit your suspense account with the value of the cheque and raise an invoice on the supplier account for the full amount but post it to suspense to cancel out the cheque.
If no VAT, then debit the bank and credit the expense account as you suggested.