I'm assuming you used the 'Receive Payments' function to record your deposits prior to the job being done. When you receive a payment without linking it to a particular invoice, QBO saves it as a credit to your customer.
Once your invoice is created, go back to the payment you received for that customer, and a list of outstanding invoices will be shown. Apply the credit to the applicable invoice(s) and save. This is probably easiest done by going to Sales-->Customers and viewing the Transaction List. You will see any unapplied credits there. Open them and apply the payments to the outstanding transaction(s).