/*
  * This method set ReportType data to ReportTypeList for
  * BudgetCumulativeNonPersonnel
  */
 private void setReportTypeForBudgetCumulativeNonPersonnel(List<ReportType> reportTypeList) {
   Map<String, ReportTypeVO> reportTypeMap = new HashMap<String, ReportTypeVO>();
   List<ReportTypeVO> tempReportTypeVOList = new ArrayList<ReportTypeVO>();
   for (BudgetPeriod budgetPeriod : budget.getBudgetPeriods()) {
     for (BudgetLineItem budgetLineItem : budgetPeriod.getBudgetLineItems()) {
       if (!isBudgetCategoryPersonnel(budgetLineItem)) {
         ReportTypeVO tempReportTypeVO =
             getReportTypeVOForBudgetCumulativeNonPersonnel(budgetLineItem);
         tempReportTypeVOList.add(tempReportTypeVO);
       }
     }
   }
   for (ReportTypeVO reportTypeVO : tempReportTypeVOList) {
     String cumulativeNonPersKey = reportTypeVO.getCostElementDesc();
     if (reportTypeMap.containsKey(cumulativeNonPersKey)) {
       continue;
     }
     ScaleTwoDecimal calculatedCost = ScaleTwoDecimal.ZERO;
     for (ReportTypeVO reportTypeVO1 : tempReportTypeVOList) {
       String cumulativeNonPersTempKey = reportTypeVO1.getCostElementDesc();
       if (cumulativeNonPersTempKey.equals(cumulativeNonPersKey)) {
         calculatedCost = calculatedCost.add(reportTypeVO1.getCalculatedCost());
       }
     }
     ReportType reportType =
         getReportTypeForBudgetCumulativeNonPersonnel(calculatedCost, reportTypeVO);
     reportTypeMap.put(cumulativeNonPersKey, reportTypeVO);
     reportTypeList.add(reportType);
   }
 }
 /*
  * This method gets reportTypeVO for BudgetCumulativeNonPersonnel by setting
  * parameters data to reportType
  */
 private ReportTypeVO getReportTypeVOForBudgetCumulativeNonPersonnel(
     BudgetLineItem budgetLineItem) {
   ReportTypeVO reportTypeVO = new ReportTypeVO();
   reportTypeVO.setBudgetCategoryDesc(budgetLineItem.getBudgetCategory().getDescription());
   reportTypeVO.setCostElementDesc(getCostElementDescription(budgetLineItem));
   reportTypeVO.setCalculatedCost(budgetLineItem.getLineItemCost());
   return reportTypeVO;
 }
 /*
  * This method gets reportType for BudgetCumulativeNonPersonnel by setting
  * parameters data to reportType
  */
 private ReportType getReportTypeForBudgetCumulativeNonPersonnel(
     ScaleTwoDecimal calculatedCost, ReportTypeVO reportTypeVO) {
   ReportType reportType = ReportType.Factory.newInstance();
   reportType.setBudgetCategoryDescription(reportTypeVO.getBudgetCategoryDesc());
   reportType.setCostElementDescription(reportTypeVO.getCostElementDesc());
   reportType.setCalculatedCost(calculatedCost.doubleValue());
   return reportType;
 }
 /*
  * This method sets reportTypeVO to ReportTypeList for
  * CumulativeBudgetSalary by groping reportTypeVo based on
  * cumulativeBudgetSalaryKey and gets sum of fringe also get calculated
  * vacationRate, empBenefitRate
  */
 private void setReportTypeListFromReportTypeVoListForCumulativeBudgetSalary(
     List<ReportType> reportTypeList, List<ReportTypeVO> reportTypeVOList) {
   Map<String, ReportTypeVO> reportTypeMap = new HashMap<String, ReportTypeVO>();
   for (ReportTypeVO reportTypeVO : reportTypeVOList) {
     String cumulativeBudgetSalaryKey = getKeyForBudgetSalarySummary(reportTypeVO);
     if (reportTypeMap.containsKey(cumulativeBudgetSalaryKey)) {
       continue;
     }
     ScaleTwoDecimal vacationRate = ScaleTwoDecimal.ZERO;
     ScaleTwoDecimal empBenefitRate = ScaleTwoDecimal.ZERO;
     ScaleTwoDecimal fringe = ScaleTwoDecimal.ZERO;
     for (ReportTypeVO tempReportTypeVO : reportTypeVOList) {
       String cumulativeBudgetSalaryTempKey = getKeyForBudgetSalarySummary(tempReportTypeVO);
       if (cumulativeBudgetSalaryTempKey.equals(cumulativeBudgetSalaryKey)) {
         if (vacationRate.isLessThan(tempReportTypeVO.getVacationRate())) {
           vacationRate = tempReportTypeVO.getVacationRate();
         }
         if (empBenefitRate.isLessThan(tempReportTypeVO.getEmployeeBenefitRate())) {
           empBenefitRate = tempReportTypeVO.getEmployeeBenefitRate();
         }
         fringe = fringe.add(tempReportTypeVO.getFringe());
       }
     }
     ReportType reportType =
         getReportTypeForCumulativeBudgetSalary(
             vacationRate, empBenefitRate, fringe, reportTypeVO);
     reportTypeMap.put(cumulativeBudgetSalaryKey, reportTypeVO);
     reportTypeList.add(reportType);
   }
 }
 /*
  * This method gets reportType for CumulativeBudgetSalary by setting data to
  * reportType from passed parameters
  */
 private ReportType getReportTypeForCumulativeBudgetSalary(
     ScaleTwoDecimal vacationRate,
     ScaleTwoDecimal empBenefitRate,
     ScaleTwoDecimal fringe,
     ReportTypeVO reportTypeVO) {
   ReportType reportType = ReportType.Factory.newInstance();
   reportType.setStartDate(reportTypeVO.getStartDate().toString());
   reportType.setEndDate(reportTypeVO.getEndDate().toString());
   reportType.setBudgetCategoryDescription(reportTypeVO.getBudgetCategoryDesc());
   reportType.setPersonName(reportTypeVO.getPersonName());
   reportType.setVacationRate(vacationRate.toString().concat(PERCENTAGE));
   reportType.setEmployeeBenefitRate(empBenefitRate.toString().concat(PERCENTAGE));
   reportType.setFringe(fringe.doubleValue());
   reportType.setCostElementDescription(reportTypeVO.getCostElementDesc());
   reportType.setInvestigatorFlag(reportTypeVO.getInvestigatorFlag());
   if (reportTypeVO.getBudgetCategoryCode() != null) {
     reportType.setBudgetCategoryCode(Integer.parseInt(reportTypeVO.getBudgetCategoryCode()));
   }
   reportType.setSalaryRequested(reportTypeVO.getSalaryRequested().doubleValue());
   return reportType;
 }