Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Release 11.04.01, Trunk
    • Fix Version/s: 14.12.01, 12.04.06, 16.11.01
    • Component/s: scrum
    • Labels:
      None

      Description

      When viewing the sprint overview page errors are shown related to burndown chart and the sprint backlog list

      Regarding the burndown chart:

      The following items have errors:

      Chart (id = 113):
      + A BIRT exception occurred. See next exception for more information.
      Invalid javascript expression: row["sprintDay"] (Element ID:113)

      Regarding the sprint backlog list

      org.ofbiz.widget.screen.ScreenRenderException: Error rendering screen component://common/widget/CommonScreens.xml#GlobalDecorator: java.lang.IllegalArgumentException: Error evaluating BeanShell use-when condition [showPosition1&&"RF_PROD_BACKLOG"=="RF_SCRUM_MEETINGS"] on the field custRequestId of form sprintBacklogListItems: Sourced file: inline evaluation of: ``showPosition1&&"RF_PROD_BACKLOG"=="RF_SCRUM_MEETINGS";'' : illegal use of null value or 'null' literal : at Line: 1 : in file: inline evaluation of: ``showPosition1&&"RF_PROD_BACKLOG"=="RF_SCRUM_MEETINGS";'' : ;
      (Error evaluating BeanShell use-when condition [showPosition1&&"RF_PROD_BACKLOG"=="RF_SCRUM_MEETINGS"] on the field custRequestId of form sprintBacklogListItems: Sourced file: inline evaluation of: ``showPosition1&&"RF_PROD_BACKLOG"=="RF_SCRUM_MEETINGS";'' : illegal use of null value or 'null' literal : at Line: 1 : in file: inline evaluation of: ``showPosition1&&"RF_PROD_BACKLOG"=="RF_SCRUM_MEETINGS";'' : ;
      )

        Issue Links

          Activity

          Hide
          pfm.smits Pierre Smits added a comment -

          The generated burndown.rptdesign shows following error:

          The following items have errors:
          
          ReportDesign (id = 1):
          + There are errors evaluating script "importPackage(Packages.java.math);
          importPackage(Packages.java.text);
          importPackage(Packages.java.sql);
          
          importPackage(Packages.org.ofbiz.base.util);
          importPackage(Packages.org.ofbiz.entity.condition);
          
          module = "Burndown.rptdesign";
          
          sprintId = params["sprintId"].value;
          actualStartDate = params["actualStartDate"].value;
          actualCompletionDate = params["actualCompletionDate"].value;
          dayNumber = params["dayNumber"];
          estimatedHrs = params["estimatedHrs"].value;
          maxHours = params["maxHours"].value;
          currentDay = -1;
          
          userLogin = delegator.findOne("UserLogin",UtilMisc.toMap("userLoginId","admin"), false);
          // caculate average diff hours
          var holidayNumber = BigDecimal.ZERO;
          var notHolidayNumber = BigDecimal.ZERO;
          var countHoliday = 0;
          while (countHoliday < dayNumber) {
              var conditionTimestampFrom = new Timestamp(actualStartDate.getTime() + (countHoliday*1000*60*60*24));
              // get public holiday
              var holidayConds = new LinkedkList();
              holidayConds.add(EntityCondition.makeCondition("workEffortTypeId",EntityOperator.EQUALS, "PUBLIC_HOLIDAY"));
              holidayConds.add(EntityCondition.makeCondition("estimatedStartDate", EntityOperator.EQUALS, conditionTimestampFrom));
              var fieldsToSelect = UtilMisc.toSet("workEffortId","estimatedStartDate");
              var holidayList = delegator.findList("WorkEffort", EntityCondition.makeCondition(holidayConds), fieldsToSelect, null, null, false);
              // check holiday 
              var dayOfWeek = UtilDateTime.getDayOfWeek(conditionTimestampFrom, new java.util.SimpleTimeZone(reportContext.getTimeZone().getRawOffset(), reportContext.getTimeZone().getID()), reportContext.getLocale());
              var day = UtilDateTime.days[dayOfWeek - 2];
              if (!UtilValidate.isNotEmpty(holidayList) && !"Saturday".equals(day) && !"undefined".equals(day) /*Sunday*/) {
                  notHolidayNumber = notHolidayNumber.add(BigDecimal.ONE);
              } else {
                  holidayNumber = holidayNumber.add(BigDecimal.ONE);
              }
              countHoliday ++;
          }
          // get plan hours 
          input =  new HashMap();
          input.put("userLogin",userLogin);
          input.put("sprintId",sprintId);
          result = dispatcher.runSync("getScrumPlanHour", input);
          var phs = result.get("initPlanHours");
          maxHours = phs;
          averageDiffHours = maxHours/notHolidayNumber;":
          ReferenceError: "LinkedkList" is not defined. (/report/method[@name="initialize"]#26)
          
          ReportDesign (id = 1):
          + There are errors evaluating script "// declare global variable
          currentDay = -1;
          dayCount = 0;
          sumPlannedHours = BigDecimal.ZERO;
          sumActualHours = BigDecimal.ZERO;
          
          // calculate main total plan hours
          previousAverageHours = BigDecimal.valueOf(maxHours);
          previousActualHours = BigDecimal.ZERO;
          previousRemainPlannedHours = BigDecimal.valueOf(maxHours);
          remainPlannedHours = BigDecimal.valueOf(maxHours);
          remainActualHours = BigDecimal.ZERO;
          
          averageHours = previousAverageHours;
          
          holidays = new LinkedkList();
          reportContext.getAppContext().put("holidays", holidays);
          ":
          Fail to execute script in function __bm_OPEN(). Source:
          ------
          " + // declare global variable
          currentDay = -1;
          dayCount = 0;
          sumPlannedHours = BigDecimal.ZERO;
          sumActualHours = BigDecimal.ZERO;
          
          // calculate main total plan hours
          previousAverageHours = BigDecimal.valueOf(maxHours);
          previousActualHours = BigDecimal.ZERO;
          previousRemainPlannedHours = BigDecimal.valueOf(maxHours);
          remainPlannedHours = BigDecimal.valueOf(maxHours);
          remainActualHours = BigDecimal.ZERO;
          
          averageHours = previousAverageHours;
          
          holidays = new LinkedkList();
          reportContext.getAppContext().put("holidays", holidays);
           + "
          -----
          A BIRT exception occurred. See next exception for more information.
          ReferenceError: "LinkedkList" is not defined. (/report/data-sets/script-data-set[@id="8"]/method[@name="open"]#16).
          + There are errors evaluating script "if (dayCount >= dayNumber || currentDay >= 0) return false;
          
          var sprintDay = dayCount + 1;
          var actualStartDay = UtilDateTime.getDayStart(new Timestamp(actualStartDate.getTime()), new java.util.SimpleTimeZone(reportContext.getTimeZone().getRawOffset(), reportContext.getTimeZone().getID()), reportContext.getLocale());
          var conditionTimestampFrom = new Timestamp(actualStartDay.getTime() + (dayCount*1000*60*60*24));
          var conditionTimestampTo = new Timestamp(actualStartDay.getTime() + (dayCount*1000*60*60*24) + (1000*60*60*24) - 1);
          
          // check current day
          var nowTimestamp = UtilDateTime.nowTimestamp();
          if (nowTimestamp.getTime() >= conditionTimestampFrom.getTime() && nowTimestamp.getTime() <= conditionTimestampTo.getTime()) {
              reportContext.getAppContext().put("sprintDayLabel", sprintDay + "");
          }
          
          // get public holiday
          var holidayConds = new LinkedkList();
          holidayConds.add(EntityCondition.makeCondition("workEffortTypeId",EntityOperator.EQUALS, "PUBLIC_HOLIDAY"));
          holidayConds.add(EntityCondition.makeCondition("estimatedStartDate", EntityOperator.EQUALS, conditionTimestampFrom));
          var fieldsToSelect = UtilMisc.toSet("workEffortId","estimatedStartDate");
          var holidayList = delegator.findList("WorkEffort", EntityCondition.makeCondition(holidayConds), fieldsToSelect, null, null, false);
          
          // check holiday
          var isHoliday = false;
          var dayOfWeek = UtilDateTime.getDayOfWeek(conditionTimestampFrom, new java.util.SimpleTimeZone(reportContext.getTimeZone().getRawOffset(), reportContext.getTimeZone().getID()), reportContext.getLocale());
          var day = UtilDateTime.days[dayOfWeek - 2];
          if (UtilValidate.isNotEmpty(holidayList) || "Saturday".equals(day) || "undefined".equals(day) /*Sunday*/) {
              isHoliday = true;
          }
          if (isHoliday) {
              holidays.add(sprintDay + "");
              reportContext.getAppContext().put("holidays", holidays);
          }
          input =  new HashMap();
          var plannedHours = BigDecimal.ZERO;
          var actualHours = BigDecimal.ZERO;
          
          // get times from all backlog item's tasks
          var sprint = delegator.findOne("WorkEffort", UtilMisc.toMap("workEffortId", sprintId), false);
          var backlogItems = sprint.getRelated("CustRequestWorkEffort", null, null, false);
          for (i=0; i<backlogItems.size(); i++) {
              // get all task from backlog item
              var backlogItem = backlogItems.get(i);
              var custRequestId = backlogItem.get("custRequestId");
              var conds = new LinkedkList();
              conds.add(EntityCondition.makeCondition("custRequestId", custRequestId));
              conds.add(EntityCondition.makeCondition("workEffortTypeId", EntityOperator.NOT_EQUAL, "SCRUM_SPRINT"));
              var tasks = delegator.findList("CustRequestAndWorkEffort", EntityCondition.makeCondition(conds), null, null, null, false);
              for (j=0; j<tasks.size(); j++) {
                  var task = tasks.get(j);
                  // get plan hours by taskId
                  var workEffortId = task.get("workEffortId");
                  input.put("userLogin",userLogin);
                  input.put("taskId",workEffortId);
                  result = dispatcher.runSync("getScrumPlanHour", input);
                  var phs = result.get("planHours");
                  if (phs != null) {
                      plannedHours = plannedHours.add(BigDecimal.valueOf(phs));
                  } else {
                      var estimatedMilliSeconds = task.get("estimatedMilliSeconds");
                      if (estimatedMilliSeconds != null) {
                          var phs = BigDecimal.valueOf(estimatedMilliSeconds/1000/60/60);
                          plannedHours = plannedHours.add(phs);
                      }
                  }
                  // get all time entries from task
                  var timeEntryConds = new LinkedkList();
                  timeEntryConds.add(EntityCondition.makeCondition("workEffortId", workEffortId));
                  timeEntryConds.add(EntityCondition.makeCondition("fromDate", EntityOperator.GREATER_THAN_EQUAL_TO, conditionTimestampFrom));
                  timeEntryConds.add(EntityCondition.makeCondition("fromDate", EntityOperator.LESS_THAN_EQUAL_TO, conditionTimestampTo));
                  var timeEntries = delegator.findList("TimeEntry", EntityCondition.makeCondition(timeEntryConds), null, null, null, false);
                  if (timeEntries.size() > 0) {
                      // get actual hours from task
                      for (k=0; k<timeEntries.size(); k++) {
                          var timeEntry = timeEntries.get(k);
                          var ahs = timeEntry.get("hours");
                          if (ahs != null) {
                              actualHours = actualHours.add(BigDecimal.valueOf(ahs));
                          }
                      }
                  }
              }
          }
          
          sumPlannedHours = sumPlannedHours.add(plannedHours);
          sumActualHours = sumActualHours.add(actualHours);
          var isPlannedOver = false;
          if (previousRemainPlannedHours.compareTo(plannedHours) < 0) {
              isPlannedOver = true;
          }
          
          var dialyCompleted = BigDecimal.ZERO;
          
          // calculate balance actual hours
          var balanceActualHours = maxHours - sumActualHours;
          
          // calculate remain plan hours
          if (!isHoliday) {
              remainPlannedHours = BigDecimal.valueOf(maxHours).subtract(sumActualHours);
              previousRemainPlannedHours = remainPlannedHours;
              dialyCompleted = actualHours;
          }
          
          // calculate average hours
          if (!isHoliday) {
              averageHours = previousAverageHours.subtract(BigDecimal.valueOf(averageDiffHours));
              previousAverageHours = averageHours;
          } else {
              averageHours = previousAverageHours;
          }
          
          row["sprintDay"] = sprintDay;
          row["balanceActualHours"] = balanceActualHours;
          row["dialyCompleteed"] = dialyCompleted;
          row["remainPlannedHours"] = remainPlannedHours;
          row["averageHours"] = averageHours;
          
          previousActualHours = BigDecimal.valueOf(balanceActualHours);
          dayCount ++;
          
          return true;":
          Fail to execute script in function __bm_FETCH(). Source:
          ------
          " + if (dayCount >= dayNumber || currentDay >= 0) return false;
          
          var sprintDay = dayCount + 1;
          var actualStartDay = UtilDateTime.getDayStart(new Timestamp(actualStartDate.getTime()), new java.util.SimpleTimeZone(reportContext.getTimeZone().getRawOffset(), reportContext.getTimeZone().getID()), reportContext.getLocale());
          var conditionTimestampFrom = new Timestamp(actualStartDay.getTime() + (dayCount*1000*60*60*24));
          var conditionTimestampTo = new Timestamp(actualStartDay.getTime() + (dayCount*1000*60*60*24) + (1000*60*60*24) - 1);
          
          // check current day
          var nowTimestamp = UtilDateTime.nowTimestamp();
          if (nowTimestamp.getTime() >= conditionTimestampFrom.getTime() && nowTimestamp.getTime() <= conditionTimestampTo.getTime()) {
              reportContext.getAppContext().put("sprintDayLabel", sprintDay + "");
          }
          
          // get public holiday
          var holidayConds = new LinkedkList();
          holidayConds.add(EntityCondition.makeCondition("workEffortTypeId",EntityOperator.EQUALS, "PUBLIC_HOLIDAY"));
          holidayConds.add(EntityCondition.makeCondition("estimatedStartDate", EntityOperator.EQUALS, conditionTimestampFrom));
          var fieldsToSelect = UtilMisc.toSet("workEffortId","estimatedStartDate");
          var holidayList = delegator.findList("WorkEffort", EntityCondition.makeCondition(holidayConds), fieldsToSelect, null, null, false);
          
          // check holiday
          var isHoliday = false;
          var dayOfWeek = UtilDateTime.getDayOfWeek(conditionTimestampFrom, new java.util.SimpleTimeZone(reportContext.getTimeZone().getRawOffset(), reportContext.getTimeZone().getID()), reportContext.getLocale());
          var day = UtilDateTime.days[dayOfWeek - 2];
          if (UtilValidate.isNotEmpty(holidayList) || "Saturday".equals(day) || "undefined".equals(day) /*Sunday*/) {
              isHoliday = true;
          }
          if (isHoliday) {
              holidays.add(sprintDay + "");
              reportContext.getAppContext().put("holidays", holidays);
          }
          input =  new HashMap();
          var plannedHours = BigDecimal.ZERO;
          var actualHours = BigDecimal.ZERO;
          
          // get times from all backlog item's tasks
          var sprint = delegator.findOne("WorkEffort", UtilMisc.toMap("workEffortId", sprintId), false);
          var backlogItems = sprint.getRelated("CustRequestWorkEffort", null, null, false);
          for (i=0; i<backlogItems.size(); i++) {
              // get all task from backlog item
              var backlogItem = backlogItems.get(i);
              var custRequestId = backlogItem.get("custRequestId");
              var conds = new LinkedkList();
              conds.add(EntityCondition.makeCondition("custRequestId", custRequestId));
              conds.add(EntityCondition.makeCondition("workEffortTypeId", EntityOperator.NOT_EQUAL, "SCRUM_SPRINT"));
              var tasks = delegator.findList("CustRequestAndWorkEffort", EntityCondition.makeCondition(conds), null, null, null, false);
              for (j=0; j<tasks.size(); j++) {
                  var task = tasks.get(j);
                  // get plan hours by taskId
                  var workEffortId = task.get("workEffortId");
                  input.put("userLogin",userLogin);
                  input.put("taskId",workEffortId);
                  result = dispatcher.runSync("getScrumPlanHour", input);
                  var phs = result.get("planHours");
                  if (phs != null) {
                      plannedHours = plannedHours.add(BigDecimal.valueOf(phs));
                  } else {
                      var estimatedMilliSeconds = task.get("estimatedMilliSeconds");
                      if (estimatedMilliSeconds != null) {
                          var phs = BigDecimal.valueOf(estimatedMilliSeconds/1000/60/60);
                          plannedHours = plannedHours.add(phs);
                      }
                  }
                  // get all time entries from task
                  var timeEntryConds = new LinkedkList();
                  timeEntryConds.add(EntityCondition.makeCondition("workEffortId", workEffortId));
                  timeEntryConds.add(EntityCondition.makeCondition("fromDate", EntityOperator.GREATER_THAN_EQUAL_TO, conditionTimestampFrom));
                  timeEntryConds.add(EntityCondition.makeCondition("fromDate", EntityOperator.LESS_THAN_EQUAL_TO, conditionTimestampTo));
                  var timeEntries = delegator.findList("TimeEntry", EntityCondition.makeCondition(timeEntryConds), null, null, null, false);
                  if (timeEntries.size() > 0) {
                      // get actual hours from task
                      for (k=0; k<timeEntries.size(); k++) {
                          var timeEntry = timeEntries.get(k);
                          var ahs = timeEntry.get("hours");
                          if (ahs != null) {
                              actualHours = actualHours.add(BigDecimal.valueOf(ahs));
                          }
                      }
                  }
              }
          }
          
          sumPlannedHours = sumPlannedHours.add(plannedHours);
          sumActualHours = sumActualHours.add(actualHours);
          var isPlannedOver = false;
          if (previousRemainPlannedHours.compareTo(plannedHours) < 0) {
              isPlannedOver = true;
          }
          
          var dialyCompleted = BigDecimal.ZERO;
          
          // calculate balance actual hours
          var balanceActualHours = maxHours - sumActualHours;
          
          // calculate remain plan hours
          if (!isHoliday) {
              remainPlannedHours = BigDecimal.valueOf(maxHours).subtract(sumActualHours);
              previousRemainPlannedHours = remainPlannedHours;
              dialyCompleted = actualHours;
          }
          
          // calculate average hours
          if (!isHoliday) {
              averageHours = previousAverageHours.subtract(BigDecimal.valueOf(averageDiffHours));
              previousAverageHours = averageHours;
          } else {
              averageHours = previousAverageHours;
          }
          
          row["sprintDay"] = sprintDay;
          row["balanceActualHours"] = balanceActualHours;
          row["dialyCompleteed"] = dialyCompleted;
          row["remainPlannedHours"] = remainPlannedHours;
          row["averageHours"] = averageHours;
          
          previousActualHours = BigDecimal.valueOf(balanceActualHours);
          dayCount ++;
          
          return true; + "
          -----
          A BIRT exception occurred. See next exception for more information.
          ReferenceError: "LinkedkList" is not defined. (/report/data-sets/script-data-set[@id="8"]/method[@name="fetch"]#15).
          + Data Set script method "Fetch" returned null; expected a Boolean value.
          
          
          Show
          pfm.smits Pierre Smits added a comment - The generated burndown.rptdesign shows following error: The following items have errors: ReportDesign (id = 1): + There are errors evaluating script "importPackage(Packages.java.math); importPackage(Packages.java.text); importPackage(Packages.java.sql); importPackage(Packages.org.ofbiz.base.util); importPackage(Packages.org.ofbiz.entity.condition); module = "Burndown.rptdesign" ; sprintId = params[ "sprintId" ].value; actualStartDate = params[ "actualStartDate" ].value; actualCompletionDate = params[ "actualCompletionDate" ].value; dayNumber = params[ "dayNumber" ]; estimatedHrs = params[ "estimatedHrs" ].value; maxHours = params[ "maxHours" ].value; currentDay = -1; userLogin = delegator.findOne( "UserLogin" ,UtilMisc.toMap( "userLoginId" , "admin" ), false ); // caculate average diff hours var holidayNumber = BigDecimal.ZERO; var notHolidayNumber = BigDecimal.ZERO; var countHoliday = 0; while (countHoliday < dayNumber) { var conditionTimestampFrom = new Timestamp(actualStartDate.getTime() + (countHoliday*1000*60*60*24)); // get public holiday var holidayConds = new LinkedkList(); holidayConds.add(EntityCondition.makeCondition( "workEffortTypeId" ,EntityOperator.EQUALS, "PUBLIC_HOLIDAY" )); holidayConds.add(EntityCondition.makeCondition( "estimatedStartDate" , EntityOperator.EQUALS, conditionTimestampFrom)); var fieldsToSelect = UtilMisc.toSet( "workEffortId" , "estimatedStartDate" ); var holidayList = delegator.findList( "WorkEffort" , EntityCondition.makeCondition(holidayConds), fieldsToSelect, null , null , false ); // check holiday var dayOfWeek = UtilDateTime.getDayOfWeek(conditionTimestampFrom, new java.util.SimpleTimeZone(reportContext.getTimeZone().getRawOffset(), reportContext.getTimeZone().getID()), reportContext.getLocale()); var day = UtilDateTime.days[dayOfWeek - 2]; if (!UtilValidate.isNotEmpty(holidayList) && ! "Saturday" .equals(day) && ! "undefined" .equals(day) /*Sunday*/) { notHolidayNumber = notHolidayNumber.add(BigDecimal.ONE); } else { holidayNumber = holidayNumber.add(BigDecimal.ONE); } countHoliday ++; } // get plan hours input = new HashMap(); input.put( "userLogin" ,userLogin); input.put( "sprintId" ,sprintId); result = dispatcher.runSync( "getScrumPlanHour" , input); var phs = result.get( "initPlanHours" ); maxHours = phs; averageDiffHours = maxHours/notHolidayNumber;": ReferenceError: "LinkedkList" is not defined. (/report/method[@name= "initialize" ]#26) ReportDesign (id = 1): + There are errors evaluating script " // declare global variable currentDay = -1; dayCount = 0; sumPlannedHours = BigDecimal.ZERO; sumActualHours = BigDecimal.ZERO; // calculate main total plan hours previousAverageHours = BigDecimal.valueOf(maxHours); previousActualHours = BigDecimal.ZERO; previousRemainPlannedHours = BigDecimal.valueOf(maxHours); remainPlannedHours = BigDecimal.valueOf(maxHours); remainActualHours = BigDecimal.ZERO; averageHours = previousAverageHours; holidays = new LinkedkList(); reportContext.getAppContext().put( "holidays" , holidays); ": Fail to execute script in function __bm_OPEN(). Source: ------ " + // declare global variable currentDay = -1; dayCount = 0; sumPlannedHours = BigDecimal.ZERO; sumActualHours = BigDecimal.ZERO; // calculate main total plan hours previousAverageHours = BigDecimal.valueOf(maxHours); previousActualHours = BigDecimal.ZERO; previousRemainPlannedHours = BigDecimal.valueOf(maxHours); remainPlannedHours = BigDecimal.valueOf(maxHours); remainActualHours = BigDecimal.ZERO; averageHours = previousAverageHours; holidays = new LinkedkList(); reportContext.getAppContext().put( "holidays" , holidays); + " ----- A BIRT exception occurred. See next exception for more information. ReferenceError: "LinkedkList" is not defined. (/report/data-sets/script-data-set[@id= "8" ]/method[@name= "open" ]#16). + There are errors evaluating script " if (dayCount >= dayNumber || currentDay >= 0) return false ; var sprintDay = dayCount + 1; var actualStartDay = UtilDateTime.getDayStart( new Timestamp(actualStartDate.getTime()), new java.util.SimpleTimeZone(reportContext.getTimeZone().getRawOffset(), reportContext.getTimeZone().getID()), reportContext.getLocale()); var conditionTimestampFrom = new Timestamp(actualStartDay.getTime() + (dayCount*1000*60*60*24)); var conditionTimestampTo = new Timestamp(actualStartDay.getTime() + (dayCount*1000*60*60*24) + (1000*60*60*24) - 1); // check current day var nowTimestamp = UtilDateTime.nowTimestamp(); if (nowTimestamp.getTime() >= conditionTimestampFrom.getTime() && nowTimestamp.getTime() <= conditionTimestampTo.getTime()) { reportContext.getAppContext().put( "sprintDayLabel" , sprintDay + ""); } // get public holiday var holidayConds = new LinkedkList(); holidayConds.add(EntityCondition.makeCondition( "workEffortTypeId" ,EntityOperator.EQUALS, "PUBLIC_HOLIDAY" )); holidayConds.add(EntityCondition.makeCondition( "estimatedStartDate" , EntityOperator.EQUALS, conditionTimestampFrom)); var fieldsToSelect = UtilMisc.toSet( "workEffortId" , "estimatedStartDate" ); var holidayList = delegator.findList( "WorkEffort" , EntityCondition.makeCondition(holidayConds), fieldsToSelect, null , null , false ); // check holiday var isHoliday = false ; var dayOfWeek = UtilDateTime.getDayOfWeek(conditionTimestampFrom, new java.util.SimpleTimeZone(reportContext.getTimeZone().getRawOffset(), reportContext.getTimeZone().getID()), reportContext.getLocale()); var day = UtilDateTime.days[dayOfWeek - 2]; if (UtilValidate.isNotEmpty(holidayList) || "Saturday" .equals(day) || "undefined" .equals(day) /*Sunday*/) { isHoliday = true ; } if (isHoliday) { holidays.add(sprintDay + ""); reportContext.getAppContext().put( "holidays" , holidays); } input = new HashMap(); var plannedHours = BigDecimal.ZERO; var actualHours = BigDecimal.ZERO; // get times from all backlog item's tasks var sprint = delegator.findOne( "WorkEffort" , UtilMisc.toMap( "workEffortId" , sprintId), false ); var backlogItems = sprint.getRelated( "CustRequestWorkEffort" , null , null , false ); for (i=0; i<backlogItems.size(); i++) { // get all task from backlog item var backlogItem = backlogItems.get(i); var custRequestId = backlogItem.get( "custRequestId" ); var conds = new LinkedkList(); conds.add(EntityCondition.makeCondition( "custRequestId" , custRequestId)); conds.add(EntityCondition.makeCondition( "workEffortTypeId" , EntityOperator.NOT_EQUAL, "SCRUM_SPRINT" )); var tasks = delegator.findList( "CustRequestAndWorkEffort" , EntityCondition.makeCondition(conds), null , null , null , false ); for (j=0; j<tasks.size(); j++) { var task = tasks.get(j); // get plan hours by taskId var workEffortId = task.get( "workEffortId" ); input.put( "userLogin" ,userLogin); input.put( "taskId" ,workEffortId); result = dispatcher.runSync( "getScrumPlanHour" , input); var phs = result.get( "planHours" ); if (phs != null ) { plannedHours = plannedHours.add(BigDecimal.valueOf(phs)); } else { var estimatedMilliSeconds = task.get( "estimatedMilliSeconds" ); if (estimatedMilliSeconds != null ) { var phs = BigDecimal.valueOf(estimatedMilliSeconds/1000/60/60); plannedHours = plannedHours.add(phs); } } // get all time entries from task var timeEntryConds = new LinkedkList(); timeEntryConds.add(EntityCondition.makeCondition( "workEffortId" , workEffortId)); timeEntryConds.add(EntityCondition.makeCondition( "fromDate" , EntityOperator.GREATER_THAN_EQUAL_TO, conditionTimestampFrom)); timeEntryConds.add(EntityCondition.makeCondition( "fromDate" , EntityOperator.LESS_THAN_EQUAL_TO, conditionTimestampTo)); var timeEntries = delegator.findList( "TimeEntry" , EntityCondition.makeCondition(timeEntryConds), null , null , null , false ); if (timeEntries.size() > 0) { // get actual hours from task for (k=0; k<timeEntries.size(); k++) { var timeEntry = timeEntries.get(k); var ahs = timeEntry.get( "hours" ); if (ahs != null ) { actualHours = actualHours.add(BigDecimal.valueOf(ahs)); } } } } } sumPlannedHours = sumPlannedHours.add(plannedHours); sumActualHours = sumActualHours.add(actualHours); var isPlannedOver = false ; if (previousRemainPlannedHours.compareTo(plannedHours) < 0) { isPlannedOver = true ; } var dialyCompleted = BigDecimal.ZERO; // calculate balance actual hours var balanceActualHours = maxHours - sumActualHours; // calculate remain plan hours if (!isHoliday) { remainPlannedHours = BigDecimal.valueOf(maxHours).subtract(sumActualHours); previousRemainPlannedHours = remainPlannedHours; dialyCompleted = actualHours; } // calculate average hours if (!isHoliday) { averageHours = previousAverageHours.subtract(BigDecimal.valueOf(averageDiffHours)); previousAverageHours = averageHours; } else { averageHours = previousAverageHours; } row[ "sprintDay" ] = sprintDay; row[ "balanceActualHours" ] = balanceActualHours; row[ "dialyCompleteed" ] = dialyCompleted; row[ "remainPlannedHours" ] = remainPlannedHours; row[ "averageHours" ] = averageHours; previousActualHours = BigDecimal.valueOf(balanceActualHours); dayCount ++; return true ;": Fail to execute script in function __bm_FETCH(). Source: ------ " + if (dayCount >= dayNumber || currentDay >= 0) return false ; var sprintDay = dayCount + 1; var actualStartDay = UtilDateTime.getDayStart( new Timestamp(actualStartDate.getTime()), new java.util.SimpleTimeZone(reportContext.getTimeZone().getRawOffset(), reportContext.getTimeZone().getID()), reportContext.getLocale()); var conditionTimestampFrom = new Timestamp(actualStartDay.getTime() + (dayCount*1000*60*60*24)); var conditionTimestampTo = new Timestamp(actualStartDay.getTime() + (dayCount*1000*60*60*24) + (1000*60*60*24) - 1); // check current day var nowTimestamp = UtilDateTime.nowTimestamp(); if (nowTimestamp.getTime() >= conditionTimestampFrom.getTime() && nowTimestamp.getTime() <= conditionTimestampTo.getTime()) { reportContext.getAppContext().put( "sprintDayLabel" , sprintDay + ""); } // get public holiday var holidayConds = new LinkedkList(); holidayConds.add(EntityCondition.makeCondition( "workEffortTypeId" ,EntityOperator.EQUALS, "PUBLIC_HOLIDAY" )); holidayConds.add(EntityCondition.makeCondition( "estimatedStartDate" , EntityOperator.EQUALS, conditionTimestampFrom)); var fieldsToSelect = UtilMisc.toSet( "workEffortId" , "estimatedStartDate" ); var holidayList = delegator.findList( "WorkEffort" , EntityCondition.makeCondition(holidayConds), fieldsToSelect, null , null , false ); // check holiday var isHoliday = false ; var dayOfWeek = UtilDateTime.getDayOfWeek(conditionTimestampFrom, new java.util.SimpleTimeZone(reportContext.getTimeZone().getRawOffset(), reportContext.getTimeZone().getID()), reportContext.getLocale()); var day = UtilDateTime.days[dayOfWeek - 2]; if (UtilValidate.isNotEmpty(holidayList) || "Saturday" .equals(day) || "undefined" .equals(day) /*Sunday*/) { isHoliday = true ; } if (isHoliday) { holidays.add(sprintDay + ""); reportContext.getAppContext().put( "holidays" , holidays); } input = new HashMap(); var plannedHours = BigDecimal.ZERO; var actualHours = BigDecimal.ZERO; // get times from all backlog item's tasks var sprint = delegator.findOne( "WorkEffort" , UtilMisc.toMap( "workEffortId" , sprintId), false ); var backlogItems = sprint.getRelated( "CustRequestWorkEffort" , null , null , false ); for (i=0; i<backlogItems.size(); i++) { // get all task from backlog item var backlogItem = backlogItems.get(i); var custRequestId = backlogItem.get( "custRequestId" ); var conds = new LinkedkList(); conds.add(EntityCondition.makeCondition( "custRequestId" , custRequestId)); conds.add(EntityCondition.makeCondition( "workEffortTypeId" , EntityOperator.NOT_EQUAL, "SCRUM_SPRINT" )); var tasks = delegator.findList( "CustRequestAndWorkEffort" , EntityCondition.makeCondition(conds), null , null , null , false ); for (j=0; j<tasks.size(); j++) { var task = tasks.get(j); // get plan hours by taskId var workEffortId = task.get( "workEffortId" ); input.put( "userLogin" ,userLogin); input.put( "taskId" ,workEffortId); result = dispatcher.runSync( "getScrumPlanHour" , input); var phs = result.get( "planHours" ); if (phs != null ) { plannedHours = plannedHours.add(BigDecimal.valueOf(phs)); } else { var estimatedMilliSeconds = task.get( "estimatedMilliSeconds" ); if (estimatedMilliSeconds != null ) { var phs = BigDecimal.valueOf(estimatedMilliSeconds/1000/60/60); plannedHours = plannedHours.add(phs); } } // get all time entries from task var timeEntryConds = new LinkedkList(); timeEntryConds.add(EntityCondition.makeCondition( "workEffortId" , workEffortId)); timeEntryConds.add(EntityCondition.makeCondition( "fromDate" , EntityOperator.GREATER_THAN_EQUAL_TO, conditionTimestampFrom)); timeEntryConds.add(EntityCondition.makeCondition( "fromDate" , EntityOperator.LESS_THAN_EQUAL_TO, conditionTimestampTo)); var timeEntries = delegator.findList( "TimeEntry" , EntityCondition.makeCondition(timeEntryConds), null , null , null , false ); if (timeEntries.size() > 0) { // get actual hours from task for (k=0; k<timeEntries.size(); k++) { var timeEntry = timeEntries.get(k); var ahs = timeEntry.get( "hours" ); if (ahs != null ) { actualHours = actualHours.add(BigDecimal.valueOf(ahs)); } } } } } sumPlannedHours = sumPlannedHours.add(plannedHours); sumActualHours = sumActualHours.add(actualHours); var isPlannedOver = false ; if (previousRemainPlannedHours.compareTo(plannedHours) < 0) { isPlannedOver = true ; } var dialyCompleted = BigDecimal.ZERO; // calculate balance actual hours var balanceActualHours = maxHours - sumActualHours; // calculate remain plan hours if (!isHoliday) { remainPlannedHours = BigDecimal.valueOf(maxHours).subtract(sumActualHours); previousRemainPlannedHours = remainPlannedHours; dialyCompleted = actualHours; } // calculate average hours if (!isHoliday) { averageHours = previousAverageHours.subtract(BigDecimal.valueOf(averageDiffHours)); previousAverageHours = averageHours; } else { averageHours = previousAverageHours; } row[ "sprintDay" ] = sprintDay; row[ "balanceActualHours" ] = balanceActualHours; row[ "dialyCompleteed" ] = dialyCompleted; row[ "remainPlannedHours" ] = remainPlannedHours; row[ "averageHours" ] = averageHours; previousActualHours = BigDecimal.valueOf(balanceActualHours); dayCount ++; return true ; + " ----- A BIRT exception occurred. See next exception for more information. ReferenceError: "LinkedkList" is not defined. (/report/data-sets/script-data-set[@id= "8" ]/method[@name= "fetch" ]#15). + Data Set script method "Fetch" returned null ; expected a Boolean value.
          Hide
          pfm.smits Pierre Smits added a comment -

          This patch fixes the issue, but also OFBIZ-4863

          Show
          pfm.smits Pierre Smits added a comment - This patch fixes the issue, but also OFBIZ-4863
          Hide
          jacques.le.roux Jacques Le Roux added a comment - - edited

          Thanks Pierre

          Your patch is in
          trunk r1701936
          R14.12 r1701937
          R12.04 r1701938

          I put back the removed license header

          Show
          jacques.le.roux Jacques Le Roux added a comment - - edited Thanks Pierre Your patch is in trunk r1701936 R14.12 r1701937 R12.04 r1701938 I put back the removed license header
          Hide
          jacques.le.roux Jacques Le Roux added a comment - - edited

          Rather OFBIZ-4862 Or you mixed patches... The OFBIZ-4862 and OFBIZ-4861 patches are almost the same but not OFBIZ-4863 patch

          Show
          jacques.le.roux Jacques Le Roux added a comment - - edited Rather OFBIZ-4862 Or you mixed patches... The OFBIZ-4862 and OFBIZ-4861 patches are almost the same but not OFBIZ-4863 patch

            People

            • Assignee:
              pfm.smits Pierre Smits
              Reporter:
              pfm.smits Pierre Smits
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development