Related to Issue 25644: Cannot create a work effort from a work requirement if operation time / quantity returns a repeating decimal value
authorPandeeswari Ramakrishnan <pandeeswari.ramakrishnan@openbravo.com>
Thu, 13 Feb 2014 21:00:30 +0530
changeset 22012 e510966c00fd
parent 22011 e2e4ee246202
child 22014 8626778d85f2
Related to Issue 25644: Cannot create a work effort from a work requirement if operation time / quantity returns a repeating decimal value
src/org/openbravo/erpCommon/ad_actionButton/CreateWorkEffort.java
--- a/src/org/openbravo/erpCommon/ad_actionButton/CreateWorkEffort.java	Thu Feb 13 20:19:32 2014 +0530
+++ b/src/org/openbravo/erpCommon/ad_actionButton/CreateWorkEffort.java	Thu Feb 13 21:00:30 2014 +0530
@@ -140,8 +140,8 @@
             BigDecimal estimatedTime = BigDecimal.ZERO;
             if (wrOp.getEstimatedTime() != null && wrOp.getQuantity() != null
                 && wrOp.getQuantity().compareTo(BigDecimal.ZERO) != 0) {
-              estimatedTime = wrOp.getEstimatedTime()
-                  .divide(wrOp.getQuantity(), BigDecimal.ROUND_HALF_UP).multiply(requeriedQty);
+              estimatedTime = wrOp.getEstimatedTime().multiply(requeriedQty)
+                  .divide(wrOp.getQuantity(), BigDecimal.ROUND_HALF_UP);
             }
             productionPlan.setEstimatedTime(new BigDecimal(estimatedTime.longValue()));
           } else {