Search in sources :

Example 1 with TimetableTemplate

use of com.axelor.apps.supplychain.db.TimetableTemplate in project axelor-open-suite by axelor.

the class TimetableController method applyTemplate.

public void applyTemplate(ActionRequest request, ActionResponse response) {
    Context context = request.getContext();
    try {
        if (context.get("timetableTemplate") == null || context.get("exTaxTotal") == null || context.get("computationDate") == null) {
            return;
        }
        TimetableTemplate template = (TimetableTemplate) context.get("timetableTemplate");
        List<Timetable> timetableList = timetableService.applyTemplate(template, (BigDecimal) context.get("exTaxTotal"), (LocalDate) context.get("computationDate"));
        response.setValue("timetableList", timetableList);
    } catch (Exception e) {
        TraceBackService.trace(response, e);
    }
}
Also used : Context(com.axelor.rpc.Context) Timetable(com.axelor.apps.supplychain.db.Timetable) TimetableTemplate(com.axelor.apps.supplychain.db.TimetableTemplate) AxelorException(com.axelor.exception.AxelorException)

Aggregations

Timetable (com.axelor.apps.supplychain.db.Timetable)1 TimetableTemplate (com.axelor.apps.supplychain.db.TimetableTemplate)1 AxelorException (com.axelor.exception.AxelorException)1 Context (com.axelor.rpc.Context)1