You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ha...@apache.org on 2008/11/01 04:20:55 UTC

svn commit: r709630 - /ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/GanttChart.groovy

Author: hansbak
Date: Fri Oct 31 20:20:55 2008
New Revision: 709630

URL: http://svn.apache.org/viewvc?rev=709630&view=rev
Log:
round completion in ganttcahrt to a whole percentage

Modified:
    ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/GanttChart.groovy

Modified: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/GanttChart.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/GanttChart.groovy?rev=709630&r1=709629&r2=709630&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/GanttChart.groovy (original)
+++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/GanttChart.groovy Fri Oct 31 20:20:55 2008
@@ -22,6 +22,7 @@
 import org.ofbiz.entity.*;
 import org.ofbiz.base.util.*;
 import org.ofbiz.entity.util.*;
+import java.math.*;
 
 projectId = parameters.projectId;
 userLogin = parameters.userLogin;
@@ -78,7 +79,7 @@
                     taskInfo.completion = 100;
                 }else{
                 	if (taskInfo.actualHours) {
-                		taskInfo.completion = taskInfo.actualHours*100/taskInfo.plannedHours;
+                		taskInfo.completion = new BigDecimal(taskInfo.actualHours*100/taskInfo.plannedHours).setScale(0, BigDecimal.ROUND_UP);
                 	} else {
                 		taskInfo.completion = 0;
                 	}