Package no.ugland.utransprod.model

Examples of no.ugland.utransprod.model.Colli


    String useColliName = useDefaultColli ? getColliName(articleName)
        : null;
    List<Colli> collies = packable.getColliList();
    Collections.sort(collies, garasjepakkeFoerst());

    Colli useColli = getColliToUse(useColliName, collies, window);

    if (useColli != null) {
      addArticleToColliAndSendFileToVisma(orderLine, useColli, window);
    }
  }
View Full Code Here


    return orderLine.getOrdln() != null;
  }

  private Colli getColliToUse(String useColliName, List<Colli> collies,
      WindowInterface window) {
    Colli useColli = null;
    if (useColliName != null) {
      useColli = getColliFromColliName(useColliName, collies);
    } else {
      Colli defaultColli = getDefaultColli(collies);
      useColli = (Colli) Util.showOptionsDialogCombo(window, collies,
          "Velg kolli", true, defaultColli);
    }
    return useColli;
  }
View Full Code Here

    }
    return useColli;
  }

  private Colli getDefaultColli(List<Colli> collies) {
    Colli defaultColli = collies != null && collies.size() > 0 ? collies
        .get(0) : null;
    return defaultColli;
  }
View Full Code Here

        .get(0) : null;
    return defaultColli;
  }

  private Colli getColliFromColliName(String useColliName, List<Colli> collies) {
    Colli useColli = null;
    for (Colli colli : collies) {
      if (colli.getColliName().equalsIgnoreCase(useColliName)) {
        useColli = colli;
        break;
      }
View Full Code Here

  @SuppressWarnings("unchecked")
  public void doNew(WindowInterface window) {
    // AbstractOrderModel abstractOrderModel = (AbstractOrderModel)
    // presentationModelPackable.getBean();

    Colli newColli = new Colli(null, packable.getOrder(),// abstractOrderModel.getOrderModelOrder(),
        null, null, null, null,
        // abstractOrderModel.getOrderModelPostShipment(),
        packable.getPostShipment(), null, null);
    ColliViewHandler colliViewHandler = new ColliViewHandler("Kolli",
        newColli,
View Full Code Here

      if (!defaultColliesGenerated()) {
        packable.setDefaultColliesGenerated(1);
        overviewManager.saveObject(packable);
        List<Colli> collies = packable.getColliList();
        List<OrderLine> orderLines = packable.getOrderLineList();
        Colli tmpColli;

        tmpColli = new Colli(null,
            packable.getOrder(), null, null, null, null,
            packable.getPostShipment(), null, null);
        if (collies == null) {
          collies = new ArrayList<Colli>();

        }
        // sjekk om kollier Takstol,Gavl,Gulvspon,Garasjepakke er med
        // for
        // ordre,
        // sjekk mot artikler

        Set<String> colliNames = colliSetup.keySet();
        if (colliNames != null) {
          for (String colliName : colliNames) {
            tmpColli.setColliName(colliName);
            if (!collies.contains(tmpColli)) {
              if(!Hibernate.isInitialized(packable.getCollies())){
                initializePackable(packable);
              }
              if (shouldHaveColli(orderLines, colliSetup
                  .get(colliName),
                  packable.getTransportable())) {
                Colli newColli = new Colli(null, tmpColli
                    .getOrder(), tmpColli.getColliName(),
                    null, null, null, tmpColli
                        .getPostShipment(), null, null);
                packable.addColli(newColli);
View Full Code Here

      if (selectedColliViewHandlers.size() != 1) {
        Util.showErrorDialog(window, "Feil",
            "Det kan bare velges en kolli for editering");
      } else {
        Colli colli = selectedColliViewHandlers.keySet().iterator()
            .next();
        ColliViewHandler handler = selectedColliViewHandlers
            .remove(colli);
        handler.openEditView(colli, false, window);
        handler.setColliSelected(false);
View Full Code Here

  /**
   * @see no.ugland.utransprod.gui.model.AbstractModel#getBufferedObjectModel(com.jgoodies.binding.PresentationModel)
   */
  @Override
  public ColliModel getBufferedObjectModel(PresentationModel presentationModel) {
    ColliModel colliModel = new ColliModel(new Colli());
    colliModel.setColliName((String) presentationModel
        .getBufferedValue(PROPERTY_COLLI_NAME));
    return colliModel;
  }
View Full Code Here

    private OrderLine setObjectApplied(
            final OrderLineManager orderLineManager, final OrderLine orderLine, final String aColliName)
            throws ProTransException {
        ColliManager colliManager = (ColliManager) ModelUtil.getBean("colliManager");
        Colli colli;
        String currentColliName = aColliName != null ? aColliName : colliName;
        if (orderLine.getPostShipment() != null) {
            colli = colliManager.findByNameAndPostShipment(currentColliName, orderLine.getPostShipment());
        } else {
            colli = colliManager.findByNameAndOrder(currentColliName, orderLine.getOrder());
        }
        if (colli == null) {
            if (orderLine.getPostShipment() != null) {
                colli = new Colli(null, null, currentColliName, null, null, null,
                        orderLine.getPostShipment(), null, Util.getCurrentDate());
            } else {
                colli = new Colli(null, orderLine.getOrder(), currentColliName, null, null, null, null, null,
                        Util.getCurrentDate());
            }
        } else {
            if(!Hibernate.isInitialized(colli.getOrderLines())){
            colliManager.lazyLoad(colli,
                    new LazyLoadEnum[][] { { LazyLoadEnum.ORDER_LINES, LazyLoadEnum.NONE } });
            }
        }
        colli.addOrderLine(orderLine);
        colli.setPackageDate(Util.getCurrentDate());
        colliManager.saveColli(colli);

        orderLine.setColli(colli);

        orderLineManager.saveOrderLine(orderLine);
View Full Code Here

    String currentColliName = aColliName != null ? aColliName : colliName;
    ColliManager colliManager = (ColliManager) ModelUtil
        .getBean("colliManager");
    OrderLineManager orderLineManager = (OrderLineManager) ModelUtil
        .getBean("orderLineManager");
    Colli colli;
    if (orderLine.getPostShipment() != null) {
      colli = colliManager.findByNameAndPostShipment(currentColliName,
          orderLine.getPostShipment());
    } else {
      colli = colliManager.findByNameAndOrder(currentColliName, orderLine
          .getOrder());
    }
    if (colli == null) {
      if (orderLine.getPostShipment() != null) {
        colli = new Colli(null, null, currentColliName, null, null,
            null, orderLine.getPostShipment(), null, Util
                .getCurrentDate());
      } else {
        colli = new Colli(null, orderLine.getOrder(), currentColliName,
            null, null, null, null, null, Util.getCurrentDate());
      }
    } else {
      colliManager.lazyLoad(colli, new LazyLoadEnum[][] { {
          LazyLoadEnum.ORDER_LINES, LazyLoadEnum.NONE } });
    }
    colli.addOrderLine(orderLine);
    colliManager.saveColli(colli);

    orderLine.setColli(colli);

    orderLineManager.saveOrderLine(orderLine);
View Full Code Here

TOP

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

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.