final Registration registration = studentCurricularPlan.getRegistration();
if (registration != null && !registration.isTransition() && !registration.isSchoolPartConcluded()) {
for (final CycleType cycleType : registration.getDegreeType().getCycleTypes()) {
final CycleCurriculumGroup cycleCGroup = studentCurricularPlan.getRoot().getCycleCurriculumGroup(cycleType);
if (cycleCGroup != null && !cycleCGroup.isExternal()) {
final RegistrationConclusionBean registrationConclusionBean =
new RegistrationConclusionBean(registration, cycleCGroup);
if (cycleCGroup.isConcluded()) {
final ExecutionYear conclusionYear = registrationConclusionBean.getConclusionYear();
if (conclusionYear != executionYear && conclusionYear != executionYear.getPreviousExecutionYear()) {
continue;
}
}
boolean isToAddRegistration = false;
for (RegistrationState state : registration.getRegistrationStates(executionYear)) {
if (state.isActive() || state.getStateType() == RegistrationStateType.CONCLUDED) {
isToAddRegistration = true;
break;
}
}
if (isToAddRegistration
&& (cycleCGroup.isConcluded(executionYear.getPreviousExecutionYear()) == ConclusionValue.CONCLUDED)) {
reportRaidesGraduate(spreadsheet, registration, getFullRegistrationPath(registration), executionYear,
cycleType, true, registrationConclusionBean.getConclusionDate(),
registrationConclusionBean.getAverage());
} else if (isToAddRegistration
&& registration.getLastDegreeCurricularPlan().hasExecutionDegreeFor(executionYear)) {