svn commit: r786932 - /ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r786932 - /ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java

hansbak-2
Author: hansbak
Date: Sun Jun 21 00:26:05 2009
New Revision: 786932

URL: http://svn.apache.org/viewvc?rev=786932&view=rev
Log:
corrected an error in the workeffort date selection I introduced earlier

Modified:
    ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java

Modified: ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java?rev=786932&r1=786931&r2=786932&view=diff
==============================================================================
--- ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java (original)
+++ ofbiz/trunk/applications/workeffort/src/org/ofbiz/workeffort/workeffort/WorkEffortServices.java Sun Jun 21 00:26:05 2009
@@ -50,7 +50,6 @@
 import org.ofbiz.entity.condition.EntityJoinOperator;
 import org.ofbiz.entity.condition.EntityOperator;
 import org.ofbiz.entity.model.ModelEntity;
-import org.ofbiz.entity.model.ModelField;
 import org.ofbiz.entity.util.EntityUtil;
 import org.ofbiz.security.Security;
 import org.ofbiz.service.DispatchContext;
@@ -484,42 +483,38 @@
         if (entityExprList == null) {
             entityExprList = getDefaultWorkEffortExprList(partyIdsToUse, facilityId, fixedAssetId, workEffortTypeId);
         }
-        
-        // check the start dates
-        entityExprList.add(
-         EntityCondition.makeCondition(UtilMisc.<EntityCondition>toList(
-         EntityCondition.makeCondition(UtilMisc.<EntityCondition>toList(
-         EntityCondition.makeCondition("actualStartDate", EntityOperator.EQUALS, null),
-         EntityCondition.makeCondition("estimatedStartDate", EntityOperator.NOT_EQUAL, null),
-         EntityCondition.makeCondition("estimatedStartDate", EntityOperator.LESS_THAN_EQUAL_TO, startStamp)
-         ), EntityJoinOperator.AND),
-         EntityCondition.makeCondition(UtilMisc.<EntityCondition>toList(
-         EntityCondition.makeCondition("actualStartDate", EntityOperator.NOT_EQUAL, null),
-         EntityCondition.makeCondition("actualStartDate", EntityOperator.LESS_THAN_EQUAL_TO, startStamp)
-         ), EntityJoinOperator.AND)
- ), EntityJoinOperator.OR));
         
-        // check the end dates
         entityExprList.add(
          EntityCondition.makeCondition(UtilMisc.<EntityCondition>toList(
+         // the taskstart should be less than the periodend and the taskEnd should be larger than the period start
          EntityCondition.makeCondition(UtilMisc.<EntityCondition>toList(
-         EntityCondition.makeCondition("actualCompletionDate", EntityOperator.EQUALS, null),
-         EntityCondition.makeCondition("estimatedCompletionDate", EntityOperator.NOT_EQUAL, null),
-         EntityCondition.makeCondition("estimatedCompletionDate", EntityOperator.LESS_THAN_EQUAL_TO, endStamp)
-         ), EntityJoinOperator.AND),
+         EntityCondition.makeCondition(UtilMisc.<EntityCondition>toList(
+         EntityCondition.makeCondition("actualStartDate", EntityOperator.EQUALS, null),
+         EntityCondition.makeCondition("estimatedStartDate", EntityOperator.NOT_EQUAL, null),
+         EntityCondition.makeCondition("estimatedStartDate", EntityOperator.LESS_THAN_EQUAL_TO, endStamp)
+         ), EntityJoinOperator.AND),
+         EntityCondition.makeCondition(UtilMisc.<EntityCondition>toList(
+         EntityCondition.makeCondition("actualStartDate", EntityOperator.NOT_EQUAL, null),
+         EntityCondition.makeCondition("actualStartDate", EntityOperator.LESS_THAN_EQUAL_TO, endStamp)
+         ), EntityJoinOperator.AND)
+         ), EntityJoinOperator.OR),
          EntityCondition.makeCondition(UtilMisc.<EntityCondition>toList(
-         EntityCondition.makeCondition("actualCompletionDate", EntityOperator.NOT_EQUAL, null),
-         EntityCondition.makeCondition("actualCompletionDate", EntityOperator.LESS_THAN_EQUAL_TO, endStamp)
-         ), EntityJoinOperator.AND),
- EntityCondition.makeCondition("tempExprId", EntityOperator.NOT_EQUAL, null),
- EntityCondition.makeCondition("estimatedMilliSeconds", EntityOperator.NOT_EQUAL, null),
- EntityCondition.makeCondition("actualMilliSeconds", EntityOperator.NOT_EQUAL, null)
- ), EntityJoinOperator.OR));
+         EntityCondition.makeCondition(UtilMisc.<EntityCondition>toList(
+         EntityCondition.makeCondition("actualCompletionDate", EntityOperator.EQUALS, null),
+         EntityCondition.makeCondition("estimatedCompletionDate", EntityOperator.NOT_EQUAL, null),
+         EntityCondition.makeCondition("estimatedCompletionDate", EntityOperator.GREATER_THAN_EQUAL_TO, startStamp)
+         ), EntityJoinOperator.AND),
+         EntityCondition.makeCondition(UtilMisc.<EntityCondition>toList(
+         EntityCondition.makeCondition("actualCompletionDate", EntityOperator.NOT_EQUAL, null),
+         EntityCondition.makeCondition("actualCompletionDate", EntityOperator.GREATER_THAN_EQUAL_TO, startStamp)
+         ), EntityJoinOperator.AND)
+         ), EntityJoinOperator.OR)
+         ), EntityJoinOperator.AND));
         
         if (filterOutCanceledEvents.booleanValue()) {
             entityExprList.add(EntityCondition.makeCondition("currentStatusId", EntityOperator.NOT_EQUAL, "EVENT_CANCELLED"));
         }
-        EntityConditionList<EntityCondition> ecl = EntityCondition.makeCondition(entityExprList);
+        EntityConditionList<EntityCondition> ecl = EntityCondition.makeCondition(entityExprList, EntityJoinOperator.AND);
         List<String> orderByList = UtilMisc.toList("estimatedStartDate");
         if (partyIdsToUse.size() > 0 || UtilValidate.isNotEmpty(facilityId) || UtilValidate.isNotEmpty(fixedAssetId)) {
             try {