TrackStudio Enterprise 3.5
Example 3

To calculate a summary of the actual time for all not-closed tasks, use the following Task / Custom Field Value script:

public double getAbudget(Object t) {
  double d = 0;
  if(t.getActualBudget() != null && t.getClosedate() == null && t.getChildrenCount() == 0)
    d = t.getActualBudget().doubleValue();
  for(Iterator it = t.getChildren().iterator(); it.hasNext();)
    d += getAbudget(it.next());
  d += t.getActualBudget().doubleValue()-d;
  return d;
}
return getAbudget(task);

Associated custom field properties:

Property 
Value 
Type 
Float