Package no.ugland.utransprod.model

Examples of no.ugland.utransprod.model.TransportCost


    }
  }

  final void importTransportCost(final int row, final ExcelUtil excelUtil)
      throws ProTransException {
    TransportCost transportCost = new TransportCost();
    transportCost.setPostalCode(excelUtil.readCell(row,
        COLUMN_TRANSPORT_COST_POSTAL_CODE, "%1$04.0f"));
    transportCost.setPlace(excelUtil.readCell(row,
        COLUMN_TRANSPORT_COST_PLACE, null));
    String areaCode = excelUtil.readCell(row,
        COLUMN_TRANSPORT_COST_AREA_CODE, "%1$04.0f");

    Area area = areaManager.load(areaCode);
    if (area == null) {
      throw new ProTransException("Kommunenr " + areaCode
          + " finnes ikke!");
    }
    transportCost.setArea(area);

    transportCost.setValid(1);
    dao.saveObject(transportCost);

  }
View Full Code Here


  private OrderCost calculateTransportCostForTransportable(
      final Transportable transportable, final Supplier supplier,
      final Periode period) throws ProTransException {

    TransportCost transportCost = null;

    transportCost = findByPostalCode(transportable.getOrder()
        .getPostalCode());
    BigDecimal cost = BigDecimal.valueOf(0);
    String orderCostComment = null;
    if (transportCost == null) {
      orderCostComment = "Har ikke gyldig postnummer";
    } else if (transportable.getPostShipment() == null) {
      cost = transportCost.getCost();

    }
    Map<ITransportCostAddition, BigDecimal> additionalCost = null;
    if (transportCost != null) {
      additionalCost = transportCostAdditionManager
View Full Code Here

    order.setProductArea(productArea);
    transport.addOrder(order);
    List<Transport> transportList = Lists.newArrayList(transport);
    when(transportManager.findInPeriode(periode, productAreaGroupName))
        .thenReturn(transportList);
    TransportCost transportCost=new TransportCost();
    transportCost.setCost(BigDecimal.valueOf(1000));
    when(transportCostDAO.findByPostalCode("4841")).thenReturn(transportCost);

    List<TransportCostBasis> list = transportCostManager
        .generateTransportCostList(periode);
    assertNotNull(list);
View Full Code Here

  }

  @Test
  public void testUpdatePricesFromFile() throws Exception {
    updatePricesFromFile();
    TransportCost transportCost = transportCostManager
        .findByPostalCode("0139");
    assertEquals(BigDecimal.valueOf(1000), transportCost.getCost());
    assertEquals(Integer.valueOf(1), transportCost.getValid());
    assertEquals(BigDecimal.valueOf(15), transportCost.getAddition());
    transportCost = transportCostManager.findByPostalCode("0050");
    assertNull(transportCost);

  }
View Full Code Here

TOP

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

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.