Package no.ugland.utransprod.model

Examples of no.ugland.utransprod.model.OrderLine


        .lazyLoadArticle(
            constructionArticle,
            new LazyLoadConstructionTypeArticleEnum[] { LazyLoadConstructionTypeArticleEnum.CONSTRUCTION_TYPE_ARTICLES });
    Set<ConstructionTypeArticle> articleRefs = constructionArticle
        .getConstructionTypeArticles();
    OrderLine orderLine;
    Set<OrderLineAttribute> orderLineAttributes;
    Set<OrderLine> orderLineRefs = new LinkedHashSet<OrderLine>();
    if (articleRefs != null) {
      for (ConstructionTypeArticle articleRef : articleRefs) {
        orderLine = OrderLine.getInstance(order, articleRef,
            orderLineMain, articleRef.getNumberOfItems(),
            articleRef.getDialogOrder(), deviation);

        constructionTypeManager
            .lazyLoadArticle(
                articleRef,
                new LazyLoadConstructionTypeArticleEnum[] { LazyLoadConstructionTypeArticleEnum.ATTRIBUTES });
        Set<ConstructionTypeArticleAttribute> attributes = articleRef
            .getAttributes();

        if (attributes != null) {
          orderLineAttributes = new LinkedHashSet<OrderLineAttribute>();

          for (ConstructionTypeArticleAttribute attribute : attributes) {
            orderLineAttributes.add(new OrderLineAttribute(null,
                orderLine, attribute, null, null, attribute
                    .getAttributeValue(), attribute
                    .getDialogOrder(), attribute
                    .getAttributeName()));
          }

          orderLine.setOrderLineAttributes(orderLineAttributes);

          setOrderLineConstructionRefs(articleRef, orderLine, order,
              deviation);
        }
        orderLineRefs.add(orderLine);
        orderLine.setArticlePath(orderLine.getGeneratedArticlePath());
      }
      orderLineMain.setOrderLines(orderLineRefs);
    }
  }
View Full Code Here


  private Set<OrderLine> setOrderLineAndAttributes(
      Set<ConstructionTypeAttribute> attributes, Order orderLineOrder,
      Deviation deviation) {
    Set<OrderLine> orderLines = new LinkedHashSet<OrderLine>();
    Set<OrderLineAttribute> orderLineAttributes;
    OrderLine orderLineMain;
    orderLineMain = OrderLine.getInstance(orderLineOrder, 0, deviation);
    orderLineAttributes = new LinkedHashSet<OrderLineAttribute>();

    for (ConstructionTypeAttribute attribute : attributes) {
      orderLineAttributes.add(new OrderLineAttribute(null, orderLineMain,
          null, attribute, null, attribute.getAttributeValue(),
          attribute.getDialogOrder(), attribute.getAttributeName()));
    }
    orderLineMain.setOrderLineAttributes(orderLineAttributes);
    orderLines.add(orderLineMain);
    orderLineMain.setArticlePath(orderLineMain.getGeneratedArticlePath());
    return orderLines;
  }
View Full Code Here

    final ProductAreaManager productAreaManager = (ProductAreaManager) ModelUtil
        .getBean(ProductAreaManager.MANAGER_NAME);

    order = new Order();
    Set<OrderLine> orderLines = new HashSet<OrderLine>();
    OrderLine orderLine = new OrderLine();
    orderLine.setOrder(order);
    orderLine.setArticlePath("articlePath");
    orderLines.add(orderLine);
    order.setOrderLines(orderLines);
    order.setOrderNr("123456789");
    order.setDeliveryAddress("deliveryAddress");
    order.setPostalCode("1234");
View Full Code Here

        });
    }

    public Ordln findOrdlnByOrderLine(Integer orderLineId) {
        if (orderLineId != null) {
            OrderLine orderLine = getObject(orderLineId);
            if (orderLine != null && orderLine.getOrdNo() != null) {
                return ordlnDAO.findByOrdNoAndLnNo(orderLine.getOrdNo(), orderLine.getLnNo());
            }
        }
        return null;
    }
View Full Code Here

    when(managerRepository.getOrderManager()).thenReturn(orderManager);
    when(managerRepository.getColliManager()).thenReturn(colliManager);
    when(managerRepository.getOrderLineManager()).thenReturn(
        orderLineManager);
    ApplicationParamUtil.setApplicationParamManger(applicationParamManager);
    OrderLine orderLine = new OrderLine();
    ArticleType articleType = new ArticleType();
    articleType.setArticleTypeName("test");
    orderLine.setArticleType(articleType);
    final Order order = new Order();
    order.setOrderNr("1");
    orderLine.setOrder(order);
    final Colli colli = new Colli();
    colli.setColliName("test");
    orderLine.setColli(colli);
    when(orderLineManager.findByOrderLineId(anyInt()))
        .thenReturn(orderLine);
    final List<Applyable> packlist = new ArrayList<Applyable>();

    when(colliManager.findByNameAndOrder(anyString(), (Order) anyObject()))
View Full Code Here

        final TakstolPackageVManager takstolPackageVManager = mock(TakstolPackageVManager.class);
        final TakstolProductionVManager takstolProductionVManager = mock(TakstolProductionVManager.class);
        TakstolStatusChecker takstolStatusChecker = new TakstolStatusChecker(articleType,takstolPackageVManager, takstolProductionVManager);

        final List<OrderLine> orderLineList = new ArrayList<OrderLine>();
        OrderLine orderLine = new OrderLine();
        Order order = new Order();
        order.setOrderNr("1");
        order.addOrderLine(orderLine);
        orderLine.setOrder(order);
        orderLine.setArticlePath("Takstoler");
        orderLine.setOrderLineId(1);
        orderLineList.add(orderLine);

        String status = takstolStatusChecker.getArticleStatus(order);
        assertEquals("e0", status);
    }
View Full Code Here

      setGavlVinkelOgBredde(incomingOrder);
    }
  }

  private void setGavlVinkelOgBredde(Order incomingOrder) {
    OrderLine takstol = incomingOrder.getOrderLine(ARTICLE_TAKTOL);
    if (takstol != OrderLine.UNKNOWN) {
      OrderLine gavl = incomingOrder.getOrderLine(ARTICLE_GAVL);
      if (gavl != OrderLine.UNKNOWN) {
        String takstolVinkel = takstol
            .getAttributeValue(ATTRIBUTE_VINKEL);
        String takstolBredde = takstol
            .getAttributeValue(ATTRIBUTE_BREDDE);
        if (!StringUtils.isEmpty(takstolVinkel)) {
          gavl.setAttributeValue(ATTRIBUTE_VINKEL, takstolVinkel);
        }
        if (!StringUtils.isEmpty(takstolBredde)) {
          gavl.setAttributeValue(ATTRIBUTE_BREDDE, takstolBredde);
        }
      }
    }

  }
View Full Code Here

  }

  private void addOrderLine(final Order incomingOrder, Ordln ordln,
      ArticleTypeToOrderLineSelector selector,
      ManagerRepository managerRepository) {
    OrderLine orderLine = getOrderLine(ordln, incomingOrder, selector,
        managerRepository);
    if (orderLine != OrderLine.UNKNOWN) {
      incomingOrder.addOrderLine(orderLine);
    }
  }
View Full Code Here

    }

    public final BigDecimal calculateAddition(final BigDecimal basis,
            final Transportable transportable, final Periode period,
            final boolean ignoreSent) {
        OrderLine orderLine = transportable.getOrderLine(articlePath);
        BigDecimal addValue = BigDecimal.valueOf(0);
        if (orderLine != null) {
            Colli colli = orderLine.getColli();
            if (colli != null) {
                addValue = getAddValue(period, ignoreSent, orderLine, addValue,
                        colli, transportable);
            }
        }
View Full Code Here

    postShipmentManager.savePostShipment(postShipment);
    Colli colli;
    Iterator<OrderLine> it = orderLines.iterator();
    while (it.hasNext()) {
      OrderLine orderLine = it.next();
      orderLine.setPostShipment(postShipment);
      colli = orderLine.getColli();
      if (colli != null) {
        ColliManager colliManager = (ColliManager) ModelUtil
            .getBean("colliManager");
        colli.setPostShipment(postShipment);
        colli.setOrder(null);
View Full Code Here

TOP

Related Classes of no.ugland.utransprod.model.OrderLine

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.