svn commit: r451720 - in /incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing: jobshopmgt/ProductionRunServices.java techdata/TechDataServices.java

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

svn commit: r451720 - in /incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing: jobshopmgt/ProductionRunServices.java techdata/TechDataServices.java

jacopoc
Author: jacopoc
Date: Sat Sep 30 23:16:23 2006
New Revision: 451720

URL: http://svn.apache.org/viewvc?view=rev&rev=451720
Log:
Removed unnecessary method to check a routing task from/thru date validity: the generic method in the EntityUtil class is now used in place of this.

Modified:
    incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
    incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/techdata/TechDataServices.java

Modified: incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java?view=diff&rev=451720&r1=451719&r2=451720
==============================================================================
--- incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java (original)
+++ incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java Sat Sep 30 23:16:23 2006
@@ -284,7 +284,8 @@
         boolean first = true;
         while (rt.hasNext()) {
             GenericValue routingTaskAssoc = (GenericValue) rt.next();
-            if (TechDataServices.routingTaskAssocIsValid(routingTaskAssoc, startDate)) {
+            
+            if (EntityUtil.isValueActive(routingTaskAssoc, startDate)) {
                 GenericValue routingTask = null;
                 try {
                     routingTask = routingTaskAssoc.getRelatedOne("ToWorkEffort");

Modified: incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/techdata/TechDataServices.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/techdata/TechDataServices.java?view=diff&rev=451720&r1=451719&r2=451720
==============================================================================
--- incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/techdata/TechDataServices.java (original)
+++ incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/techdata/TechDataServices.java Sat Sep 30 23:16:23 2006
@@ -148,48 +148,7 @@
         result.put("sequenceNumNotOk", sequenceNumNotOk);
         return result;
     }
-    /**
-     * Used to check if the routingtaskAssoc is valid for the testDate
-     *
-     * @param routingTaskAssoc     the routingTaskAssoc to test
-     * @param testDate                       a date
-     * @return true                               if the routingTAskAssoc is valid
-     */
-    public static boolean routingTaskAssocIsValid(GenericValue routingTaskAssoc, Timestamp  testDate) {
-        if (routingTaskAssoc.getTimestamp("fromDate") != null)
-            if (routingTaskAssoc.getTimestamp("thruDate") != null)
-                if (testDate.after(routingTaskAssoc.getTimestamp("fromDate")) && testDate.before(routingTaskAssoc.getTimestamp("thruDate"))) return true;
-                else return false;
-            else
-                if (testDate.after(routingTaskAssoc.getTimestamp("fromDate"))) return true;
-                else return false;
-        else
-            if (routingTaskAssoc.getTimestamp("thruDate") != null)
-                if (testDate.before(routingTaskAssoc.getTimestamp("thruDate"))) return true;
-                else return false;
-            else return true;
-    }
-    /**
-     * Used to check if the productBom is valid for the testDate, currently only tested on date but in futur, maybe there will be the option {valid until stock=0>}
-     *
-     * @param productBom    the productBom to test
-     * @param testDate          a date
-     * @return true if the productBom is valid
-     */
-    public static boolean productBomIsValid(GenericValue productBom,  Timestamp  testDate) {
-        if (productBom.getTimestamp("fromDate") != null)
-            if (productBom.getTimestamp("thruDate") != null)
-                if (testDate.after(productBom.getTimestamp("fromDate")) && testDate.before(productBom.getTimestamp("thruDate"))) return true;
-                else return false;
-            else
-                if (testDate.after(productBom.getTimestamp("fromDate"))) return true;
-                else return false;
-        else
-            if (productBom.getTimestamp("thruDate") != null)
-                if (testDate.before(productBom.getTimestamp("thruDate"))) return true;
-                else return false;
-            else return true;
-    }
+
     /**
      * Used to get the techDataCalendar for a routingTask, if there is a entity exception
      * or routingTask associated with no MachineGroup the DEFAULT TechDataCalendar is return.