To show the Remaining Amount of all Customer Deposits linked to a specific Sales Order record:
Create a Transaction Saved Search as follows:
- Criteria (Use Expressions)
- ( Type IS Deposit Application AND
- Created From Fields > Sales Order IS Sales Order #xyz ) OR
- ( Type IS Customer Deposit AND
- Created From IS Sales Order #xyz )

Results
- Formula (Numeric) (Summary type SUM):
CASE WHEN {type} = 'Customer Deposit' THEN {debitamount} ELSE -{creditamount} END
