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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

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

hansbak-2
Author: hansbak
Date: Mon Dec 29 06:44:26 2008
New Revision: 729904

URL: http://svn.apache.org/viewvc?rev=729904&view=rev
Log:
check for null to avoid NPE

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=729904&r1=729903&r2=729904&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 Mon Dec 29 06:44:26 2008
@@ -75,11 +75,11 @@
                     taskInfo.resource = taskInfo.actualHours + " Hrs";
                 }
                 double duration = resultTaskInfo.plannedHours;
-                if (taskInfo.currentStatusId == "PTS_COMPLETED") {
+                if (taskInfo.currentStatusId.equals("PTS_COMPLETED")) {
                     taskInfo.completion = 100;
                 } else {
-                 if (taskInfo.actualHours) {
-                 taskInfo.completion = new BigDecimal(taskInfo.actualHours*100/taskInfo.plannedHours).setScale(0, BigDecimal.ROUND_UP);
+                 if (taskInfo.actualHours && taskInfo.plannedHours) {
+                 taskInfo.completion = new BigDecimal(taskInfo.actualHours * 100 / taskInfo.plannedHours).setScale(0, BigDecimal.ROUND_UP);
                  } else {
                  taskInfo.completion = 0;
                  }