Author: jacopoc
Date: Thu Mar 29 06:45:16 2007
New Revision: 523710

URL: http://svn.apache.org/viewvc?view=rev&rev=523710
Log:
Misc improvements for the production runs in the scheduled status.

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

Modified: 
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java?view=diff&rev=523710&r1=523709&r2=523710
==============================================================================
--- 
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
 (original)
+++ 
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
 Thu Mar 29 06:45:16 2007
@@ -459,7 +459,8 @@
             ProductionRun productionRun = new ProductionRun(productionRunId, 
delegator, dispatcher);
             if (productionRun.exist()){
                 
-                if 
(!productionRun.getGenericValue().getString("currentStatusId").equals("PRUN_CREATED"))
 {
+                if 
(!"PRUN_CREATED".equals(productionRun.getGenericValue().getString("currentStatusId"))
 &&
+                      
!"PRUN_SCHEDULED".equals(productionRun.getGenericValue().getString("currentStatusId")))
 {
                     return 
ServiceUtil.returnError(UtilProperties.getMessage(resource, 
"ManufacturingProductionRunPrinted", locale));
                 }
 
@@ -930,7 +931,8 @@
             ProductionRun productionRun = new ProductionRun(productionRunId, 
delegator, dispatcher);
             if (productionRun.exist()){
                 
-                if 
(!productionRun.getGenericValue().getString("currentStatusId").equals("PRUN_CREATED"))
 {
+                if 
(!"PRUN_CREATED".equals(productionRun.getGenericValue().getString("currentStatusId"))
 &&
+                      
!"PRUN_SCHEDULED".equals(productionRun.getGenericValue().getString("currentStatusId")))
 {
                     return 
ServiceUtil.returnError(UtilProperties.getMessage(resource, 
"ManufacturingProductionRunPrinted", locale));
                 }
 
@@ -1004,7 +1006,8 @@
             return ServiceUtil.returnError(UtilProperties.getMessage(resource, 
"ManufacturingProductionRunTaskNotExists", locale));
         }
         
-        if 
(!productionRun.getGenericValue().getString("currentStatusId").equals("PRUN_CREATED"))
 {
+        if 
(!"PRUN_CREATED".equals(productionRun.getGenericValue().getString("currentStatusId"))
 &&
+              
!"PRUN_SCHEDULED".equals(productionRun.getGenericValue().getString("currentStatusId")))
 {
             return ServiceUtil.returnError(UtilProperties.getMessage(resource, 
"ManufacturingProductionRunPrinted", locale));
         }
 
@@ -1073,7 +1076,8 @@
             return ServiceUtil.returnError(UtilProperties.getMessage(resource, 
"ManufacturingProductionRunComponentNotExists", locale));
         }
         
-        if 
(!productionRun.getGenericValue().getString("currentStatusId").equals("PRUN_CREATED"))
 {
+        if 
(!"PRUN_CREATED".equals(productionRun.getGenericValue().getString("currentStatusId"))
 &&
+              
!"PRUN_SCHEDULED".equals(productionRun.getGenericValue().getString("currentStatusId")))
 {
             return ServiceUtil.returnError(UtilProperties.getMessage(resource, 
"ManufacturingProductionRunPrinted", locale));
         }
 
@@ -1154,7 +1158,8 @@
             return ServiceUtil.returnError(UtilProperties.getMessage(resource, 
"ManufacturingProductionRunTaskNotExists", locale));
         }
         
-        if 
(!productionRun.getGenericValue().getString("currentStatusId").equals("PRUN_CREATED"))
 {
+        if 
(!"PRUN_CREATED".equals(productionRun.getGenericValue().getString("currentStatusId"))
 &&
+              
!"PRUN_SCHEDULED".equals(productionRun.getGenericValue().getString("currentStatusId")))
 {
             return ServiceUtil.returnError(UtilProperties.getMessage(resource, 
"ManufacturingProductionRunPrinted", locale));
         }
 
@@ -2318,6 +2323,7 @@
 
             List findOutgoingProductionRunsStatusConds = new LinkedList();
             findOutgoingProductionRunsStatusConds.add(new 
EntityExpr("currentStatusId", EntityOperator.EQUALS, "PRUN_CREATED"));
+            findOutgoingProductionRunsStatusConds.add(new 
EntityExpr("currentStatusId", EntityOperator.EQUALS, "PRUN_SCHEDULED"));
             findOutgoingProductionRunsStatusConds.add(new 
EntityExpr("currentStatusId", EntityOperator.EQUALS, "PRUN_DOC_PRINTED"));
             findOutgoingProductionRunsStatusConds.add(new 
EntityExpr("currentStatusId", EntityOperator.EQUALS, "PRUN_RUNNING"));
             findOutgoingProductionRunsConds.add(new 
EntityConditionList(findOutgoingProductionRunsStatusConds, EntityOperator.OR));


Reply via email to