/* * 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 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 generates XML for Award Delta Report. It uses data passed in {@link * org.kuali.coeus.sys.framework.model.KcTransactionalDocumentBase} for populating the XML nodes. * The XMl once generated is returned as {@link XmlObject} * * @param printableBusinessObject using which XML is generated * @param reportParameters parameters related to XML generation * @return {@link XmlObject} representing the XML */ public Map<String, XmlObject> generateXmlStream( KcPersistableBusinessObjectBase printableBusinessObject, Map<String, Object> reportParameters) { Map<String, XmlObject> xmlObjectList = new LinkedHashMap<String, XmlObject>(); this.budget = (Budget) printableBusinessObject; if (budget != null) { BudgetSummaryReport budgetSummaryReport = BudgetSummaryReport.Factory.newInstance(); BudgetSummaryReportDocument budgetSummaryReportDocument = BudgetSummaryReportDocument.Factory.newInstance(); budgetSummaryReport = getBudgetCumulativeReport(); budgetSummaryReportDocument.setBudgetSummaryReport(budgetSummaryReport); xmlObjectList.put(CUMULATIVE_BUDGET, budgetSummaryReportDocument); } return xmlObjectList; }