1. Go to Transactions > Customers > Record Customer Deposits > List and click View against the relative deposit.
2. Click the Apply button at the top of the transaction.
3. Click the Apply subtab and check the Apply checkbox for the relative invoice.
4. Click Save.
Your deposit will now be applied to this invoice.