It looks like the advanced payment is a retainer. You'll have to add the deposit to the separate trust account first. Then, when you create the invoice, you can use the payment to pay the transaction.
You can refer to these articles for more information: