/**
   * builds report total
   *
   * @param BudgetConstructionLevelSummary bcas
   * @param List reportTotalList
   */
  public void buildReportsTotal(
      BudgetConstructionOrgLevelSummaryReport orgLevelSummaryReportEntry,
      BudgetConstructionLevelSummary levelSummary,
      List<BudgetConstructionOrgLevelSummaryReportTotal> levelSummaryTotalConsList,
      List<BudgetConstructionOrgLevelSummaryReportTotal> levelSummaryTotalGexpAndTypeList,
      List<BudgetConstructionOrgLevelSummaryReportTotal> levelSummaryTotalList) {

    for (BudgetConstructionOrgLevelSummaryReportTotal consTotal : levelSummaryTotalConsList) {
      if (BudgetConstructionReportHelper.isSameEntry(
          levelSummary, consTotal.getBcls(), fieldsForCons())) {
        orgLevelSummaryReportEntry.setTotalConsolidationDescription(
            levelSummary.getFinancialConsolidationObject().getFinConsolidationObjectName());

        // The total part shouldn't have null value, so just checking '0'
        orgLevelSummaryReportEntry.setTotalConsolidationPositionCsfLeaveFteQuantity(
            BudgetConstructionReportHelper.setDecimalDigit(
                consTotal.getTotalConsolidationPositionCsfLeaveFteQuantity(), 2, true));
        orgLevelSummaryReportEntry.setTotalConsolidationPositionCsfFullTimeEmploymentQuantity(
            BudgetConstructionReportHelper.setDecimalDigit(
                consTotal.getTotalConsolidationPositionCsfFullTimeEmploymentQuantity(), 2, true));
        orgLevelSummaryReportEntry.setTotalConsolidationFinancialBeginningBalanceLineAmount(
            consTotal.getTotalConsolidationFinancialBeginningBalanceLineAmount());
        orgLevelSummaryReportEntry.setTotalConsolidationAppointmentRequestedCsfFteQuantity(
            BudgetConstructionReportHelper.setDecimalDigit(
                consTotal.getTotalConsolidationAppointmentRequestedCsfFteQuantity(), 2, true));
        orgLevelSummaryReportEntry.setTotalConsolidationAppointmentRequestedFteQuantity(
            BudgetConstructionReportHelper.setDecimalDigit(
                consTotal.getTotalConsolidationAppointmentRequestedFteQuantity(), 2, true));
        orgLevelSummaryReportEntry.setTotalConsolidationAccountLineAnnualBalanceAmount(
            consTotal.getTotalConsolidationAccountLineAnnualBalanceAmount());

        KualiInteger amountChange =
            consTotal
                .getTotalConsolidationAccountLineAnnualBalanceAmount()
                .subtract(consTotal.getTotalConsolidationFinancialBeginningBalanceLineAmount());
        orgLevelSummaryReportEntry.setTotalConsolidationAmountChange(amountChange);
        orgLevelSummaryReportEntry.setTotalConsolidationPercentChange(
            BudgetConstructionReportHelper.calculatePercent(
                amountChange,
                consTotal.getTotalConsolidationFinancialBeginningBalanceLineAmount()));
      }
    }

    for (BudgetConstructionOrgLevelSummaryReportTotal gexpAndTypeTotal :
        levelSummaryTotalGexpAndTypeList) {
      if (BudgetConstructionReportHelper.isSameEntry(
          levelSummary, gexpAndTypeTotal.getBcls(), fieldsForGexpAndType())) {

        orgLevelSummaryReportEntry.setGrossFinancialBeginningBalanceLineAmount(
            gexpAndTypeTotal.getGrossFinancialBeginningBalanceLineAmount());
        orgLevelSummaryReportEntry.setGrossAccountLineAnnualBalanceAmount(
            gexpAndTypeTotal.getGrossAccountLineAnnualBalanceAmount());
        KualiInteger gexpAndTypeAmountChange =
            gexpAndTypeTotal
                .getGrossAccountLineAnnualBalanceAmount()
                .subtract(gexpAndTypeTotal.getGrossFinancialBeginningBalanceLineAmount());
        orgLevelSummaryReportEntry.setGrossAmountChange(gexpAndTypeAmountChange);
        orgLevelSummaryReportEntry.setGrossPercentChange(
            BudgetConstructionReportHelper.calculatePercent(
                gexpAndTypeAmountChange,
                gexpAndTypeTotal.getGrossFinancialBeginningBalanceLineAmount()));

        if (levelSummary.getIncomeExpenseCode().equals(BCConstants.Report.INCOME_EXP_TYPE_A)) {
          orgLevelSummaryReportEntry.setTypeDesc(
              kualiConfigurationService.getPropertyValueAsString(
                  BCKeyConstants.MSG_REPORT_INCOME_EXP_DESC_UPPERCASE_REVENUE));
        } else {
          orgLevelSummaryReportEntry.setTypeDesc(
              kualiConfigurationService.getPropertyValueAsString(
                  BCKeyConstants.MSG_REPORT_INCOME_EXP_DESC_EXPENDITURE_NET_TRNFR));
        }
        orgLevelSummaryReportEntry.setTypePositionCsfLeaveFteQuantity(
            BudgetConstructionReportHelper.setDecimalDigit(
                gexpAndTypeTotal.getTypePositionCsfLeaveFteQuantity(), 2, true));
        orgLevelSummaryReportEntry.setTypePositionCsfFullTimeEmploymentQuantity(
            BudgetConstructionReportHelper.setDecimalDigit(
                gexpAndTypeTotal.getTypePositionCsfFullTimeEmploymentQuantity(), 2, true));
        orgLevelSummaryReportEntry.setTypeFinancialBeginningBalanceLineAmount(
            gexpAndTypeTotal.getTypeFinancialBeginningBalanceLineAmount());
        orgLevelSummaryReportEntry.setTypeAppointmentRequestedCsfFteQuantity(
            BudgetConstructionReportHelper.setDecimalDigit(
                gexpAndTypeTotal.getTypeAppointmentRequestedCsfFteQuantity(), 2, true));
        orgLevelSummaryReportEntry.setTypeAppointmentRequestedFteQuantity(
            BudgetConstructionReportHelper.setDecimalDigit(
                gexpAndTypeTotal.getTypeAppointmentRequestedFteQuantity(), 2, true));

        orgLevelSummaryReportEntry.setTypeAccountLineAnnualBalanceAmount(
            gexpAndTypeTotal.getTypeAccountLineAnnualBalanceAmount());
        KualiInteger typeAmountChange =
            gexpAndTypeTotal
                .getTypeAccountLineAnnualBalanceAmount()
                .subtract(gexpAndTypeTotal.getTypeFinancialBeginningBalanceLineAmount());
        orgLevelSummaryReportEntry.setTypeAmountChange(typeAmountChange);
        orgLevelSummaryReportEntry.setTypePercentChange(
            BudgetConstructionReportHelper.calculatePercent(
                typeAmountChange, gexpAndTypeTotal.getTypeFinancialBeginningBalanceLineAmount()));
      }
    }

    for (BudgetConstructionOrgLevelSummaryReportTotal total : levelSummaryTotalList) {
      if (BudgetConstructionReportHelper.isSameEntry(
          levelSummary, total.getBcls(), fieldsForTotal())) {

        orgLevelSummaryReportEntry.setTotalSubFundGroupDesc(
            levelSummary.getSubFundGroup().getSubFundGroupDescription());
        orgLevelSummaryReportEntry.setRevenueFinancialBeginningBalanceLineAmount(
            total.getRevenueFinancialBeginningBalanceLineAmount());
        orgLevelSummaryReportEntry.setRevenueAccountLineAnnualBalanceAmount(
            total.getRevenueAccountLineAnnualBalanceAmount());
        orgLevelSummaryReportEntry.setExpenditureFinancialBeginningBalanceLineAmount(
            total.getExpenditureFinancialBeginningBalanceLineAmount());
        orgLevelSummaryReportEntry.setExpenditureAccountLineAnnualBalanceAmount(
            total.getExpenditureAccountLineAnnualBalanceAmount());

        KualiInteger revenueAmountChange =
            total
                .getRevenueAccountLineAnnualBalanceAmount()
                .subtract(total.getRevenueFinancialBeginningBalanceLineAmount());
        orgLevelSummaryReportEntry.setRevenueAmountChange(revenueAmountChange);
        orgLevelSummaryReportEntry.setRevenuePercentChange(
            BudgetConstructionReportHelper.calculatePercent(
                revenueAmountChange, total.getRevenueFinancialBeginningBalanceLineAmount()));

        KualiInteger expenditureAmountChange =
            total
                .getExpenditureAccountLineAnnualBalanceAmount()
                .subtract(total.getExpenditureFinancialBeginningBalanceLineAmount());
        orgLevelSummaryReportEntry.setExpenditureAmountChange(expenditureAmountChange);
        orgLevelSummaryReportEntry.setExpenditurePercentChange(
            BudgetConstructionReportHelper.calculatePercent(
                expenditureAmountChange,
                total.getExpenditureFinancialBeginningBalanceLineAmount()));

        orgLevelSummaryReportEntry.setDifferenceFinancialBeginningBalanceLineAmount(
            total.getDifferenceFinancialBeginningBalanceLineAmount());
        orgLevelSummaryReportEntry.setDifferenceAccountLineAnnualBalanceAmount(
            total.getDifferenceAccountLineAnnualBalanceAmount());

        KualiInteger differenceAmountChange =
            total
                .getDifferenceAccountLineAnnualBalanceAmount()
                .subtract(total.getDifferenceFinancialBeginningBalanceLineAmount());
        orgLevelSummaryReportEntry.setDifferenceAmountChange(differenceAmountChange);
        orgLevelSummaryReportEntry.setDifferencePercentChange(
            BudgetConstructionReportHelper.calculatePercent(
                differenceAmountChange, total.getDifferenceFinancialBeginningBalanceLineAmount()));
      }
    }
  }