enter a deposit in the checking account in the total amount, use a clearing expense account as the source account for the deposit
then enter the cash payment from the cash account and use that same clearing expense account as the expense for the check.
The deposit and the check will cancel in the clearing expense account, and when you reconcile check off the deposit against the old check