@Override public double totalEstimatedQuantityForPreviousREs(final Long woActivityId,Long estimateId,final Long activityId,final WorkOrder workOrder){
  if (estimateId == null)   estimateId=-1l;
  Object[] params=null;
  Double estQuantity=null;
  params=new Object[]{estimateId,workOrder,workOrder,woActivityId,activityId};
  estQuantity=(Double)genericService.findByNamedQuery("totalEstimatedQuantityInRE",params);
  Double estQuantityRE=null;
  params=new Object[]{estimateId,workOrder,workOrder,activityId};
  estQuantityRE=(Double)genericService.findByNamedQuery("totalEstimatedQuantityForPreviousREs",params);
  if (estQuantity != null && estQuantityRE != null)   estQuantity=estQuantity + estQuantityRE;
  if (estQuantity == null && estQuantityRE != null)   estQuantity=estQuantityRE;
  if (estQuantity == null)   return 0.0d;
 else   return estQuantity.doubleValue();
}

@ Override public double totalEstimatedQuantityForPreviousREs ( final Long woActivityId , Long estimateId , final Long activityId , final WorkOrder workOrder ) { if ( estimateId == null ) estimateId = - 1l ; Object [ ] params = null ; Double estQuantity = null ; params = new Object [ ] { estimateId , workOrder , workOrder , woActivityId , activityId } ; estQuantity = ( Double ) genericService . findByNamedQuery ( "totalEstimatedQuantityInRE" , params ) ; Double estQuantityRE = null ; params = new Object [ ] { estimateId , workOrder , workOrder , activityId } ; estQuantityRE = ( Double ) genericService . findByNamedQuery ( "totalEstimatedQuantityForPreviousREs" , params ) ; if ( estQuantity != null && estQuantityRE != null ) estQuantity = estQuantity + estQuantityRE ; if ( estQuantity == null && estQuantityRE != null ) estQuantity = estQuantityRE ; if ( estQuantity == null ) return 0.0d ; else return estQuantity . doubleValue ( ) ; }
similar to totalestimatedquantityforre but will consider only previous res and not all res
