question: @ Override public double totalEstimatedQuantity ( final Long woActivityId , Long mbHeaderId , final Long activityId , final WorkOrder workOrder ) { Date currentTimestamp = null ; MBHeader mbHeader = null ; if ( mbHeaderId == null ) { mbHeaderId = - 1l ; currentTimestamp = new Date ( ) ; } else { mbHeader = persistenceService . find ( " from MBHeader where id = ?" , mbHeaderId ) ; currentTimestamp = mbHeader . getCreatedDate ( ) ; } Object [ ] params = null ; Double estQuantity = null ; params = new Object [ ] { workOrder , woActivityId , activityId } ; estQuantity = ( Double ) genericService . findByNamedQuery ( "totalEstimatedQuantity" , params ) ; Double estQuantityRE = null ; if ( workOrder . getParent ( ) != null ) params = new Object [ ] { currentTimestamp , workOrder . getParent ( ) , workOrder . getParent ( ) , activityId } ; else params = new Object [ ] { currentTimestamp , workOrder , workOrder , activityId } ; estQuantityRE = ( Double ) genericService . findByNamedQuery ( "totalEstimatedQuantityForRE" , 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 ( ) ; }
target:  This is used by MB screens. This returns the estimated quantity for an work order activity This returns original activity quantity + all change quantities of the activity for all associated REs Work order activities of only approved REs are considered