use of org.olat.resource.accesscontrol.model.OrderLineImpl 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.OrderLineImpl in project OpenOLAT by OpenOLAT.
the class ACOrderDAO method addOrderLine.
public OrderLine addOrderLine(OrderPart part, Offer offer) {
OrderLineImpl line = createOrderLine(offer);
dbInstance.getCurrentEntityManager().persist(line);
part.getOrderLines().add(line);
return line;
}
use of org.olat.resource.accesscontrol.model.OrderLineImpl in project OpenOLAT by OpenOLAT.
the class ACOrderDAO method createOrderLine.
private OrderLineImpl createOrderLine(Offer offer) {
OrderLineImpl line = new OrderLineImpl();
line.setCreationDate(new Date());
line.setOffer(offer);
line.setUnitPrice(offer.getPrice().clone());
line.setTotal(line.getUnitPrice().clone());
return line;
}
use of org.olat.resource.accesscontrol.model.OrderLineImpl in project openolat by klemens.
the class ACOrderDAO method addOrderLine.
public OrderLine addOrderLine(OrderPart part, Offer offer) {
OrderLineImpl line = createOrderLine(offer);
dbInstance.getCurrentEntityManager().persist(line);
part.getOrderLines().add(line);
return line;
}
use of org.olat.resource.accesscontrol.model.OrderLineImpl in project openolat by klemens.
the class ACOrderDAO method createOrderLine.
private OrderLineImpl createOrderLine(Offer offer) {
OrderLineImpl line = new OrderLineImpl();
line.setCreationDate(new Date());
line.setOffer(offer);
line.setUnitPrice(offer.getPrice().clone());
line.setTotal(line.getUnitPrice().clone());
return line;
}
Aggregations