Search in sources :

Example 1 with PeriodService

use of com.axelor.apps.base.service.PeriodService 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);
    }
}
Also used : EmployeeBonusMgt(com.axelor.apps.hr.db.EmployeeBonusMgt) EmployeeBonusService(com.axelor.apps.hr.service.EmployeeBonusService) PeriodService(com.axelor.apps.base.service.PeriodService) AxelorException(com.axelor.exception.AxelorException)

Aggregations

PeriodService (com.axelor.apps.base.service.PeriodService)1 EmployeeBonusMgt (com.axelor.apps.hr.db.EmployeeBonusMgt)1 EmployeeBonusService (com.axelor.apps.hr.service.EmployeeBonusService)1 AxelorException (com.axelor.exception.AxelorException)1