use of com.axelor.apps.base.db.Department in project axelor-open-suite by axelor.
the class EmploymentContractService method employmentContractExportSilae.
public void employmentContractExportSilae(EmploymentContract employmentContract, List<String[]> list) {
String[] item = new String[21];
item[0] = employmentContract.getId().toString();
item[1] = employmentContract.getStartDate() == null ? "" : employmentContract.getStartDate().toString();
item[2] = employmentContract.getEndDate() == null ? "" : employmentContract.getEndDate().toString();
Employee employee = employmentContract.getEmployee();
item[4] = employee.getMaritalName();
Partner contactPartner = employee.getContactPartner();
if (contactPartner != null) {
item[3] = contactPartner.getName();
item[5] = contactPartner.getFirstName();
Address mainAddress = contactPartner.getMainAddress();
if (mainAddress != null) {
item[6] = mainAddress.getAddressL4();
item[7] = mainAddress.getAddressL2();
item[8] = mainAddress.getZip();
if (mainAddress.getCity() != null) {
item[9] = mainAddress.getCity().getName();
} else {
item[9] = "";
}
}
item[10] = contactPartner.getMobilePhone();
item[11] = contactPartner.getFixedPhone();
item[12] = contactPartner.getEmailAddress() == null ? "" : contactPartner.getEmailAddress().getAddress();
}
item[13] = employee.getBirthDate() == null ? "" : employee.getBirthDate().toString();
Department birthDepartment = employee.getDepartmentOfBirth();
if (birthDepartment != null) {
item[14] = birthDepartment.getName();
item[16] = !birthDepartment.getCode().equals("99") ? "FR - FRANCE" : "Oui";
}
item[15] = employee.getCityOfBirth() == null ? "" : employee.getCityOfBirth().getName();
item[17] = employee.getSocialSecurityNumber();
item[18] = employmentContract.getPayCompany().getName();
item[19] = employmentContract.getContractType() == null ? "" : employmentContract.getContractType().getId().toString();
item[20] = employee.getMaidenName();
list.add(item);
}
Aggregations