public ActionForward concludeAcademicServiceRequest(
      ActionMapping mapping,
      ActionForm actionForm,
      HttpServletRequest request,
      HttpServletResponse response)
      throws FenixFilterException, FenixServiceException {
    Boolean sendEmail = true;
    RegistrationAcademicServiceRequest academicServiceRequest =
        getAndSetAcademicServiceRequest(request);

    final AcademicServiceRequestsManagementForm form =
        (AcademicServiceRequestsManagementForm) actionForm;
    if (academicServiceRequest.getAcademicServiceRequestType()
        == AcademicServiceRequestType.SPECIAL_SEASON_REQUEST) {
      if (form.getDeferRequest() == null) {
        return prepareConcludeAcademicServiceRequest(mapping, actionForm, request, response);
      }
      final SpecialSeasonRequest specialSeasonRequest =
          (SpecialSeasonRequest) academicServiceRequest;
      specialSeasonRequest.setDeferment(form.getDeferRequest());
      academicServiceRequest = specialSeasonRequest;
    }

    if (RegistrationAgreement.MOBILITY_AGREEMENTS.contains(
        academicServiceRequest.getRegistration().getRegistrationAgreement())) {
      sendEmail = false;
    }

    if (academicServiceRequest.getAcademicServiceRequestType()
        == AcademicServiceRequestType.DIPLOMA_SUPPLEMENT_REQUEST) {
      sendEmail = false;
    }

    try {
      academicServiceRequest.conclude(
          getSituationDate(),
          getJustification(),
          form.getSendEmailToStudent() != null ? form.getSendEmailToStudent() : sendEmail);
      addActionMessage(request, "academic.service.request.concluded.with.success");

      if (academicServiceRequest.isDocumentRequest()
          && ((DocumentRequest) academicServiceRequest)
              .getDocumentRequestType()
              .isAllowedToQuickDeliver()) {
        return deliveredAcademicServiceRequest(mapping, actionForm, request, response);
      }
    } catch (DomainExceptionWithLabelFormatter ex) {
      addActionMessage(
          request, ex.getKey(), solveLabelFormatterArgs(request, ex.getLabelFormatterArgs()));
    } catch (DomainException ex) {
      addActionMessage(request, ex.getKey());
    }

    request.setAttribute("registration", academicServiceRequest.getRegistration());
    return mapping.findForward("viewRegistrationDetails");
  }
  public ActionForward prepareConcludeAcademicServiceRequest(
      ActionMapping mapping,
      ActionForm actionForm,
      HttpServletRequest request,
      HttpServletResponse response)
      throws FenixFilterException, FenixServiceException {

    final RegistrationAcademicServiceRequest academicServiceRequest =
        getAndSetAcademicServiceRequest(request);
    AcademicServiceRequestsManagementForm form = (AcademicServiceRequestsManagementForm) actionForm;
    form.setSendEmailToStudent(Boolean.TRUE);

    if (academicServiceRequest.isDocumentRequest()) {
      request.setAttribute(
          "serviceRequestBean",
          new AcademicServiceRequestBean(
              academicServiceRequest, AcademicServiceRequestSituationType.CONCLUDED));
      return mapping.findForward("prepareConcludeDocumentRequest");
    } else {
      return mapping.findForward("prepareConcludeServiceRequest");
    }
  }