Package no.ugland.utransprod.model

Examples of no.ugland.utransprod.model.OrderLine$OrderLineNumberComparator


  }

  public void setProductionUnitForOrderLine(ProductionUnit productionUnit,
      Produceable produceable) {
    if (productionUnit != null && produceable != null) {
      OrderLine orderLine = managerRepository.getOrderLineManager()
          .findByOrderLineId(produceable.getOrderLineId());
      if (orderLine != null) {
        orderLine.setProductionUnit(productionUnit);
        refreshAndSaveOrder(orderLine);
        produceable.setProductionUnitName(productionUnit
            .getProductionUnitName());
        // applyListManager.refresh(produceable);
View Full Code Here


  public void testGenerateTransportCostListWithTaksteinNotSentFromGG()
      throws Exception {
    importAlPostalCodes();
    updatePricesFromFile();
    setUpOrder("0354");
    OrderLine orderLine = setColliPackedAndSent("Takstein", "Takstein",
        null);
    orderLine.setOrderLineAttributeValue("Sendes fra GG", "Nei");
    orderManager.saveOrder(order);
    List<TransportCostBasis> list = transportCostManager
        .generateTransportCostList(new Periode(YEAR, WEEK_50, WEEK_50));
    assertNotNull(list);
    assertEquals(1, list.size());
View Full Code Here

    postShipment2.setTransport(transportPostShipment2);
    postShipmentManager.savePostShipment(postShipment2);
  }

  private void setTakstolVinkel(Integer vinkel) throws ProTransException {
    OrderLine orderLine = order.getOrderLine("Takstoler");
    OrderLineAttribute attribute = orderLine.getAttributeByName("Vinkel");
    attribute.setAttributeValue(String.valueOf(vinkel));
    orderManager.saveOrder(order);
  }
View Full Code Here

    attribute.setAttributeValue(String.valueOf(vinkel));
    orderManager.saveOrder(order);
  }

  private void setStaaendeTak() throws ProTransException {
    OrderLine orderLine = order.getOrderLine("Takstoler");
    OrderLineAttribute attribute = orderLine
        .getAttributeByName("St�ende tak");
    attribute.setAttributeValue("Ja");
    orderManager.saveOrder(order);
  }
View Full Code Here

      String orderLineArticlePath, PostShipment postShipment)
      throws ProTransException {
    Colli colli = new Colli();
    colli.setColliName(colliName);

    OrderLine orderLine = order.getOrderLine(orderLineArticlePath);
    colli.addOrderLine(orderLine);

    if (postShipment != null) {
      postShipment.addOrderLine(orderLine);
      postShipment.addColli(colli);
View Full Code Here

    Set<ConstructionTypeAttribute> attributes = order.getConstructionType()
        .getConstructionTypeAttributes();

    Set<OrderLine> orderLines = new LinkedHashSet<OrderLine>();
    Set<OrderLineAttribute> orderLineAttributes;
    OrderLine orderLineMain;
    orderLineMain = OrderLine.getInstance(order, 0, null);
    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());

    Set<ConstructionTypeArticle> articles = order.getConstructionType()
        .getConstructionTypeArticles();

    if (articles != null && articles.size() != 0) {
      Set<ConstructionTypeArticleAttribute> articleAttributes;
      if (articles.size() != 0) {
        for (ConstructionTypeArticle article : articles) {
          orderLineMain = OrderLine.getInstance(order, article,
              article.getNumberOfItems(), article
                  .getDialogOrder(), null,
              article.getOrdNo(), article.getLnNo());

          constructionTypeManager
              .lazyLoadArticle(
                  article,
                  new LazyLoadConstructionTypeArticleEnum[] { LazyLoadConstructionTypeArticleEnum.ATTRIBUTES });

          articleAttributes = article.getAttributes();

          if (articleAttributes != null
              && articleAttributes.size() != 0) {
            orderLineAttributes = new LinkedHashSet<OrderLineAttribute>();
            for (ConstructionTypeArticleAttribute articleAttribute : articleAttributes) {
              orderLineAttributes.add(new OrderLineAttribute(
                  null, orderLineMain, articleAttribute,
                  null, null, articleAttribute
                      .getAttributeValue(),
                  articleAttribute.getDialogOrder(),
                  articleAttribute.getAttributeName()));
            }
            orderLineMain
                .setOrderLineAttributes(orderLineAttributes);
            orderLineMain.setArticlePath(orderLineMain
                .getGeneratedArticlePath());
          }
          setOrderLineConstructionRefs(article, orderLineMain, order);
          orderLines.add(orderLineMain);
          orderLineMain.setArticlePath(orderLineMain
              .getGeneratedArticlePath());
        }
      }

    }
View Full Code Here

        .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(), null);

        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);
        }
        orderLineRefs.add(orderLine);
        orderLine.setArticlePath(orderLine.getGeneratedArticlePath());
      }
      orderLineMain.setOrderLines(orderLineRefs);
    }
  }
View Full Code Here

    List<OrderLine> notConstructionOrderLines = Lists.newArrayList();
    Set<String> usedOrderLineNames = Sets.newHashSet();

    if (vismaOrderLines != null) {
      for (OrderLine orderLine : vismaOrderLines) {
        OrderLine line = getOrderLine(orderLine, orderLines,
            usedOrderLineNames);
        if (line == null) {
          notConstructionOrderLines.add(orderLine);
        }else{
          usedOrderLineNames.add(orderLine.getArticleName());
View Full Code Here

      Set<OrderLine> orderLines, Collection<OrderLine> vismaOrderLines) {
    Set<String> usedOrderLineNames = Sets.newHashSet();

    if (vismaOrderLines != null) {
      for (OrderLine orderLine : vismaOrderLines) {
        OrderLine line = getOrderLine(orderLine, orderLines,
            usedOrderLineNames);
        if (line != null) {
          Set<OrderLine> orderLineRefList=updateOrderLinesFromVisma(line.getOrderLines(), orderLine.getOrderLines());
          line.setOrderLines(orderLineRefList);
          line.setOrdln(orderLine.getOrdln());
          line.setNumberOfItems(orderLine.getNumberOfItems());
          line.setAttributeValuesFromOrderLine(Util.getSet(orderLine
              .getOrderLineAttributes()));
          line.setOrdNo(orderLine.getOrdNo());
          line.setLnNo(orderLine.getLnNo());
          usedOrderLineNames.add(line.getArticleName());
        }
      }
    }
    return orderLines;
  }
View Full Code Here

  private void createAndAddOrderLine(final Set<OrderLine> orderLines,
      final ConstructionTypeManager constructionTypeManager,
      final ConstructionTypeArticle article, final Order order,
      final Deviation deviation) {
    OrderLine orderLineMain;
    orderLineMain = OrderLine.getInstance(order, article, article
        .getNumberOfItems(), article.getDialogOrder(), deviation,
        article.getOrdNo(), article.getLnNo());

    if (!Hibernate.isInitialized(article.getAttributes())) {
      constructionTypeManager
          .lazyLoadArticle(
              article,
              new LazyLoadConstructionTypeArticleEnum[] { LazyLoadConstructionTypeArticleEnum.ATTRIBUTES });
    }

    createAndAddAttributes(article, orderLineMain);
    setOrderLineConstructionRefs(article, orderLineMain, order, deviation);
    if (orderLines != null) {
      orderLines.add(orderLineMain);
    }
    orderLineMain.setArticlePath(orderLineMain.getGeneratedArticlePath());
  }
View Full Code Here

TOP

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

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.