You can create a journal entry to reverse the incorrectly allocated invoice and cancel the original cheque receipt. Here's a simplified version of the journal entry:
- Debit: Accounts Receivable (to reverse the invoice)
- Credit: Accounts Payable (to reverse the original cheque receipt)
Make sure to consult with your accountant or financial advisor for specific guidance tailored to your situation.