コード例 #1
0
  @Override
  protected Money doCalculationForAmountToPay(Event event, DateTime when, boolean applyDiscount) {
    DegreeChangeIndividualCandidacy individualCandidacy =
        ((DegreeChangeIndividualCandidacyEvent) event).getIndividualCandidacy();
    final PrecedentDegreeInformation information =
        individualCandidacy.getRefactoredPrecedentDegreeInformation();

    if (individualCandidacy.getUtlStudent() != null) {
      return individualCandidacy.getUtlStudent()
          ? getAmountForInstitutionStudent()
          : getAmountForExternalStudent();
    } else {
      if (information.isCandidacyInternal()
          || hasAnyValidRegistration((DegreeChangeIndividualCandidacyEvent) event)
          || belongsToInstitutionGroup(information.getPrecedentInstitution())) {
        return getAmountForInstitutionStudent();
      } else {
        return getAmountForExternalStudent();
      }
    }
  }
コード例 #2
0
  @Override
  public PaymentCodeType calculatePaymentCodeTypeFromEvent(
      Event event, DateTime when, boolean applyDiscount) {
    DegreeChangeIndividualCandidacy individualCandidacy =
        ((DegreeChangeIndividualCandidacyEvent) event).getIndividualCandidacy();
    final PrecedentDegreeInformation information =
        individualCandidacy.getRefactoredPrecedentDegreeInformation();

    if (individualCandidacy.getUtlStudent() != null) {
      return individualCandidacy.getUtlStudent()
          ? PaymentCodeType.INTERNAL_DEGREE_CHANGE_INDIVIDUAL_CANDIDACY_PROCESS
          : PaymentCodeType.EXTERNAL_DEGREE_CHANGE_INDIVIDUAL_CANDIDACY_PROCESS;
    } else {
      if (information.isCandidacyInternal()
          || hasAnyValidRegistration((DegreeChangeIndividualCandidacyEvent) event)
          || belongsToInstitutionGroup(information.getPrecedentInstitution())) {
        return PaymentCodeType.INTERNAL_DEGREE_CHANGE_INDIVIDUAL_CANDIDACY_PROCESS;
      } else {
        return PaymentCodeType.EXTERNAL_DEGREE_CHANGE_INDIVIDUAL_CANDIDACY_PROCESS;
      }
    }
  }