Package no.ugland.utransprod.util

Examples of no.ugland.utransprod.util.Periode


  public void testGenerateTransportCostListTwice() throws Exception {
    importAlPostalCodes();
    updatePricesFromFile();
    setUpOrder("0354");
    List<TransportCostBasis> list = transportCostManager
        .generateTransportCostList(new Periode(YEAR, WEEK_50, WEEK_50));
    assertNotNull(list);
    assertEquals(1, list.size());

    TransportCostBasis transportCostBasis = list.get(0);

    assertNotNull(transportCostBasis.getTransportCostBasisId());

    List<TransportCostBasis> transportCostBasisList = transportCostBasisManager
        .findById(transportCostBasis.getTransportCostBasisId());
    assertEquals(1, transportCostBasisList.size());

    allTransportCostBasis.addAll(list);

    transportCostBasis = transportCostBasisList.get(0);
    transportCostBasisManager.lazyLoad(transportCostBasis,
        new LazyLoadEnum[][] { { LazyLoadEnum.ORDER_COSTS,
            LazyLoadEnum.NONE } });
    Set<OrderCost> orderCosts = transportCostBasis.getOrderCosts();
    assertNotNull(orderCosts);
    assertEquals(1, orderCosts.size());
    OrderCost orderCost = orderCosts.iterator().next();
    assertEquals("Grunnpris:1000", orderCost.getComment());
    BigDecimal result = BigDecimal.valueOf(1000).setScale(2);
    assertEquals(result, orderCost.getCostAmount().setScale(2));

    list = transportCostManager.generateTransportCostList(new Periode(YEAR,
        WEEK_50, WEEK_50));
    assertEquals(0, list.size());

  }
View Full Code Here


    importAlPostalCodes();
    updatePricesFromFile();
    setUpOrder("0354");
    setStaaendeTak();
    List<TransportCostBasis> list = transportCostManager
        .generateTransportCostList(new Periode(YEAR, WEEK_50, WEEK_50));
    assertNotNull(list);
    assertEquals(1, list.size());

    TransportCostBasis transportCostBasis = list.get(0);

    assertNotNull(transportCostBasis.getTransportCostBasisId());

    List<TransportCostBasis> transportCostBasisList = transportCostBasisManager
        .findById(transportCostBasis.getTransportCostBasisId());
    assertEquals(1, transportCostBasisList.size());

    allTransportCostBasis.addAll(list);

    transportCostBasis = transportCostBasisList.get(0);
    transportCostBasisManager.lazyLoad(transportCostBasis,
        new LazyLoadEnum[][] { { LazyLoadEnum.ORDER_COSTS,
            LazyLoadEnum.NONE } });
    Set<OrderCost> orderCosts = transportCostBasis.getOrderCosts();
    assertNotNull(orderCosts);
    assertEquals(1, orderCosts.size());
    OrderCost orderCost = orderCosts.iterator().next();
    assertEquals("Grunnpris:1000,St�ende tak:1000.00", orderCost
        .getComment());
    BigDecimal result = BigDecimal.valueOf(2000).setScale(2);
    assertEquals(result, orderCost.getCostAmount().setScale(2));

    list = transportCostManager.generateTransportCostList(new Periode(YEAR,
        WEEK_50, WEEK_50));
    assertEquals(0, list.size());

  }
View Full Code Here

    importAlPostalCodes();
    updatePricesFromFile();
    setUpOrder("0354");
    setOrderLenghtWidth(860, 620);
    List<TransportCostBasis> list = transportCostManager
        .generateTransportCostList(new Periode(YEAR, WEEK_50, WEEK_50));
    assertNotNull(list);
    assertEquals(1, list.size());
    allTransportCostBasis.addAll(list);

    TransportCostBasis transportCostBasis = list.get(0);
View Full Code Here

    updatePricesFromFile();
    setUpOrder("0354");
    setOrderLenghtWidth(860, 620);
    setColliPackedAndSent("Takstein", "Takstein", null);
    List<TransportCostBasis> list = transportCostManager
        .generateTransportCostList(new Periode(YEAR, WEEK_50, WEEK_50));
    assertNotNull(list);
    assertEquals(1, list.size());
    allTransportCostBasis.addAll(list);

    TransportCostBasis transportCostBasis = list.get(0);
View Full Code Here

    importAlPostalCodes();
    updatePricesFromFile();
    setUpOrder("0354");
    setColliPackedAndSent("Takstein", "Takstein", null);
    List<TransportCostBasis> list = transportCostManager
        .generateTransportCostList(new Periode(YEAR, WEEK_50, WEEK_50));
    assertNotNull(list);
    assertEquals(1, list.size());
    allTransportCostBasis.addAll(list);

    TransportCostBasis transportCostBasis = list.get(0);
View Full Code Here

    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());
    allTransportCostBasis.addAll(list);

    TransportCostBasis transportCostBasis = list.get(0);
View Full Code Here

    updatePricesFromFile();
    setUpOrder("0354");
    setTakstolVinkel(31);
    setColliPackedAndSent("Takstol", "Takstoler", null);
    List<TransportCostBasis> list = transportCostManager
        .generateTransportCostList(new Periode(YEAR, WEEK_50, WEEK_50));
    assertNotNull(list);
    assertEquals(1, list.size());
    allTransportCostBasis.addAll(list);

    TransportCostBasis transportCostBasis = list.get(0);
View Full Code Here

    setUpOrder("0354");
    setTakstolVinkel(31);
    setColliPackedAndSent("Takstein", "Takstein", null);
    setColliPackedAndSent("Takstol", "Takstoler", null);
    List<TransportCostBasis> list = transportCostManager
        .generateTransportCostList(new Periode(YEAR, WEEK_50, WEEK_50));
    assertNotNull(list);
    assertEquals(1, list.size());
    allTransportCostBasis.addAll(list);

    TransportCostBasis transportCostBasis = list.get(0);
View Full Code Here

    setUpOrder("4841");
    setTakstolVinkel(31);
    setColliPackedAndSent("Takstein", "Takstein", null);
    setColliPackedAndSent("Takstol", "Takstoler", null);
    List<TransportCostBasis> list = transportCostManager
        .generateTransportCostList(new Periode(YEAR, WEEK_50, WEEK_50));
    assertNotNull(list);
    assertEquals(1, list.size());
    allTransportCostBasis.addAll(list);

    TransportCostBasis transportCostBasis = list.get(0);
View Full Code Here

    setTakstolVinkel(31);
    createPostShipment();
    setColliPackedAndSent("Takstein", "Takstein", null);
    setColliPackedAndSent("Takstol", "Takstoler", postShipment);
    List<TransportCostBasis> list = transportCostManager
        .generateTransportCostList(new Periode(YEAR, WEEK_50, WEEK_50));
    assertNotNull(list);
    assertEquals(1, list.size());
    allTransportCostBasis.addAll(list);

    TransportCostBasis transportCostBasis = list.get(0);

    assertNotNull(transportCostBasis.getTransportCostBasisId());

    list = transportCostBasisManager.findById(transportCostBasis
        .getTransportCostBasisId());
    assertEquals(1, list.size());

    transportCostBasis = list.get(0);
    transportCostBasisManager.lazyLoad(transportCostBasis,
        new LazyLoadEnum[][] { { LazyLoadEnum.ORDER_COSTS,
            LazyLoadEnum.NONE } });
    Set<OrderCost> orderCosts = transportCostBasis.getOrderCosts();
    assertNotNull(orderCosts);
    assertEquals(1, orderCosts.size());
    OrderCost orderCost = orderCosts.iterator().next();
    BigDecimal basis = BigDecimal.valueOf(1470);
    BigDecimal result;
    result = basis.add(BigDecimal.valueOf(660)).setScale(2);
    assertEquals("Grunnpris:1470,Takstein:660.00", orderCost.getComment());
    assertEquals(result, orderCost.getCostAmount().setScale(2));

    list = transportCostManager.generateTransportCostList(new Periode(YEAR,
        WEEK_51, WEEK_51));

    assertNotNull(list);
    assertEquals(1, list.size());
View Full Code Here

TOP

Related Classes of no.ugland.utransprod.util.Periode

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.