From fbb85e937ea694749f6ffa2df0e31f42afe3bee5 Mon Sep 17 00:00:00 2001 From: Adrian Crum Date: Sat, 11 Oct 2008 18:05:58 +0000 Subject: [PATCH] WorkEffortServices.java getWorkEffortEventsByPeriod(...) method fixed to return assigned fixed assets. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@703701 13f79535-47bb-0310-9956-ffa450edef68 --- .../workeffort/entitydef/entitymodel_view.xml | 14 ++++++-------- .../workeffort/workeffort/WorkEffortServices.java | 11 +++++++---- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/applications/workeffort/entitydef/entitymodel_view.xml b/applications/workeffort/entitydef/entitymodel_view.xml index 64f7f82f6c..5417690f15 100644 --- a/applications/workeffort/entitydef/entitymodel_view.xml +++ b/applications/workeffort/entitydef/entitymodel_view.xml @@ -181,16 +181,14 @@ under the License. - - - - - + - - - + + + + + ecl = EntityCondition.makeCondition(entityExprList); - - // Use the View Entity + List orderByList = UtilMisc.toList("estimatedStartDate"); if (partyIdsToUse.size() > 0 || UtilValidate.isNotEmpty(facilityId) || UtilValidate.isNotEmpty(fixedAssetId)) { try { List tempWorkEfforts = null; if (UtilValidate.isNotEmpty(partyIds)) { - tempWorkEfforts = EntityUtil.filterByDate(delegator.findList("WorkEffortAndPartyAssign", ecl, null, UtilMisc.toList("estimatedStartDate"), null, false)); + 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); }