use of com.axelor.apps.hr.db.EmployeeBonusMgt in project axelor-open-suite by axelor.
the class EmployeeBonusController method print.
public void print(ActionRequest request, ActionResponse response) throws AxelorException {
EmployeeBonusMgt bonus = Beans.get(EmployeeBonusMgtRepository.class).find(request.getContext().asType(EmployeeBonusMgt.class).getId());
String name = I18n.get("Employee bonus management") + " : " + bonus.getEmployeeBonusType().getLabel();
String fileLink = ReportFactory.createReport(IReport.EMPLOYEE_BONUS_MANAGEMENT, name).addParam("EmployeeBonusMgtId", bonus.getId()).addParam("Timezone", bonus.getCompany() != null ? bonus.getCompany().getTimezone() : null).addParam("Locale", ReportSettings.getPrintingLocale(null)).toAttach(bonus).generate().getFileLink();
response.setView(ActionView.define(name).add("html", fileLink).map());
}
use of com.axelor.apps.hr.db.EmployeeBonusMgt in project axelor-open-suite by axelor.
the class EmployeeBonusController method compute.
public void compute(ActionRequest request, ActionResponse response) {
EmployeeBonusMgt employeeBonusMgt = request.getContext().asType(EmployeeBonusMgt.class);
PeriodService periodService = Beans.get(PeriodService.class);
try {
employeeBonusMgt = Beans.get(EmployeeBonusMgtRepository.class).find(employeeBonusMgt.getId());
Beans.get(EmployeeBonusService.class).compute(employeeBonusMgt);
response.setReload(true);
periodService.checkPeriod(employeeBonusMgt.getPayPeriod());
periodService.checkPeriod(employeeBonusMgt.getLeavePeriod());
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
Aggregations