Author: ashish
Date: Sat Aug 27 11:27:47 2016
New Revision: 1757991

URL: http://svn.apache.org/viewvc?rev=1757991&view=rev
Log:
Applied patch from jira issue - OFBIZ-7848 - Clean up commented out code in 
Java source for Manufacturing.
Thanks Harsh for the contribution. 

Modified:
    
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/bom/BOMNode.java
    
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRun.java
    
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
    
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/mrp/MrpServices.java
    
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/mrp/ProposedOrder.java
    
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/techdata/TechDataServices.java

Modified: 
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/bom/BOMNode.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/bom/BOMNode.java?rev=1757991&r1=1757990&r2=1757991&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/bom/BOMNode.java
 (original)
+++ 
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/bom/BOMNode.java
 Sat Aug 27 11:27:47 2016
@@ -95,7 +95,6 @@ public class BOMNode {
         // If the date is null, set it to today.
         if (inDate == null) inDate = new Date();
         bomTypeId = partBomTypeId;
-//        Delegator delegator = product.getDelegator();
         List<GenericValue> rows = 
EntityQuery.use(delegator).from("ProductAssoc")
                 .where("productId", product.get("productId"),
                         "productAssocTypeId", partBomTypeId)
@@ -322,7 +321,6 @@ public class BOMNode {
         if (inDate == null) inDate = new Date();
 
         bomTypeId = partBomTypeId;
-//        Delegator delegator = product.getDelegator();
         List<GenericValue> rows = 
EntityQuery.use(delegator).from("ProductAssoc")
                 .where("productIdTo", product.get("productId"),
                         "productAssocTypeId", partBomTypeId)
@@ -345,7 +343,6 @@ public class BOMNode {
         for (GenericValue oneChild : children) {
             oneChildNode = new BOMNode(oneChild.getString("productId"), 
delegator, dispatcher, userLogin);
             // Configurator
-            //oneChildNode = configurator(oneChild, productFeatures, 
getRootNode().getProductForRules(), delegator);
             // If the node is null this means that the node has been discarded 
by the rules.
             if (oneChildNode != null) {
                 oneChildNode.setParentNode(this);
@@ -436,7 +433,7 @@ public class BOMNode {
                     this.quantity = calcQuantity;
                 }
             } catch (GenericServiceException e) {
-                //Debug.logError(e, "Problem calling the 
getManufacturingComponents service", module);
+                
             }
         } else {
             this.quantity = 
quantity.multiply(quantityMultiplier).multiply(scrapFactor);
@@ -576,7 +573,7 @@ public class BOMNode {
                     }
                 }
             } catch (GenericEntityException e) {
-                //Debug.logError(e, "Problem calling the 
getManufacturingComponents service", module);
+                
             }
         }
         return UtilMisc.toMap("productionRunId", productionRunId, "endDate", 
endDate);

Modified: 
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRun.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRun.java?rev=1757991&r1=1757990&r2=1757991&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRun.java
 (original)
+++ 
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRun.java
 Sat Aug 27 11:27:47 2016
@@ -421,7 +421,6 @@ public class ProductionRun {
                     // and put the value in totalTaskTime
                     Map<String, Object> estimateCalcServiceMap = 
UtilMisc.<String, Object>toMap("workEffort", task, "quantity", quantity, 
"productId", productId, "routingId", routingId);
                     Map<String, Object> serviceContext = UtilMisc.<String, 
Object>toMap("arguments", estimateCalcServiceMap);
-                    // serviceContext.put("userLogin", userLogin);
                     Map<String, Object> resultService = 
dispatcher.runSync(serviceName, serviceContext);
                     totalTaskTime = 
((BigDecimal)resultService.get("totalTime")).doubleValue();
                 }

Modified: 
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java?rev=1757991&r1=1757990&r2=1757991&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
 (original)
+++ 
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
 Sat Aug 27 11:27:47 2016
@@ -186,12 +186,7 @@ public class ProductionRunServices {
         LocalDispatcher dispatcher = ctx.getDispatcher();
         Locale locale = (Locale) context.get("locale");
         GenericValue userLogin = (GenericValue) context.get("userLogin");
-        /* TODO: security management  and finishing cleaning (ex copy from 
PartyServices.java)
-        if (!security.hasEntityPermission(secEntity, secOperation, userLogin)) 
{
-            result.put(ModelService.RESPONSE_MESSAGE, 
ModelService.RESPOND_ERROR);
-            result.put(ModelService.ERROR_MESSAGE, "You do not have permission 
to perform this operation for this party");
-            return partyId;
-        }
+        /* TODO: security management  and finishing cleaning (ex copy from 
PartyServices.java)        
          */
         // Mandatory input fields
         String productId = (String) context.get("productId");
@@ -1687,7 +1682,6 @@ public class ProductionRunServices {
                     if (unitCost.compareTo(ZERO) != 0) {
                         serviceContext.put("unitCost", unitCost);
                     }
-                    //serviceContext.put("serialNumber", productionRunId);
                     serviceContext.put("lotId", lotId);
                     serviceContext.put("locationSeqId", locationSeqId);
                     serviceContext.put("uomId",uomId);
@@ -2163,22 +2157,6 @@ public class ProductionRunServices {
 
         // Create a new TimeEntry
         try {
-            /*
-            String timeEntryId = delegator.getNextSeqId("TimeEntry");
-            Map timeEntryFields = UtilMisc.toMap("timeEntryId", timeEntryId,
-                                                 "workEffortId", workEffortId);
-            Double totalTime = Double.valueOf(addSetupTime.doubleValue() + 
addTaskTime.doubleValue());
-            timeEntryFields.put("partyId", partyId);
-            timeEntryFields.put("fromDate", fromDate);
-            timeEntryFields.put("thruDate", toDate);
-            timeEntryFields.put("hours", totalTime); // FIXME
-            //timeEntryFields.put("setupTime", addSetupTime); // FIXME
-            //timeEntryFields.put("quantityProduced", addQuantityProduced); // 
FIXME
-            //timeEntryFields.put("quantityRejected", addQuantityRejected); // 
FIXME
-            timeEntryFields.put("comments", comments);
-            GenericValue timeEntry = delegator.makeValue("TimeEntry", 
timeEntryFields);
-            timeEntry.create();
-            */
             Map<String, Object> serviceContext = new HashMap<String, Object>();
             serviceContext.clear();
             serviceContext.put("workEffortId", workEffortId);
@@ -2335,7 +2313,6 @@ public class ProductionRunServices {
         serviceContext.put("pRQuantity", quantity);
         serviceContext.put("startDate", UtilDateTime.nowTimestamp());
         serviceContext.put("facilityId", facilityId);
-        //serviceContext.put("workEffortName", "");
         serviceContext.put("userLogin", userLogin);
         Map<String, Object> resultService = null;
         try {
@@ -2348,7 +2325,6 @@ public class ProductionRunServices {
 
         Map<String, BigDecimal> components = new HashMap<String, BigDecimal>();
         for (ConfigOption co : config.getSelectedOptions()) {
-            //components.addAll(co.getComponents());
             for (GenericValue selComponent : co.getComponents()) {
                 BigDecimal componentQuantity = null;
                 if (selComponent.get("quantity") != null) {
@@ -2526,8 +2502,6 @@ public class ProductionRunServices {
 
                     serviceContext.put("pRQuantity", qtyToProduce);
                     serviceContext.put("startDate", 
UtilDateTime.nowTimestamp());
-                    //serviceContext.put("workEffortName", "");
-
                     resultService = dispatcher.runSync("createProductionRun", 
serviceContext);
 
                     String productionRunId = 
(String)resultService.get("productionRunId");
@@ -2977,12 +2951,6 @@ public class ProductionRunServices {
         GenericValue userLogin = (GenericValue) context.get("userLogin");
         String inventoryItemId = (String)context.get("inventoryItemId");
         Locale locale = (Locale) context.get("locale");
-        /*
-        BigDecimal quantity = (BigDecimal)context.get("quantityAccepted");
-        if (quantity != null && quantity.BigDecimalValue() == 0) {
-            return ServiceUtil.returnSuccess();
-        }
-         */
         try {
             GenericValue inventoryItem = 
EntityQuery.use(delegator).from("InventoryItem").where("inventoryItemId", 
inventoryItemId).queryOne();
             if (inventoryItem == null) {
@@ -2998,11 +2966,6 @@ public class ProductionRunServices {
             if (EntityTypeUtil.hasParentType(delegator, "ProductType", 
"productTypeId", product.getString("productTypeId"), "parentTypeId", 
"MARKETING_PKG_AUTO")) {
                 Map<String, Object> serviceContext = 
UtilMisc.toMap("inventoryItemId", inventoryItemId,
                                                     "userLogin", userLogin);
-                /*
-                if (quantity != null) {
-                    serviceContext.put("quantity", quantity);
-                }
-                 */
                 dispatcher.runSync("decomposeInventoryItem", serviceContext);
             }
         } catch (Exception e) {
@@ -3162,7 +3125,6 @@ public class ProductionRunServices {
                 }
                 Map<String, Object> dateMap = 
UtilGenerics.checkMap(productMap.get(estimatedShipDate));
                 BigDecimal remainingQty = 
(BigDecimal)dateMap.get("remainingQty");
-                //List reservations = (List)dateMap.get("reservations");
                 remainingQty = remainingQty.add(qtyDiff);
                 dateMap.put("remainingQty", remainingQty);
             }
@@ -3211,7 +3173,6 @@ public class ProductionRunServices {
                 }
                 Map<String, Object> dateMap = 
UtilGenerics.checkMap(productMap.get(estimatedShipDate));
                 BigDecimal remainingQty = 
(BigDecimal)dateMap.get("remainingQty");
-                //List reservations = (List)dateMap.get("reservations");
                 remainingQty = remainingQty.add(orderQuantity);
                 dateMap.put("remainingQty", remainingQty);
             }
@@ -3220,7 +3181,6 @@ public class ProductionRunServices {
             List<EntityCondition> backordersCondList = new 
LinkedList<EntityCondition>();
             
backordersCondList.add(EntityCondition.makeCondition("quantityNotAvailable", 
EntityOperator.NOT_EQUAL, null));
             
backordersCondList.add(EntityCondition.makeCondition("quantityNotAvailable", 
EntityOperator.GREATER_THAN, BigDecimal.ZERO));
-            
//backordersCondList.add(EntityCondition.makeCondition(EntityCondition.makeCondition("statusId",
 EntityOperator.EQUALS, "ITEM_CREATED"), EntityOperator.OR, 
EntityCondition.makeCondition("statusId", EntityOperator.LESS_THAN, 
"ITEM_APPROVED")));
 
             List<GenericValue> backorders = 
EntityQuery.use(delegator).from("OrderItemAndShipGrpInvResAndItem")
                     
.where(EntityCondition.makeCondition("quantityNotAvailable", 
EntityOperator.NOT_EQUAL, null),
@@ -3248,7 +3208,6 @@ public class ProductionRunServices {
                 // iterate and 'reserve'
                 for (Timestamp currentDate : subsetMap.keySet()) {
                     Map<String, Object> currentDateMap = 
UtilGenerics.checkMap(subsetMap.get(currentDate));
-                    //List reservations = 
(List)currentDateMap.get("reservations");
                     BigDecimal remainingQty = 
(BigDecimal)currentDateMap.get("remainingQty");
                     if (remainingQty.compareTo(ZERO) == 0) {
                         continue;

Modified: 
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/mrp/MrpServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/mrp/MrpServices.java?rev=1757991&r1=1757990&r2=1757991&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/mrp/MrpServices.java
 (original)
+++ 
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/mrp/MrpServices.java
 Sat Aug 27 11:27:47 2016
@@ -75,7 +75,6 @@ public class MrpServices {
         List<GenericValue> listResult = null;
         try {
             listResult = 
EntityQuery.use(delegator).from("MrpEvent").queryList();
-            //int numOfRecordsRemoved = 
delegator.removeByCondition("MrpEvent", null);
         } catch (GenericEntityException e) {
             Debug.logError(e,"Error : findList(\"MrpEvent\", null, null, null, 
null, false)", module);
             return ServiceUtil.returnError(UtilProperties.getMessage(resource, 
"ManufacturingMrpEventFindError", locale));
@@ -104,7 +103,6 @@ public class MrpServices {
             try {
                 for (GenericValue tmpRequirement : listResult) {
                     
listResultRoles.addAll(tmpRequirement.getRelated("RequirementRole", null, null, 
false));
-                    //int numOfRecordsRemoved = 
delegator.removeRelated("RequirementRole", tmpRequirement);
                 }
                 delegator.removeAll(listResultRoles);
                 delegator.removeAll(listResult);
@@ -567,7 +565,6 @@ public class MrpServices {
                 Timestamp eventDate = (routingTask == null || 
!routingTaskStartDate.containsKey(routingTask)) ? startDate : (Timestamp) 
routingTaskStartDate.get(routingTask);
                 // if the components is valid at the event Date create the Mrp 
requirement in the M entity
                 if (EntityUtil.isValueActive(productComponent, eventDate)) {
-                    //Map parameters = UtilMisc.toMap("productId", 
productComponent.getString("productIdTo"));
                     Map<String, Object> parameters = UtilMisc.<String, 
Object>toMap("productId", node.getProduct().getString("productId"));
                     parameters.put("mrpId", mrpId);
                     parameters.put("eventDate", eventDate);

Modified: 
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/mrp/ProposedOrder.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/mrp/ProposedOrder.java?rev=1757991&r1=1757990&r2=1757991&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/mrp/ProposedOrder.java
 (original)
+++ 
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/mrp/ProposedOrder.java
 Sat Aug 27 11:27:47 2016
@@ -168,17 +168,6 @@ public class ProposedOrder {
                         // record the routingTask with the startDate associated
                         
result.put(routingTask.getString("workEffortId"),startDate);
                         endDate = startDate;
-                        /*
-                         * This is a work in progress
-                        GenericValue routingTask = null;
-                        try {
-                            Map timeInMap = UtilMisc.toMap("taskId", 
routingTaskAssoc.getString("workEffortIdTo"), "quantity", 
Double.valueOf(quantity), "userLogin", userLogin);
-                            Map timeOutMap = 
dispatcher.runSync("getEstimatedTaskTime", timeInMap);
-                            routingTask = 
(GenericValue)timeOutMap.get("routing");
-                        } catch (GenericServiceException gse) {
-                            Debug.logError(gse.getMessage(),  module);
-                        }
-                        */
                     }
                 }
             } else {
@@ -211,11 +200,6 @@ public class ProposedOrder {
         if (quantity.compareTo(reorderQuantity) < 0) {
             quantity = reorderQuantity;
         }
-        /*
-        if (quantity < minimumStock) {
-            quantity = minimumStock;
-        }
-         */
     }
 
     /**

Modified: 
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/techdata/TechDataServices.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/techdata/TechDataServices.java?rev=1757991&r1=1757990&r2=1757991&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/techdata/TechDataServices.java
 (original)
+++ 
ofbiz/trunk/applications/manufacturing/src/main/java/org/apache/ofbiz/manufacturing/techdata/TechDataServices.java
 Sat Aug 27 11:27:47 2016
@@ -255,7 +255,6 @@ public class TechDataServices {
                 moveDay +=1;
                 dayStart = (dayStart==7) ? 1 : dayStart +1;
             }
-            //                Debug.logInfo("capacity loop: " + capacity+ " 
moveDay=" +moveDay, module);
         }
         result.put("capacity",capacity);
         result.put("startTime",startTime);


Reply via email to