How to record a check for a credit issued on a job after the job had been paid in full

We had invoiced a job/customer for 100% of the contract.  The customer has paid in full.  After the fact, we realized the customer paid a vendor directly so we need to issue a credit and check back to the customer.  I can issue a credit against the job which will correct the contract amount.  But now how do I get rid of the customer credit in A/R.  And how should I post the check to reimburse them for the cost?

Thank you