This is how I do this and it is really simple.
Make a deposit and put "Account's Receivable" in the account column. Make sure the customer field had the correct customer. This will automatically record the payment as an un-applied payment. Then when you create the invoice, just apply this credit to the invoice and it's all done. No need for anything else. It just reduces your A/R until the invoice is made.