use of com.axelor.apps.hr.service.PayrollPreparationService in project axelor-open-suite by axelor.
the class PayrollPreparationController method exportPayrollPreparation.
public void exportPayrollPreparation(ActionRequest request, ActionResponse response) throws IOException, AxelorException {
PayrollPreparationService payrollPreparationService = Beans.get(PayrollPreparationService.class);
PayrollPreparation payrollPreparation = Beans.get(PayrollPreparationRepository.class).find(request.getContext().asType(PayrollPreparation.class).getId());
String file = payrollPreparationService.exportPayrollPreparation(payrollPreparation);
if (file != null) {
String[] filePath = file.split("/");
response.setExportFile(filePath[filePath.length - 1]);
}
payrollPreparationService.closePayPeriodIfExported(payrollPreparation);
response.setReload(true);
}
Aggregations