Exemplo n.º 1
0
 /*
  * 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);
   }
 }