Package no.ugland.utransprod.model

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


     */
    @SuppressWarnings("unchecked")
    public boolean doDelete(WindowInterface window) {
      boolean deleted = true;
      if (selectedNode != null && !selectedNode.isLeaf() && enabled) {
        OrderLine orderLine = (OrderLine) selectedNode.getObject();
        if (orderLine.getArticleType() == null
            && orderLine.getConstructionTypeArticle() == null) {
          deleted = false;
          Util.showErrorDialog(window.getComponent(), "Feil",
              "Kan ikke slette garasjetype");
        } else {
          OrderWrapper<T, E> orderWrapper = (OrderWrapper<T, E>) ((OrderLineTreeNode) orderLineTreeTableModel
View Full Code Here


  }

  protected OrderLine getOrderLine(final ArticleType articleType,
      final Ordln ordln, final Order order) {
    OrderLine orderLine = new OrderLine();
    orderLine.setArticleType(articleType);
    orderLine.setOrdln(ordln);
    orderLine.setHasArticle(1);
    setNumberOfItems(ordln, orderLine);
    orderLine.setOrder(order);
    setOrderLineAttributes(articleType, orderLine);
    setAttributeHasValue(articleType, orderLine);
    setOrdnoAndLnno(ordln, orderLine);
    orderLine.setArticlePath(orderLine.getGeneratedArticlePath());
    setAttributes(orderLine, managerRepository.getOrdlnManager());
    return orderLine;
  }
View Full Code Here

  }

  protected OrderLine getOrderLine(ArticleType articleType, Ordln ordln,
      Order order) {
    OrderLine orderLine = super.getOrderLine(articleType, ordln, order);
    setSizeAttribute(orderLine, ordln);
    return orderLine;
  }
View Full Code Here

        : getOrderLineAndAddAttributes(articleType, ordln, order);
  }

  private OrderLine getOrderLineAndAddAttributes(ArticleType articleType,
      Ordln ordln, Order order) {
    OrderLine orderLine = super.getOrderLine(articleType, ordln, order);
    setTaksteintype(ordln, orderLine);
    setSendesFraGG(ordln, orderLine);
    return orderLine;
  }
View Full Code Here

      BufferedValueModel bufferedOrderLines = presentationModel
          .getBufferedModel(ICostableModel.PROPERTY_ORDER_LINE_ARRAY_LIST_MODEL);

      OrderLineAttribute attribute = (OrderLineAttribute) selectedNode
          .getObject();
      OrderLine orderLine = attribute.getOrderLine();
      orderLine.setHasArticle(null);
      orderLine.setAttributeInfo(null);
      orderLine.removeAllOrderLineAttributeInfo();
      orderLine.setIsDefault(null);

      String attributeValue;
      if (attribute.isYesNo()) {
        attributeValue = (String) JOptionPane.showInputDialog(window
            .getComponent(), "Gi ny verdi", "Endre verdi",
            JOptionPane.QUESTION_MESSAGE, null, new Object[] {
                "Ja", "Nei" }, attribute.getAttributeValue());
      } else if (attribute.getChoices() != null
          && attribute.getChoices().size() != 0) {
        attributeValue = (String) JOptionPane.showInputDialog(window
            .getComponent(), "Gi ny verdi", "Endre verdi",
            JOptionPane.QUESTION_MESSAGE, null, attribute
                .getChoices().toArray(), attribute
                .getAttributeValue());
      } else {

        attributeValue = JOptionPane.showInputDialog(window
            .getComponent(), "Gi ny verdi", attribute
            .getAttributeValue());
      }

      if (attributeValue != null && attributeValue.length() != 0) {
        if (!StringUtils.isEmpty(attribute.getAttributeDataType())
            && !AttributeDataType.valueOf(
                StringUtils.upperCase(attribute
                    .getAttributeDataType())).isValid(
                attributeValue)) {
          Util.showErrorDialog(window, "Feil datatype",
              "Attributt har feil datatype");

        } else {
          attribute.setAttributeValue(attributeValue);

          OrderWrapper<T, E> orderWrapper = (OrderWrapper<T, E>) ((OrderLineTreeNode) orderLineTreeTableModel
              .getRoot()).getObject();
          calculateAttributes(orderWrapper.getOrderLines());
          bufferedOrderLines.setValue(new ArrayListModel(orderWrapper
              .getOrderLines()));
        }
      }
    } else if (selectedNode != null) {
      BufferedValueModel bufferedOrderLines = presentationModel
          .getBufferedModel(ICostableModel.PROPERTY_ORDER_LINE_ARRAY_LIST_MODEL);

      OrderLine line = (OrderLine) selectedNode.getObject();

      String metric = line.getMetric();
      if (metric != null) {
        metric = "(" + metric + ")";
      } else {
        metric = "";
      }

      String numberOfValue = JOptionPane.showInputDialog(window
          .getComponent(), "Gi antall" + metric, line
          .getNumberOfItems());

      if (!ValidationUtils.isNumeric(numberOfValue)) {
        Util.showErrorDialog(window, "Feil", "Antall m� v�re et tall");
        return;
      }

      if (numberOfValue != null && numberOfValue.length() != 0) {
        line.setNumberOfItems(Integer.valueOf(numberOfValue.replace(
            ',', '.')));

        OrderWrapper orderWrapper = (OrderWrapper) ((OrderLineTreeNode) orderLineTreeTableModel
            .getRoot()).getObject();
        bufferedOrderLines.setValue(new ArrayListModel(orderWrapper
View Full Code Here

    }
    ArticleType newArticleType = getNewArticle(newArticles);
    Set<ArticleTypeAttribute> attributes = newArticleType
        .getArticleTypeAttributes();

    OrderLine orderLineMain = getNewOrderLineFromArticle(costable,
        newArticleType);

    if (attributes != null && attributes.size() != 0) {
      getAttributeValues(attributes, orderLineMain);
    } else {
      getNumberOfArticle(window, orderLineMain);
    }

    setOrderLineRefs(newArticleType, orderLineMain);

    orderLineMain.setArticlePath(orderLineMain.getGeneratedArticlePath());

    updateOrderLineTreeNode(orderLineMain);

  }
View Full Code Here

  }

  public OrderLine getNewOrderLineFromArticle(Articleable costable,
      ArticleType newArticleType) {
    OrderLine orderLineMain = OrderLine.getInstance(costable.getOrder(),
        newArticleType, costable.getDeviation(), costable
            .getPostShipment());
    costable.getOrder().setOrderComplete(null);
    return orderLineMain;
  }
View Full Code Here

        .lazyLoad(
            articleType,
            new LazyLoadArticleTypeEnum[] { LazyLoadArticleTypeEnum.ARTICLE_TYPE_ARTICLE_TYPE });
    Set<ArticleTypeArticleType> articleRefs = articleType
        .getArticleTypeArticleTypes();
    OrderLine orderLine;
    Set<OrderLineAttribute> orderLineAttributes;
    Set<OrderLine> orderLineRefs = new HashSet<OrderLine>();
    if (articleRefs != null) {
      for (ArticleTypeArticleType articleRef : articleRefs) {
        orderLine = OrderLine
            .getInstance(
                (Order) presentationModel
                    .getBufferedValue(ICostableModel.PROPERTY_ORDER),
                articleRef.getArticleTypeRef(),
                orderLineMain,
                (Deviation) presentationModel
                    .getBufferedValue(ICostableModel.PROPERTY_DEVIATION));

        ArticleType articleTypeRef = articleRef.getArticleTypeRef();
        articleTypeManager
            .lazyLoad(
                articleTypeRef,
                new LazyLoadArticleTypeEnum[] { LazyLoadArticleTypeEnum.ATTRIBUTE });
        Set<ArticleTypeAttribute> attributes = articleTypeRef
            .getArticleTypeAttributes();

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

          for (ArticleTypeAttribute attribute : attributes) {
            orderLineAttributes.add(new OrderLineAttribute(null,
                orderLine, null, null, attribute, null, null,
                attribute.getAttribute().getName()));
          }

          openAttributeView(orderLine, orderLineAttributes);

          orderLine.setOrderLineAttributes(orderLineAttributes);

          setOrderLineRefs(articleRef.getArticleTypeRef(), orderLine);
        }
        orderLineRefs.add(orderLine);
        orderLine.setArticlePath(orderLine.getGeneratedArticlePath());
      }
      orderLineMain.setOrderLines(orderLineRefs);
    }
  }
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) presentationModel
                    .getBufferedValue(ICostableModel.PROPERTY_ORDER),
                articleRef,
                orderLineMain,
                articleRef.getNumberOfItems(),
                articleRef.getDialogOrder(),
                (Deviation) presentationModel
                    .getBufferedValue(ICostableModel.PROPERTY_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);
        }
        orderLineRefs.add(orderLine);
        orderLine.setArticlePath(orderLine.getGeneratedArticlePath());
      }
      orderLineMain.setOrderLines(orderLineRefs);
    }
  }
View Full Code Here

    public final BigDecimal calculateAddition(final BigDecimal basis,
            final Transportable transportable, final Periode period,
            final boolean ignoreSent) {

        BigDecimal addValue = BigDecimal.valueOf(0);
        OrderLine orderLine = transportable.getOrderLine(articlePath);
        if (orderLine != null) {
            addValue = checkAndAddAddition(transportable, period, ignoreSent,
                    orderLine);
        }
        return addValue;
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.