use of org.olat.resource.accesscontrol.model.OrderImpl in project OpenOLAT by OpenOLAT.
the class ACOrderDAO method createOrder.
public OrderImpl createOrder(Identity delivery) {
OrderImpl order = new OrderImpl();
Date now = new Date();
order.setLastModified(now);
order.setCreationDate(now);
order.setDelivery(delivery);
order.setOrderStatus(OrderStatus.NEW);
dbInstance.getCurrentEntityManager().persist(order);
return order;
}
use of org.olat.resource.accesscontrol.model.OrderImpl in project OpenOLAT by OpenOLAT.
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;
}
use of org.olat.resource.accesscontrol.model.OrderImpl in project openolat by klemens.
the class ACOrderDAO method createOrder.
public OrderImpl createOrder(Identity delivery) {
OrderImpl order = new OrderImpl();
Date now = new Date();
order.setLastModified(now);
order.setCreationDate(now);
order.setDelivery(delivery);
order.setOrderStatus(OrderStatus.NEW);
dbInstance.getCurrentEntityManager().persist(order);
return order;
}
use of org.olat.resource.accesscontrol.model.OrderImpl 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