// referem
// os dados
row.setCell(totalEnrolmentsApprovedInPreviousYear);
// Nº de Inscrições Externas no ano a que se referem os dados
ExtraCurriculumGroup extraCurriculumGroup = lastStudentCurricularPlan.getExtraCurriculumGroup();
int extraCurricularEnrolmentsCount =
extraCurriculumGroup != null ? extraCurriculumGroup.getEnrolmentsBy(executionYear).size() : 0;
for (final CycleCurriculumGroup cycleCurriculumGroup : lastStudentCurricularPlan.getExternalCurriculumGroups()) {
extraCurricularEnrolmentsCount += cycleCurriculumGroup.getEnrolmentsBy(executionYear).size();
}
if (lastStudentCurricularPlan.hasPropaedeuticsCurriculumGroup()) {
extraCurricularEnrolmentsCount +=
lastStudentCurricularPlan.getPropaedeuticCurriculumGroup().getEnrolmentsBy(executionYear).size();
}
row.setCell(extraCurricularEnrolmentsCount);
// Estados de matrícula
SortedSet<RegistrationState> states = new TreeSet<RegistrationState>(RegistrationState.DATE_COMPARATOR);
for (Registration current : registrationPath) {
states.addAll(current.getRegistrationStatesSet());
}
RegistrationState previousYearState = null;
RegistrationState currentYearState = null;
for (RegistrationState state : states) {
if (!state.getStateDate().isAfter(
executionYear.getPreviousExecutionYear().getEndDateYearMonthDay().toDateTimeAtMidnight())) {
previousYearState = state;
}
if (!state.getStateDate().isAfter(executionYear.getEndDateYearMonthDay().toDateTimeAtMidnight())) {
currentYearState = state;
}
}
// Estado da matrícula no ano lectivo anterior ao que se referem os
// dados
row.setCell(previousYearState != null ? previousYearState.getStateType().getDescription() : "n/a");
// Estado (da matrícula) no ano a que se referem os dados
row.setCell(currentYearState != null ? currentYearState.getStateType().getDescription() : "n/a");
// Data do estado de matrícula
row.setCell(currentYearState != null ? currentYearState.getStateDate().toString("dd-MM-yyyy") : "n/a");
// Nº ECTS do 1º Ciclo concluídos até ao fim do ano lectivo
// anterior ao que se referem os dados
final CycleCurriculumGroup firstCycleCurriculumGroup =
lastStudentCurricularPlan.getRoot().getCycleCurriculumGroup(CycleType.FIRST_CYCLE);
row.setCell(firstCycleCurriculumGroup != null ? printBigDecimal(firstCycleCurriculumGroup.getCurriculum(executionYear)
.getSumEctsCredits()) : "");
// Nº ECTS do 2º Ciclo concluídos até ao fim do ano lectivo
// anterior ao que se referem os dados
final CycleCurriculumGroup secondCycleCurriculumGroup =
lastStudentCurricularPlan.getRoot().getCycleCurriculumGroup(CycleType.SECOND_CYCLE);
row.setCell(secondCycleCurriculumGroup != null && !secondCycleCurriculumGroup.isExternal() ? printBigDecimal(secondCycleCurriculumGroup
.getCurriculum(executionYear).getSumEctsCredits()) : "");
// Nº ECTS do 2º Ciclo Extra primeiro ciclo concluídos até ao fim do ano
// lectivo anterior ao que se referem os dados
Double extraFirstCycleEcts = 0d;
for (final CycleCurriculumGroup cycleCurriculumGroup : lastStudentCurricularPlan.getExternalCurriculumGroups()) {
for (final CurriculumLine curriculumLine : cycleCurriculumGroup.getAllCurriculumLines()) {
if (!curriculumLine.getExecutionYear().isAfter(executionYear.getPreviousExecutionYear())) {
extraFirstCycleEcts += curriculumLine.getCreditsConcluded(executionYear.getPreviousExecutionYear());
}
}
}
row.setCell(printDouble(extraFirstCycleEcts));
// Nº ECTS Extracurriculares concluídos até ao fim do ano lectivo
// anterior que ao se referem os dados
Double extraCurricularEcts = 0d;
Double allExtraCurricularEcts = 0d;
if (extraCurriculumGroup != null) {
for (final CurriculumLine curriculumLine : extraCurriculumGroup.getAllCurriculumLines()) {
if (curriculumLine.isApproved() && curriculumLine.hasExecutionPeriod()
&& !curriculumLine.getExecutionYear().isAfter(executionYear.getPreviousExecutionYear())) {
extraCurricularEcts += curriculumLine.getEctsCreditsForCurriculum().doubleValue();
}
if (curriculumLine.hasExecutionPeriod() && curriculumLine.getExecutionYear() == executionYear) {