Search in sources :

Example 1 with OperationOrderTimesheetService

use of com.axelor.apps.businessproduction.service.OperationOrderTimesheetService in project axelor-open-suite by axelor.

the class TimesheetController method updateOperationOrders.

/**
 * Called from timesheet form view, on save. <br>
 * Call {@link OperationOrderTimesheetService#updateAllRealDuration(List)}.
 *
 * @param request
 * @param response
 */
public void updateOperationOrders(ActionRequest request, ActionResponse response) {
    try {
        Timesheet timesheet = request.getContext().asType(Timesheet.class);
        Beans.get(OperationOrderTimesheetService.class).updateOperationOrders(timesheet);
    } catch (Exception e) {
        TraceBackService.trace(response, e);
    }
}
Also used : OperationOrderTimesheetService(com.axelor.apps.businessproduction.service.OperationOrderTimesheetService) Timesheet(com.axelor.apps.hr.db.Timesheet)

Example 2 with OperationOrderTimesheetService

use of com.axelor.apps.businessproduction.service.OperationOrderTimesheetService in project axelor-open-suite by axelor.

the class TimesheetLineController method updateOperationOrder.

/**
 * Called from timesheet line form view, on save. <br>
 * Call {@link OperationOrderTimesheetService#updateOperationOrders(Timesheet)}.
 *
 * @param request
 * @param response
 */
public void updateOperationOrder(ActionRequest request, ActionResponse response) {
    try {
        TimesheetLine timesheetLine = request.getContext().asType(TimesheetLine.class);
        Timesheet timesheet = timesheetLine.getTimesheet();
        if (timesheet == null && request.getContext().getParent() != null) {
            timesheet = request.getContext().getParent().asType(Timesheet.class);
        }
        if (timesheet != null) {
            Beans.get(OperationOrderTimesheetService.class).updateOperationOrders(timesheet);
        }
    } catch (Exception e) {
        TraceBackService.trace(response, e);
    }
}
Also used : OperationOrderTimesheetService(com.axelor.apps.businessproduction.service.OperationOrderTimesheetService) TimesheetLine(com.axelor.apps.hr.db.TimesheetLine) Timesheet(com.axelor.apps.hr.db.Timesheet)

Aggregations

OperationOrderTimesheetService (com.axelor.apps.businessproduction.service.OperationOrderTimesheetService)2 Timesheet (com.axelor.apps.hr.db.Timesheet)2 TimesheetLine (com.axelor.apps.hr.db.TimesheetLine)1