Author: jacopoc Date: Mon Sep 25 04:06:31 2006 New Revision: 449648 URL: http://svn.apache.org/viewvc?view=rev&rev=449648 Log: Applied patch from Scott Gray (plus some other misc cleanups) to fix a buggy way of calculating production run qty (when updated). OFBIZ-325
Modified: incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMNode.java incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRun.java incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java Modified: incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMNode.java URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMNode.java?view=diff&rev=449648&r1=449647&r2=449648 ============================================================================== --- incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMNode.java (original) +++ incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/bom/BOMNode.java Mon Sep 25 04:06:31 2006 @@ -398,7 +398,6 @@ // Now we set the depth and quantity of the current node // in this breakdown. this.depth = depth; - //this.quantity = Math.floor(quantity * quantityMultiplier / scrapFactor + 0.5); String serviceName = null; if (this.productAssoc != null && this.productAssoc.getString("estimateCalcMethod") != null) { try { @@ -455,7 +454,6 @@ // Now we set the depth and quantity of the current node // in this breakdown. this.depth = depth; - //this.quantity = Math.floor(quantity * quantityMultiplier / scrapFactor + 0.5); this.quantity = quantity * quantityMultiplier * scrapFactor; // First of all we visit the current node. if (this.getProduct().getString("shipmentBoxTypeId") != null) { Modified: incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRun.java URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRun.java?view=diff&rev=449648&r1=449647&r2=449648 ============================================================================== --- incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRun.java (original) +++ incubator/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRun.java Mon Sep 25 04:06:31 2006 @@ -201,7 +201,7 @@ for (Iterator iter = productionRunComponents.iterator(); iter.hasNext();){ GenericValue component = (GenericValue) iter.next(); componentQuantity = component.getDouble("estimatedQuantity").doubleValue(); - component.set("estimatedQuantity", new Double(Math.floor((componentQuantity / previousQuantity * newQuantity.doubleValue() ) + 0.5))); + component.set("estimatedQuantity", new Double(componentQuantity / previousQuantity * newQuantity.doubleValue())); } return; } 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=449648&r1=449647&r2=449648 ============================================================================== --- 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 Mon Sep 25 04:06:31 2006 @@ -381,8 +381,6 @@ serviceContext.put("fromDate", productBom.get("fromDate")); // Here we use the getQuantity method to get the quantity already // computed by the getManufacturingComponents service - //double scrapFactor = (productBom.get("scrapFactor") != null)? productBom.getDouble("scrapFactor").doubleValue() : 0; - //serviceContext.put("estimatedQuantity", new Double(Math.floor((productBom.getDouble("quantity").doubleValue() * pRQuantity.doubleValue() / (1-(scrapFactor / 100))) + 0.5))); serviceContext.put("estimatedQuantity", new Double(node.getQuantity())); serviceContext.put("userLogin", userLogin); resultService = null;