List<GenericValue> tempWorkEfforts = null;
if (UtilValidate.isNotEmpty(partyIdsToUse)) {
tempWorkEfforts = EntityUtil.filterByDate(delegator.findList("WorkEffortAndPartyAssign", ecl, null, orderByList, null, false));
} else if (UtilValidate.isNotEmpty(fixedAssetId)) {
// Get "old style" work efforts and "new style" work efforts
tempWorkEfforts = delegator.findList("WorkEffort", ecl, null, orderByList, null, false);
tempWorkEfforts.addAll(EntityUtil.filterByDate(delegator.findList("WorkEffortAndFixedAssetAssign", ecl, null, orderByList, null, false)));
} else {
tempWorkEfforts = delegator.findList("WorkEffort", ecl, null, UtilMisc.toList("estimatedStartDate"), null, false);
}
validWorkEfforts = WorkEffortWorker.removeDuplicateWorkEfforts(tempWorkEfforts);