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/12/29 15:44:27 UTC

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

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;
                 	}