use of org.olat.resource.accesscontrol.model.OrderLineImpl in project openolat by klemens.
the class ACOrderDAO method saveOneClick.
public Order saveOneClick(Identity delivery, OfferAccess link, OrderStatus status) {
OrderImpl order = createOrder(delivery);
order.setOrderStatus(status);
if (link.getOffer().getPrice().isEmpty()) {
order.setCurrencyCode("CHF");
} else {
order.setCurrencyCode(link.getOffer().getPrice().getCurrencyCode());
}
OrderPartImpl part = new OrderPartImpl();
part.setCreationDate(new Date());
order.getParts().add(part);
OrderLineImpl line = createOrderLine(link.getOffer());
part.getOrderLines().add(line);
order.recalculate();
dbInstance.getCurrentEntityManager().persist(order);
dbInstance.getCurrentEntityManager().persist(part);
dbInstance.getCurrentEntityManager().persist(line);
return order;
}
Aggregations