use of com.axelor.apps.hr.db.TimesheetLine in project axelor-open-suite by axelor.
the class TimesheetLineBusinessController method setDefaultToInvoice.
public void setDefaultToInvoice(ActionRequest request, ActionResponse response) {
try {
TimesheetLine timesheetLine = request.getContext().asType(TimesheetLine.class);
timesheetLine = Beans.get(TimesheetLineBusinessService.class).getDefaultToInvoice(timesheetLine);
response.setValue("toInvoice", timesheetLine.getToInvoice());
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
use of com.axelor.apps.hr.db.TimesheetLine in project axelor-open-suite by axelor.
the class TimesheetLineController method updateToInvoice.
/**
* Invert value of 'toInvoice' field and save the record
*
* @param request
* @param response
*/
@Transactional
public void updateToInvoice(ActionRequest request, ActionResponse response) {
try {
TimesheetLine timesheetLine = request.getContext().asType(TimesheetLine.class);
timesheetLine = Beans.get(TimesheetLineRepository.class).find(timesheetLine.getId());
timesheetLine.setToInvoice(!timesheetLine.getToInvoice());
Beans.get(TimesheetLineRepository.class).save(timesheetLine);
response.setValue("toInvoice", timesheetLine.getToInvoice());
} catch (Exception e) {
TraceBackService.trace(response, e);
}
}
Aggregations