How to refund a deposit invoice

How to refund a deposit invoice

As per our conditions we ask for 100% down payement to confirm any order. We issue a deposit invoice and match it with payement received.
Sometimes, the order can't be fulfilled due to lack of stock. 
If I create a credit note and match it with the payement refund thd customer account is not balanced. It's négative.

What is the proper way to refund a canceled down payement ?