Package no.ugland.utransprod.model

Examples of no.ugland.utransprod.model.OrderCost


      Collection<OrderCost> orgCosts) {
    ArrayList<OrderCost> list = null;
    if (orgCosts != null) {
      list = new ArrayList<OrderCost>();
      for (OrderCost orderCost : orgCosts) {
        list.add(new OrderCost(orderCost.getOrderCostId(), orderCost
            .getOrder(), orderCost.getCostType(), orderCost
            .getCostUnit(), orderCost.getCostAmount(), orderCost
            .getInclVat(), orderCost.getSupplier(), orderCost
            .getInvoiceNr(), orderCost.getDeviation(), orderCost
            .getTransportCostBasis(), orderCost.getPostShipment(),
View Full Code Here


   * @see no.ugland.utransprod.gui.model.AbstractModel#getBufferedObjectModel(com.jgoodies.binding.PresentationModel)
   */
  @Override
  public OrderCostModel getBufferedObjectModel(
      PresentationModel presentationModel) {
    OrderCostModel orderCostModel = new OrderCostModel(new OrderCost());
    orderCostModel.setOrderCostId((Integer) presentationModel
        .getBufferedValue(PROPERTY_ORDER_COST_ID));
    orderCostModel.setCostType((CostType) presentationModel
        .getBufferedValue(PROPERTY_COST_TYPE));
    orderCostModel.setCostUnit((CostUnit) presentationModel
View Full Code Here

    }

    public void setTrossCost(String trossCostString) {
      String oldCost = getTrossCost();
      if (trossOrderCost == null) {
        trossOrderCost = new OrderCost();

        trossOrderCost.setCostType(costTypeTross);
        trossOrderCost.setCostUnit(costUnitTross);

      }
View Full Code Here

  private void checkTransportableAndCalculateCost(final Supplier supplier,
      final Periode period, final TransportCostBasis transportCostBasis,
      final Transportable transportable) throws ProTransException {
    if (!transportable.hasTransportCostBasis()) {
      OrderCost orderCost = calculateTransportCostForTransportable(
          transportable, supplier, period);
      if (orderCost != null) {
        transportCostBasis.addOrderCost(orderCost);
      }
    }
View Full Code Here

  private OrderCost getOrderCost(final Transportable transportable,
      final BigDecimal basisCost,
      final Map<ITransportCostAddition, BigDecimal> additionalCost,
      final Supplier supplier, final String orderCostComment)
      throws ProTransException {
    OrderCost orderCost = null;
    StringBuilder costDetails = new StringBuilder();
    BigDecimal additionValue = BigDecimal.valueOf(0);

    if (additionalCost != null) {
      additionValue = generateCostDetailsAndGetAdditionValue(basisCost,
          additionalCost, costDetails, additionValue);
    }

    String comment = "";
    if (orderCostComment != null) {
      comment = orderCostComment;
    } else if (costDetails.length() > 0) {
      comment = costDetails.substring(0, costDetails.length() - 1);
    }

    if (transportable.getPostShipment() != null) {
      comment = "Etterlevering:" + comment;
    }

    BigDecimal cost = basisCost.add(additionValue);

    Order order = transportable.getOrder();
    orderCost = new OrderCost();
    orderCost.setComment(comment);

    orderCost.setCostAmount(cost);
    orderCost.setCostType(getCostType());
    orderCost.setCostUnit(getCostUnit());
    orderCost.setSupplier(supplier);
    orderCost.setPostShipment(transportable.getPostShipment());
    order.addOrderCost(orderCost);
    return orderCost;
  }
View Full Code Here

    assertNotNull(list);
    assertEquals(1, list.size());

    TransportCostBasis transportCostBasis = list.get(0);
    assertEquals(1, transportCostBasis.getOrderCosts().size());
    OrderCost orderCost = transportCostBasis.getOrderCosts().iterator()
        .next();
    assertNotNull(orderCost.getCostAmount());
    assertTrue(orderCost.getCostAmount().intValue() > 0);
  }
View Full Code Here

    assertEquals("" + YEAR + " " + WEEK_50 + "-" + WEEK_50,
        transportCostBasis.getPeriode());
    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));

  }
View Full Code Here

    assertEquals("" + YEAR + " " + WEEK_50 + "-" + WEEK_50,
        transportCostBasis.getPeriode());
    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));

  }
View Full Code Here

        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

        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

TOP

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

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.