public BigDecimal getNumberOfApprovedEctsOneYearAgo() { ExecutionYear oneYearAgo = getForExecutionYear().getPreviousExecutionYear(); BigDecimal result = BigDecimal.ZERO; if (student == null) { return BigDecimal.ZERO; } for (final Registration registration : student.getRegistrationsSet()) { if (registration.isBolonha() && registration.hasAnyEnrolmentsIn(oneYearAgo)) { result = result .add( calculateApprovedECTS( registration .getLastStudentCurricularPlan() .getAprovedEnrolmentsInExecutionPeriod( oneYearAgo.getFirstExecutionPeriod()))) .add( calculateApprovedECTS( registration .getLastStudentCurricularPlan() .getAprovedEnrolmentsInExecutionPeriod( oneYearAgo.getLastExecutionPeriod()))); } } return result; }
public BigDecimal getNumberOfEnrolledEctsOneYearAgo() { ExecutionYear oneYearAgo = getForExecutionYear().getPreviousExecutionYear(); BigDecimal result = BigDecimal.ZERO; if (student == null) { return BigDecimal.ZERO; } for (final Registration registration : student.getRegistrationsSet()) { if (registration.isBolonha() && registration.hasAnyEnrolmentsIn(oneYearAgo)) { result = result.add(new BigDecimal(getEnrolmentsEctsCredits(registration, oneYearAgo))); } } return result; }