public Order create(Order entity) { entity.setDate(new Date()); entity.setStatus(ORDER_STATUS_ACTIVE); if (entity.getSubscriber().getId() != 0) entity.getSubscriber().setInTrip(true); entity.getDriver().setInTrip(true); entity.setDeparturePoint(entity.getDeparturePoint().trim()); entity.setDestinationPoint(entity.getDestinationPoint().trim()); if (entity.getNotes() != null) { entity.setNotes(entity.getNotes().trim()); } else { entity.setNotes(null); } entity.setCash(entity.getTotal().subtract(entity.getBonus())); entity.setOperator(operatorService.getCurrentOperator()); return orderDao.create(entity); }