Package no.ugland.utransprod.model

Examples of no.ugland.utransprod.model.Order


  @Test
  public void importGulvspon() {
    List<Order> orders = incomingOrderManager.findByOrderNr("11");
    assertEquals(1, orders.size());

    Order order = orders.get(0);

    incomingOrderManager.setOrderLines(order, managerRepository);
    Set<OrderLine> orderLines = order.getOrderLines();
    assertNotNull(orderLines);
    OrderLine gulvspon = order.getOrderLine("Gulvspon");
    assertNotNull(gulvspon);
  }
View Full Code Here


  @Test
  public void importGarageType() {
    List<Order> orders = incomingOrderManager.findByOrderNr("11");
    assertEquals(1, orders.size());

    Order order = orders.get(0);
    incomingOrderManager.setOrderLines(order, managerRepository);

    assertEquals("A1", order.getConstructionTypeString());
  }
View Full Code Here

    String productAreaGroupName = "Garasje";
    Transport transport = new Transport();
    transport.setSent(new Date());
    Supplier supplier = new Supplier();
    transport.setSupplier(supplier);
    Order order = new Order();
    order.setSent(new Date());
    order.setPostalCode("4841");
    ProductArea productArea = new ProductArea();
    ProductAreaGroup productAreaGroup = new ProductAreaGroup();
    productAreaGroup.setProductAreaGroupName(productAreaGroupName);
    productArea.setProductAreaGroup(productAreaGroup);
    order.setProductArea(productArea);
    transport.addOrder(order);
    List<Transport> transportList = Lists.newArrayList(transport);
    when(transportManager.findInPeriode(periode, productAreaGroupName))
        .thenReturn(transportList);
    TransportCost transportCost=new TransportCost();
View Full Code Here

    String orderNr="1";
    ImportOrderV importOrderV = new ImportOrderV();
    Integer userdefId=1;
    importOrderV.setUserdefId(userdefId);
    when(importOrderVDAO.findByNumber1(orderNr)).thenReturn(importOrderV);
    Order incomingOrder=new Order();
    incomingOrder.setOrderNr("1");
    Ordln ordln=new Ordln();
    Prod prod=new Prod();
    prod.setProdNo("MONTERING VILLA");
    ordln.setProd(prod);
    List<Ordln> ordlnList=Lists.newArrayList(ordln);
    when(ordlnManager.findCostLines(incomingOrder.getOrderNr())).thenReturn(ordlnList);
   
    Udsalesmall udsalessmall=new Udsalesmall();
    when(udsalesmallDao.getObject(userdefId)).thenReturn(udsalessmall);
    incomingOrderManager.setUdsalesmallDAO(udsalesmallDao);
   
   
   
    incomingOrder.setOrderNr(orderNr);
    incomingOrderManager.setCosts(incomingOrder);
   
    assertEquals(true, incomingOrder.doAssembly());
  }
View Full Code Here

    ((IncomingOrderManagerImpl)incomingOrderManager).setOrdlnManager(ordlnManager);
    ((IncomingOrderManagerImpl)incomingOrderManager).setOrdlnDAO(ordlnDAO);
    ((IncomingOrderManagerImpl)incomingOrderManager).setConstructionTypeManager(constructionTypeManager);
    ((IncomingOrderManagerImpl)incomingOrderManager).setArticleTypeDAO(articleTypeDAO);
   
    final Order incomingOrder=new Order();
    incomingOrder.setOrderNr("1");
    ProductArea productArea=new ProductArea();
    ProductAreaGroup productAreaGroup=new ProductAreaGroup();
    productAreaGroup.setProductAreaGroupName("Garasje");
    productArea.setProductAreaGroup(productAreaGroup);
    incomingOrder.setProductArea(productArea);
   
    final List<Ordln> ordlnList=new ArrayList<Ordln>();
    Ordln ordln = new Ordln();
    ordln.setOrdlnPK(new OrdlnPK(1,1));
    Prod prod = new Prod();
    prod.setProdNo("TAKSTEIN");
    prod.setPrCatNo(1020410);
    prod.setPrCatNo2(9);
    ordln.setProd(prod);
    ordlnList.add(ordln);
   
    final Ord ord = new Ord();
    final ArticleType articleTypeTakstein=new ArticleType();
    articleTypeTakstein.setArticleTypeName("Takstein");
   
    final Collection<OrderLine> originalOrderLines =new HashSet<OrderLine>();
    OrderLine orderLineTakstol=new OrderLine();
    orderLineTakstol.setArticleName("Takstein");
    orderLineTakstol.setArticleType(articleTypeTakstein);
    originalOrderLines.add(orderLineTakstol);
   
   
    final  ManagerRepository managerRepository=mock(ManagerRepository.class);
   
    when(ordlnManager.findOrdByOrderNr("1")).thenReturn(ord);
    when(ordlnDAO.findByOrderNr("1")).thenReturn(ordlnList);
    when(articleTypeDAO.findByProdCatNoAndProdCatNo2(1020410, 9)).thenReturn(articleTypeTakstein);
   
   
    incomingOrderManager.setOrderLines(incomingOrder,managerRepository);
   
    OrderLine orderLine = incomingOrder.getOrderLine(ARTICLE_PATH_TAKSTEIN);
    assertNotNull(orderLine);
    assertFalse(orderLine==OrderLine.UNKNOWN);
  }
View Full Code Here

    ConstructionTypeAttributesConverter garasjeConverter = new GarasjeConverter(ordlnManager);
    ProductAreaGroup productAreaGroup=new ProductAreaGroup();
    productAreaGroup.setProductAreaGroupName("Garasje");
    ProductArea productArea = new ProductArea();
    productArea.setProductAreaGroup(productAreaGroup);
    Order order = new Order();
    order.setProductArea(productArea);
   
    Ord ord = new Ord();
    ord.setOrdno(111);
    ord.setInf("A3");
    ord.setFree1("150");
    ord.setFree2("20");
   
   
   
    OrderLine orderLine = new OrderLine();
    orderLine.setArticlePath("Garasjetype");
   
    ConstructionTypeArticleAttribute constructionTypeArticleAttribute=new ConstructionTypeArticleAttribute();
    ArticleTypeAttribute articleTypeAttribute=new ArticleTypeAttribute();
    Attribute attribute=new Attribute();
    attribute.setName("Veggh�yde");
    articleTypeAttribute.setAttribute(attribute);
   
    constructionTypeArticleAttribute.setArticleTypeAttribute(articleTypeAttribute);
   
    OrderLineAttribute orderLineAttribute = new OrderLineAttribute();
    orderLineAttribute.setConstructionTypeArticleAttribute(constructionTypeArticleAttribute);
    orderLine.addAttribute(orderLineAttribute);
   
    constructionTypeArticleAttribute=new ConstructionTypeArticleAttribute();
    articleTypeAttribute=new ArticleTypeAttribute();
    attribute=new Attribute();
    attribute.setName("Murh�yde");
    articleTypeAttribute.setAttribute(attribute);
   
    orderLineAttribute = new OrderLineAttribute();
    orderLineAttribute.setConstructionTypeArticleAttribute(constructionTypeArticleAttribute);
    orderLine.addAttribute(orderLineAttribute);
   
    constructionTypeArticleAttribute.setArticleTypeAttribute(articleTypeAttribute);
   
    constructionTypeArticleAttribute=new ConstructionTypeArticleAttribute();
    articleTypeAttribute=new ArticleTypeAttribute();
    attribute=new Attribute();
    attribute.setName("Bredde");
    articleTypeAttribute.setAttribute(attribute);
   
    orderLineAttribute = new OrderLineAttribute();
    orderLineAttribute.setConstructionTypeArticleAttribute(constructionTypeArticleAttribute);
    orderLine.addAttribute(orderLineAttribute);
   
    constructionTypeArticleAttribute.setArticleTypeAttribute(articleTypeAttribute);
   
    constructionTypeArticleAttribute=new ConstructionTypeArticleAttribute();
    articleTypeAttribute=new ArticleTypeAttribute();
    attribute=new Attribute();
    attribute.setName("Lengde");
    articleTypeAttribute.setAttribute(attribute);
   
    orderLineAttribute = new OrderLineAttribute();
    orderLineAttribute.setConstructionTypeArticleAttribute(constructionTypeArticleAttribute);
    orderLine.addAttribute(orderLineAttribute);
   
    constructionTypeArticleAttribute.setArticleTypeAttribute(articleTypeAttribute);
   
    order.addOrderLine(orderLine);
   
    final Ordln ordln=new Ordln();
    ordln.setWdtu(BigDecimal.valueOf(400));
    ordln.setLgtU(BigDecimal.valueOf(800));
   
    when(ordlnManager.findByOrdnoAndPrCatNo2(111, 1)).thenReturn(ordln);
   
   
   
   
    garasjeConverter.setConstructionTypeAttributes(ord, order);
    assertNotNull(order);
    OrderLine garageOrderLine = order.getOrderLine("Garasjetype");
    assertNotNull(garageOrderLine);
    assertEquals(true, garageOrderLine!=OrderLine.UNKNOWN);
    OrderLineAttribute testOrderLineAttribute=garageOrderLine.getAttributeByName("Veggh�yde");
    assertNotNull(testOrderLineAttribute);
    assertEquals(true, testOrderLineAttribute!=OrderLineAttribute.UNKNOWN);
View Full Code Here

    }
  }

  @Test
  public void skalHenteFerdigKapping() {
    Order order = orderManager.findByOrderNr("65386");
    orderManager.lazyLoadTree(order);
    orderLine = order.getOrderLine("Takstoler");
    assertNotNull(orderLine);
    orderLine.setCuttingDone(Util.getCurrentDate());

    orderLineManager.saveOrderLine(orderLine);
    TakstolProductionVManager takstolProductionVManager = (TakstolProductionVManager) ModelUtil
View Full Code Here

  }

  @Test
  public void skalHentStartetKapping() {

    Order order = orderManager.findByOrderNr("65386");
    orderManager.lazyLoadTree(order);
    orderLine = order.getOrderLine("Takstoler");
    assertNotNull(orderLine);
    orderLine.setCuttingStarted(Util.getCurrentDate());

    orderLineManager.saveOrderLine(orderLine);
    TakstolProductionVManager takstolProductionVManager = (TakstolProductionVManager) ModelUtil
View Full Code Here

    }

  }

  private void importOrderLines() throws ProTransException {
    Order incomingOrder = ((OrderModel) presentationModel.getBean())
        .getObject();
    removeOrderLines(incomingOrder);
    managerRepository.getIncomingOrderManager().setOrderLines(
        incomingOrder, managerRepository);
    incomingOrder.setProbability(PROBABILITY_100);
    if (incomingOrder.getProductAreaGroup().getProductAreaGroupName()
        .equalsIgnoreCase("Takstol")) {
      incomingOrder.setPacklistReady(Util.getCurrentDate());
    }

    Udsalesmall udsalesmall = managerRepository.getUdsalesmallManager()
        .findByOrderNr(incomingOrder.getOrderNr());
    managerRepository.getIncomingOrderManager().setCustomerCost(
        incomingOrder, udsalesmall);

    presentationModel.setBufferedValue(OrderModel.PROPERTY_PACKLIST_READY,
        Util.getCurrentDate());
    if (incomingOrder.getOrderLines() != null) {
      resetOrderLineTreeNode(new ArrayList<OrderLine>(incomingOrder
          .getOrderLines()));
    }
    setOrderMaxTrossHeight(incomingOrder);
    presentationModel.setBufferedValue(
        OrderModel.PROPERTY_MAX_TROSS_HEIGHT, incomingOrder
            .getMaxTrossHeight() != null ? String
            .valueOf(incomingOrder.getMaxTrossHeight()) : null);
    fireCostChange(incomingOrder);
    updateArticleButtons();

  }
View Full Code Here

        assertEquals("aDelPcBelongsTo", aLine.getDelPcBelongsTo());
    }

    private CuttingManager insertCutting(final String proId,final Boolean overwrite) throws Exception {
        OrderManager orderManager=(OrderManager)ModelUtil.getBean(OrderManager.MANAGER_NAME);
        Order order =  orderManager.findByOrderNr("49838");
        Cutting cutting = new Cutting();
        cutting.setProId(proId);
        cutting.setVersion("110");
        cutting.setProSign("JW");
        cutting.setOrder(order);
View Full Code Here

TOP

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

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.