photocopy = false;
agree = false;
cv = false;
transcript = false;
englishLevel = false;
MobilityIndividualApplicationProcess erasmusIndividualCandidacyProcess =
(MobilityIndividualApplicationProcess) individualCandidacyProcess;
if (individualCandidacyProcess.isCandidacyCancelled()) {
continue;
}
if (individualCandidacyProcess.isCandidacyRejected()) {
continue;
}
IndividualCandidacyPersonalDetails personalDetails = erasmusIndividualCandidacyProcess.getPersonalDetails();
Row row = spreadsheet.addRow();
row.setCell(0, erasmusIndividualCandidacyProcess.getProcessCode());
if (personalDetails.getPerson() != null && personalDetails.getPerson().getUsername() != null) {
row.setCell(1, personalDetails.getPerson().getUsername());
} else {
row.setCell(1, "");
}
row.setCell(2, erasmusIndividualCandidacyProcess.getPersonalDetails().getName());
row.setCell(3, personalDetails.getDateOfBirthYearMonthDay() != null ? personalDetails.getDateOfBirthYearMonthDay()
.toString("dd/MM/yyyy") : "N/A");
row.setCell(4, erasmusIndividualCandidacyProcess.getPersonalDetails().getCountry().getCountryNationality()
.getContent());
row.setCell(5, erasmusIndividualCandidacyProcess.getCandidacy().getMobilityStudentData().getSelectedOpening()
.getMobilityAgreement().getUniversityUnit().getName());
row.setCell(6, erasmusIndividualCandidacyProcess.getMobilityProgram().getRegistrationProtocol().getDescription()
.getContent());
row.setCell(7, erasmusIndividualCandidacyProcess.getCandidacyHashCode().getEmail());
row.setCell(8, erasmusIndividualCandidacyProcess.getCandidacy().getSelectedDegree().getNameI18N().getContent());
row.setCell(
9,
erasmusIndividualCandidacyProcess.getCandidacy().getMobilityStudentData().getDateOfArrival()
.toString("dd/MM/yyyy"));
row.setCell(10, erasmusIndividualCandidacyProcess.getCandidacy().getMobilityStudentData().getDateOfDeparture()
.toString("dd/MM/yyyy"));
row.setCell(11, erasmusIndividualCandidacyProcess.getErasmusCandidacyStateDescription());
if (erasmusIndividualCandidacyProcess.getPhoto() != null) {
row.setCell(13, "Sim");
photo = true;
} else {
row.setCell(13, "Não");
}
if (getUploadedDocumentByType(erasmusIndividualCandidacyProcess.getCandidacy().getDocumentsSet(),
IndividualCandidacyDocumentFileType.DOCUMENT_IDENTIFICATION) != null) {
row.setCell(14, "Sim");
photocopy = true;
} else {
row.setCell(14, "Não");
}
if (getUploadedDocumentByType(erasmusIndividualCandidacyProcess.getCandidacy().getDocumentsSet(),
IndividualCandidacyDocumentFileType.LEARNING_AGREEMENT) != null) {
row.setCell(15, "Sim");
agree = true;
} else {
row.setCell(15, "Não");
}
if (getUploadedDocumentByType(erasmusIndividualCandidacyProcess.getCandidacy().getDocumentsSet(),
IndividualCandidacyDocumentFileType.CV_DOCUMENT) != null) {
row.setCell(16, "Sim");
cv = true;
} else {
row.setCell(16, "Não");
}
if (getUploadedDocumentByType(erasmusIndividualCandidacyProcess.getCandidacy().getDocumentsSet(),
IndividualCandidacyDocumentFileType.TRANSCRIPT_OF_RECORDS) != null) {
row.setCell(17, "Sim");
transcript = true;
} else {
row.setCell(17, "Não");
}
if (getUploadedDocumentByType(erasmusIndividualCandidacyProcess.getCandidacy().getDocumentsSet(),
IndividualCandidacyDocumentFileType.ENGLISH_LEVEL_DECLARATION) != null) {
row.setCell(18, "Sim");
englishLevel = true;
} else {
row.setCell(18, "Não");