/**
   * builds report body
   *
   * @param BudgetConstructionLevelSummary bcas
   */
  public void buildReportsBody(
      BudgetConstructionOrgLevelSummaryReport orgLevelSummaryReportEntry,
      BudgetConstructionLevelSummary levelSummary) {

    if (levelSummary.getFinancialObjectLevel() == null) {
      orgLevelSummaryReportEntry.setFinancialObjectLevelName(
          kualiConfigurationService.getPropertyValueAsString(
              BCKeyConstants.ERROR_REPORT_GETTING_OBJECT_LEVEL_NAME));
    } else {
      orgLevelSummaryReportEntry.setFinancialObjectLevelName(
          levelSummary.getFinancialObjectLevel().getFinancialObjectLevelName());
    }

    orgLevelSummaryReportEntry.setPositionCsfLeaveFteQuantity(
        BudgetConstructionReportHelper.setDecimalDigit(
            levelSummary.getPositionCsfLeaveFteQuantity(), 2, true));
    orgLevelSummaryReportEntry.setCsfFullTimeEmploymentQuantity(
        BudgetConstructionReportHelper.setDecimalDigit(
            levelSummary.getCsfFullTimeEmploymentQuantity(), 2, true));
    orgLevelSummaryReportEntry.setAppointmentRequestedCsfFteQuantity(
        BudgetConstructionReportHelper.setDecimalDigit(
            levelSummary.getAppointmentRequestedCsfFteQuantity(), 2, true));
    orgLevelSummaryReportEntry.setAppointmentRequestedFteQuantity(
        BudgetConstructionReportHelper.setDecimalDigit(
            levelSummary.getAppointmentRequestedFteQuantity(), 2, true));

    if (levelSummary.getAccountLineAnnualBalanceAmount() != null) {
      orgLevelSummaryReportEntry.setAccountLineAnnualBalanceAmount(
          levelSummary.getAccountLineAnnualBalanceAmount());
    }

    if (levelSummary.getFinancialBeginningBalanceLineAmount() != null) {
      orgLevelSummaryReportEntry.setFinancialBeginningBalanceLineAmount(
          levelSummary.getFinancialBeginningBalanceLineAmount());
    }

    if (levelSummary.getAccountLineAnnualBalanceAmount() != null
        && levelSummary.getFinancialBeginningBalanceLineAmount() != null) {
      orgLevelSummaryReportEntry.setAmountChange(
          levelSummary
              .getAccountLineAnnualBalanceAmount()
              .subtract(levelSummary.getFinancialBeginningBalanceLineAmount()));
    }

    orgLevelSummaryReportEntry.setPercentChange(
        BudgetConstructionReportHelper.calculatePercent(
            orgLevelSummaryReportEntry.getAmountChange(),
            orgLevelSummaryReportEntry.getFinancialBeginningBalanceLineAmount()));
  }
  public List calculateGexpAndTypeTotal(
      List<BudgetConstructionLevelSummary> bclsList,
      List<BudgetConstructionLevelSummary> simpleList) {

    KualiInteger grossFinancialBeginningBalanceLineAmount = KualiInteger.ZERO;
    KualiInteger grossAccountLineAnnualBalanceAmount = KualiInteger.ZERO;

    BigDecimal typePositionCsfLeaveFteQuantity = BigDecimal.ZERO;
    BigDecimal typePositionCsfFullTimeEmploymentQuantity = BigDecimal.ZERO;
    KualiInteger typeFinancialBeginningBalanceLineAmount = KualiInteger.ZERO;
    BigDecimal typeAppointmentRequestedCsfFteQuantity = BigDecimal.ZERO;
    BigDecimal typeAppointmentRequestedFteQuantity = BigDecimal.ZERO;
    KualiInteger typeAccountLineAnnualBalanceAmount = KualiInteger.ZERO;
    KualiInteger typeAmountChange = KualiInteger.ZERO;
    BigDecimal typePercentChange = BigDecimal.ZERO;

    List returnList = new ArrayList();
    for (BudgetConstructionLevelSummary simpleBclsEntry : simpleList) {
      BudgetConstructionOrgLevelSummaryReportTotal bcLevelTotal =
          new BudgetConstructionOrgLevelSummaryReportTotal();
      for (BudgetConstructionLevelSummary bclsListEntry : bclsList) {
        if (BudgetConstructionReportHelper.isSameEntry(
            simpleBclsEntry, bclsListEntry, fieldsForGexpAndType())) {

          typeFinancialBeginningBalanceLineAmount =
              typeFinancialBeginningBalanceLineAmount.add(
                  bclsListEntry.getFinancialBeginningBalanceLineAmount());
          typeAccountLineAnnualBalanceAmount =
              typeAccountLineAnnualBalanceAmount.add(
                  bclsListEntry.getAccountLineAnnualBalanceAmount());
          typePositionCsfLeaveFteQuantity =
              typePositionCsfLeaveFteQuantity.add(bclsListEntry.getPositionCsfLeaveFteQuantity());
          typePositionCsfFullTimeEmploymentQuantity =
              typePositionCsfFullTimeEmploymentQuantity.add(
                  bclsListEntry.getCsfFullTimeEmploymentQuantity());
          typeAppointmentRequestedCsfFteQuantity =
              typeAppointmentRequestedCsfFteQuantity.add(
                  bclsListEntry.getAppointmentRequestedCsfFteQuantity());
          typeAppointmentRequestedFteQuantity =
              typeAppointmentRequestedFteQuantity.add(
                  bclsListEntry.getAppointmentRequestedFteQuantity());

          if (bclsListEntry.getIncomeExpenseCode().equals("B")
              && !bclsListEntry.getFinancialObjectLevelCode().equals("CORI")
              && !bclsListEntry.getFinancialObjectLevelCode().equals("TRIN")) {
            grossFinancialBeginningBalanceLineAmount =
                grossFinancialBeginningBalanceLineAmount.add(
                    bclsListEntry.getFinancialBeginningBalanceLineAmount());
            grossAccountLineAnnualBalanceAmount =
                grossAccountLineAnnualBalanceAmount.add(
                    bclsListEntry.getAccountLineAnnualBalanceAmount());
          }
        }
      }
      bcLevelTotal.setBcls(simpleBclsEntry);

      bcLevelTotal.setGrossFinancialBeginningBalanceLineAmount(
          grossFinancialBeginningBalanceLineAmount);
      bcLevelTotal.setGrossAccountLineAnnualBalanceAmount(grossAccountLineAnnualBalanceAmount);

      bcLevelTotal.setTypePositionCsfLeaveFteQuantity(typePositionCsfLeaveFteQuantity);
      bcLevelTotal.setTypePositionCsfFullTimeEmploymentQuantity(
          typePositionCsfFullTimeEmploymentQuantity);
      bcLevelTotal.setTypeFinancialBeginningBalanceLineAmount(
          typeFinancialBeginningBalanceLineAmount);
      bcLevelTotal.setTypeAppointmentRequestedCsfFteQuantity(
          typeAppointmentRequestedCsfFteQuantity);
      bcLevelTotal.setTypeAppointmentRequestedFteQuantity(typeAppointmentRequestedFteQuantity);
      bcLevelTotal.setTypeAccountLineAnnualBalanceAmount(typeAccountLineAnnualBalanceAmount);

      returnList.add(bcLevelTotal);
      grossFinancialBeginningBalanceLineAmount = KualiInteger.ZERO;
      grossAccountLineAnnualBalanceAmount = KualiInteger.ZERO;

      typePositionCsfLeaveFteQuantity = BigDecimal.ZERO;
      typePositionCsfFullTimeEmploymentQuantity = BigDecimal.ZERO;
      typeFinancialBeginningBalanceLineAmount = KualiInteger.ZERO;
      typeAppointmentRequestedCsfFteQuantity = BigDecimal.ZERO;
      typeAppointmentRequestedFteQuantity = BigDecimal.ZERO;
      typeAccountLineAnnualBalanceAmount = KualiInteger.ZERO;
      typeAmountChange = KualiInteger.ZERO;
      typePercentChange = BigDecimal.ZERO;
    }
    return returnList;
  }
  public List calculateConsTotal(
      List<BudgetConstructionLevelSummary> bclsList,
      List<BudgetConstructionLevelSummary> simpleList) {

    BigDecimal totalConsolidationPositionCsfLeaveFteQuantity = BigDecimal.ZERO;
    BigDecimal totalConsolidationPositionCsfFullTimeEmploymentQuantity = BigDecimal.ZERO;
    KualiInteger totalConsolidationFinancialBeginningBalanceLineAmount = KualiInteger.ZERO;
    BigDecimal totalConsolidationAppointmentRequestedCsfFteQuantity = BigDecimal.ZERO;
    BigDecimal totalConsolidationAppointmentRequestedFteQuantity = BigDecimal.ZERO;
    KualiInteger totalConsolidationAccountLineAnnualBalanceAmount = KualiInteger.ZERO;

    List returnList = new ArrayList();
    for (BudgetConstructionLevelSummary simpleBclsEntry : simpleList) {
      BudgetConstructionOrgLevelSummaryReportTotal bcLevelTotal =
          new BudgetConstructionOrgLevelSummaryReportTotal();
      for (BudgetConstructionLevelSummary bclsListEntry : bclsList) {
        if (BudgetConstructionReportHelper.isSameEntry(
            simpleBclsEntry, bclsListEntry, fieldsForCons())) {
          totalConsolidationFinancialBeginningBalanceLineAmount =
              totalConsolidationFinancialBeginningBalanceLineAmount.add(
                  bclsListEntry.getFinancialBeginningBalanceLineAmount());
          totalConsolidationAccountLineAnnualBalanceAmount =
              totalConsolidationAccountLineAnnualBalanceAmount.add(
                  bclsListEntry.getAccountLineAnnualBalanceAmount());
          totalConsolidationPositionCsfLeaveFteQuantity =
              totalConsolidationPositionCsfLeaveFteQuantity.add(
                  bclsListEntry.getPositionCsfLeaveFteQuantity());
          totalConsolidationPositionCsfFullTimeEmploymentQuantity =
              totalConsolidationPositionCsfFullTimeEmploymentQuantity.add(
                  bclsListEntry.getCsfFullTimeEmploymentQuantity());
          totalConsolidationAppointmentRequestedCsfFteQuantity =
              totalConsolidationAppointmentRequestedCsfFteQuantity.add(
                  bclsListEntry.getAppointmentRequestedCsfFteQuantity());
          totalConsolidationAppointmentRequestedFteQuantity =
              totalConsolidationAppointmentRequestedFteQuantity.add(
                  bclsListEntry.getAppointmentRequestedFteQuantity());
        }
      }
      bcLevelTotal.setBcls(simpleBclsEntry);
      bcLevelTotal.setTotalConsolidationPositionCsfLeaveFteQuantity(
          totalConsolidationPositionCsfLeaveFteQuantity);
      bcLevelTotal.setTotalConsolidationPositionCsfFullTimeEmploymentQuantity(
          totalConsolidationPositionCsfFullTimeEmploymentQuantity);
      bcLevelTotal.setTotalConsolidationFinancialBeginningBalanceLineAmount(
          totalConsolidationFinancialBeginningBalanceLineAmount);
      bcLevelTotal.setTotalConsolidationAppointmentRequestedCsfFteQuantity(
          totalConsolidationAppointmentRequestedCsfFteQuantity);
      bcLevelTotal.setTotalConsolidationAppointmentRequestedFteQuantity(
          totalConsolidationAppointmentRequestedFteQuantity);
      bcLevelTotal.setTotalConsolidationAccountLineAnnualBalanceAmount(
          totalConsolidationAccountLineAnnualBalanceAmount);
      returnList.add(bcLevelTotal);

      totalConsolidationPositionCsfLeaveFteQuantity = BigDecimal.ZERO;
      totalConsolidationPositionCsfFullTimeEmploymentQuantity = BigDecimal.ZERO;
      totalConsolidationFinancialBeginningBalanceLineAmount = KualiInteger.ZERO;
      totalConsolidationAppointmentRequestedCsfFteQuantity = BigDecimal.ZERO;
      totalConsolidationAppointmentRequestedFteQuantity = BigDecimal.ZERO;
      totalConsolidationAccountLineAnnualBalanceAmount = KualiInteger.ZERO;
    }
    return returnList;
  }