Once the real costs can be charged, the deposit paid by the guest on forehand should be settled with the costs to be paid.
01. Book deposit/advance payment reverse
To settle the deposit/advanced payment the guest already paid for, an extra has to be added to the reservation having the value in negative of the deposit/advanced payment that's already in the reservation.
This easily could be done in CICO as well on Check-out by adding the same extra for number = -1.
02. Deposit/advance payment in reverse on the bill
An extra should be available where the checkbox "Invoice adjustment extra" has been selected, as well as the checkbox "Allow customization of Name/Price during reservation:".
This extra should have a negative rate, based on the deposit. So if the deposit has a value of €200, the Invoice adjustment extra should have a value of -€200.