The standard process in SO for recording a customer deposit on an order is to record the cash receipt through AR. You process the customer payment but rather than apply it to an invoice or a PP invoice, you apply it to the customer deposit GL account. This results in an increase to a liability account rather than a decrease to AR. The prepayment is not reflected on the customer account record. (For example sake, let's say the deposit is for $2,500.)
Next, you create the order and record the deposit on the Totals tab by indicating the type of payment (cash, check, or CC), the amount, and the payment reference, ie check #. (For this example, invoice is for $5,000 and the deposit amount is $2,500 with the same check number recorded above.)
When you post the SO Invoice, the system records $5k in revenue, $2,5k as AR, and reduces customer deposits by $2.5k. In customer maintenance, you will set an invoice for $5,000 with a payment of $2,500 applied to it in the invoice application details. You do not need to process another payment record.
My problem comes when I tried to reverse the invoice (assume the customer rejected the shipment due to damage in transit.) When I do this, the detail of the transaction application foots to zero but the invoice still shows a balance.