Package no.ugland.utransprod.model

Examples of no.ugland.utransprod.model.OrderCost


        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(1000);
    // BigDecimal result;
    // result = basis.add(BigDecimal.valueOf(660)).setScale(2);
    assertEquals("Grunnpris:1000", orderCost.getComment());
    assertEquals(basis.setScale(2), orderCost.getCostAmount().setScale(2));

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

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

    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 } });
    orderCosts = transportCostBasis.getOrderCosts();
    assertNotNull(orderCosts);
    assertEquals(1, orderCosts.size());
    orderCost = orderCosts.iterator().next();

    assertEquals(BigDecimal.valueOf(0).setScale(2), orderCost
        .getCostAmount().setScale(2));
    assertEquals("Etterlevering:", orderCost.getComment());

  }
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();
    BigDecimal basis = BigDecimal.valueOf(1000);
    // BigDecimal result;
    // result = basis.add(BigDecimal.valueOf(660)).setScale(2);
    assertEquals("Grunnpris:1000", orderCost.getComment());
    assertEquals(basis.setScale(2), orderCost.getCostAmount().setScale(2));

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

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

    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 } });
    orderCosts = transportCostBasis.getOrderCosts();
    assertNotNull(orderCosts);
    assertEquals(1, orderCosts.size());
    orderCost = orderCosts.iterator().next();

    assertEquals(BigDecimal.valueOf(1320).setScale(2), 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();

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

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

    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 } });
    orderCosts = transportCostBasis.getOrderCosts();
    assertNotNull(orderCosts);
    assertEquals(1, orderCosts.size());
    orderCost = orderCosts.iterator().next();
    assertEquals("Etterlevering:Takstein:660.00", orderCost.getComment());
    assertEquals(BigDecimal.valueOf(660).setScale(2), orderCost
        .getCostAmount().setScale(2));

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

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

    allTransportCostBasis.addAll(list);

    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 } });
    orderCosts = transportCostBasis.getOrderCosts();
    assertNotNull(orderCosts);
    assertEquals(1, orderCosts.size());
    orderCost = orderCosts.iterator().next();

    assertEquals(BigDecimal.valueOf(0).setScale(2), 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();

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

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

    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 } });
    orderCosts = transportCostBasis.getOrderCosts();
    assertNotNull(orderCosts);
    assertEquals(1, orderCosts.size());
    orderCost = orderCosts.iterator().next();
    assertEquals("Etterlevering:Takstein:660.00", orderCost.getComment());
    assertEquals(BigDecimal.valueOf(660).setScale(2), orderCost
        .getCostAmount().setScale(2));

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

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

    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 } });
    orderCosts = transportCostBasis.getOrderCosts();
    assertNotNull(orderCosts);
    assertEquals(1, orderCosts.size());
    orderCost = orderCosts.iterator().next();
    assertEquals("Etterlevering:Takstol:660.00", orderCost.getComment());
    assertEquals(BigDecimal.valueOf(660).setScale(2), orderCost
        .getCostAmount().setScale(2));
  }
View Full Code Here

    if (aOrderCost != null) {
      presentationModel = new PresentationModel(new OrderCostModel(
          aOrderCost));
    } else {
      presentationModel = new PresentationModel(new OrderCostModel(
          new OrderCost()));
    }
  }
View Full Code Here

      final CostTypeManager costTypeManager, final BigDecimal costAmount,
      final Order order, final CostUnitManager costUnitManager,
      final String costUnitName) {
    CostType costType = costTypeManager.findByName(costTypeName);
    CostUnit costUnit = costUnitManager.findByName(costUnitName);
    OrderCost orderCost = order.getOrderCost(costTypeName, costUnitName);
    orderCost = orderCost != null ? orderCost : new OrderCost();
    orderCost.setCostAmount(costAmount);
    orderCost.setCostType(costType);
    orderCost.setCostUnit(costUnit);
    orderCost.setOrder(order);
    return orderCost;
  }
View Full Code Here

      final TransportCostBasis transportCostBasis) {
    overviewManager.lazyLoad(transportCostBasis, new LazyLoadEnum[][] { {
        LazyLoadEnum.ORDER_COSTS, LazyLoadEnum.NONE } });
    if (transportCostBasis.getOrderCosts() != null
        && transportCostBasis.getOrderCosts().size() > 0) {
      OrderCost orderCost = transportCostBasis.getOrderCosts().iterator()
          .next();
      if (orderCost.getInvoiceNr() != null
          && orderCost.getInvoiceNr().length() != 0) {
        return new CheckObject(
            "Kan ikke slette grunnlag som har satt fakturanummer",
            false);
      }
    }
View Full Code Here

  @SuppressWarnings("unchecked")
  private BigDecimal getTotalCost(ArrayListModel orderCosts) {
    BigDecimal totalCost = BigDecimal.valueOf(0);
    Iterator<OrderCost> it = orderCosts.iterator();
    while (it.hasNext()) {
      OrderCost orderCost = it.next();
      totalCost = totalCost.add(orderCost.getCostAmount());
    }
    return totalCost;
  }
View Full Code Here

     * @param rowIndex
     * @param columnIndex
     * @return verdi
     */
    public Object getValueAt(int rowIndex, int columnIndex) {
      OrderCost orderCost = (OrderCost) getRow(rowIndex);
      switch (columnIndex) {
      case 0:
        return orderCost.getOrder().getOrderNr();
      case 1:
        return orderCost.getOrder().getCustomer();
      case 2:
        return orderCost.getOrder().getPostalCode();
      case 3:
        return orderCost.getOrder().getPostOffice();
      case 4:
        return orderCost.getOrder().getConstructionTypeString();
      case 5:
        return orderCost.getCostAmount();
      case 6:
        return orderCost.getComment();
      case 7:
        return orderCost.getTransport();
      case 8:
        return orderCost.getOrder().getTransport().getEmployee();
      default:
        throw new IllegalStateException("Unknown column");
      }

    }
View Full Code Here

      final 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

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.