/** Unselects all sub-fund codes. */
  public ActionForward unselectAllSubFunds(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response)
      throws Exception {
    OrganizationReportSelectionForm organizationReportSelectionForm =
        (OrganizationReportSelectionForm) form;
    for (BudgetConstructionSubFundPick budgetConstructionSubFundPick :
        organizationReportSelectionForm.getSubFundPickList()) {
      budgetConstructionSubFundPick.setReportFlag(new Integer(0));
    }

    return mapping.findForward(KFSConstants.MAPPING_BASIC);
  }
  /**
   * Checks and stores sub-fund, object code, or reason code list depenending on the report mode and
   * which screen we are on.
   *
   * @param organizationReportSelectionForm - OrganizationReportSelectionForm containing the select
   *     lists
   * @param reportMode - BudgetConstructionReportMode for the report being ran
   * @return - true if a selection was found and the list was stored or if we need to show reason
   *     code select screen, false otherwise
   */
  protected boolean storeCodeSelections(
      OrganizationReportSelectionForm organizationReportSelectionForm,
      BudgetConstructionReportMode reportMode,
      String principalName) {
    boolean codeSelected = true;

    if (ReportSelectMode.SUBFUND.equals(reportMode.reportSelectMode)) {
      // came from sub fund select screen so need to store sub fund selection settings
      if (!storedSelectedSubFunds(organizationReportSelectionForm.getSubFundPickList())) {
        codeSelected = false;
      }
    } else if (organizationReportSelectionForm
        .getOperatingModeTitle()
        .equals(BCConstants.Report.OBJECT_CODE_SELECTION_TITLE)) {
      // came from object code select screen so need to store object code selection settings
      if (!storedSelectedObjectCodes(organizationReportSelectionForm.getObjectCodePickList())) {
        codeSelected = false;
      }

      // determine if we need to setup reason code select
      if (ReportSelectMode.REASON.equals(reportMode.reportSelectMode)
          && !organizationReportSelectionForm
              .getBudgetConstructionReportThresholdSettings()
              .isUseThreshold()) {
        BudgetReportsControlListService budgetReportsControlListService =
            SpringContext.getBean(BudgetReportsControlListService.class);

        // rebuild reason code control list
        budgetReportsControlListService.updateReportReasonCodeSelectList(principalName);

        // setup form
        organizationReportSelectionForm.setReasonCodePickList(
            (List) budgetReportsControlListService.retrieveReasonCodeList(principalName));
        organizationReportSelectionForm.setOperatingModeTitle(
            BCConstants.Report.REASON_CODE_SELECTION_TITLE);
        codeSelected = false;
      }
    } else if (organizationReportSelectionForm
        .getOperatingModeTitle()
        .equals(BCConstants.Report.REASON_CODE_SELECTION_TITLE)) {
      // came from reason code select screen so need to store reason code selection settings
      if (!storedSelectedReasonCodes(organizationReportSelectionForm.getReasonCodePickList())) {
        codeSelected = false;
      }
    }

    return codeSelected;
  }