If you want to cancel an order, select the required order line and select the cancel order button on the right hand side of the window as shown below:
This will then create a credit for the deposit as shown below:
Click the Customer option on the left hand side of the window.
This will automatically display the required customer on window. Select Confirm to raise the credit note.