In contingency cases, generally a lawyer agrees to take a percentage of the money received from the other party, if any plus the cost incurred.  

CaseFox can handle this type of fee agreements.  When you setup a case, just treat the case as a normal no limit fee case and enter your time and expenses.  At the conclusion of a case, click on the "Cases (Projects)" and then select the case.  At the bottom of the right side pane, you will see total fees and expenses.  That will enable you to deduct the expenses from the total proceeds from the other party and then calculate your fee percentage.

It is important to track all your hours in contingency cases for the purpose of attorney fee motions and/or billing the client on quantum meruit basis if your services are discharged prior to the conclusion of the case.