Package no.ugland.utransprod.model

Examples of no.ugland.utransprod.model.Order


    }
  }

  private void setOrderReady(Produceable object) throws ProTransException {
    if (object.getProductAreaGroupName().equalsIgnoreCase("Takstol")) {
      Order order = managerRepository.getOrderManager().findByOrderNr(
          object.getOrderNr());
      if (isAllProduced(object)) {
        order.setOrderReady(Util.getCurrentDate());
      } else {
        order.setOrderReady(null);
      }
      managerRepository.getOrderManager().saveOrder(order);
    }
  }
View Full Code Here


            .getSelectionIndex());
    if (index != -1) {
      Transportable transportable = (Transportable) transportableSelectionList
          .getElementAt(index);
      if (transportable instanceof Order) {
        Order order = (Order) transportable;

        orderViewHandler
            .lazyLoadOrder(order, new LazyLoadOrderEnum[] {
                LazyLoadOrderEnum.POST_SHIPMENTS,
                LazyLoadOrderEnum.COMMENTS,
                LazyLoadOrderEnum.COLLIES });
      } else {
        PostShipment postShipment = (PostShipment) transportable;

        postShipmentManager.lazyLoad(postShipment,
            new LazyLoadPostShipmentEnum[] {
                LazyLoadPostShipmentEnum.POST_SHIPMENT_REFS,
                LazyLoadPostShipmentEnum.ORDER_COMMENTS,
                LazyLoadPostShipmentEnum.COLLIES });
      }
      if (transportable.getPostShipments() != null
          && transportable.getPostShipments().size() != 0) {
        Util.showErrorDialog(window1, "Ordre har etterleveringer",
            "Kan ikke fjerne ordre som har etterleveringer.");
        return;
      }
      transportable.setSentBool(false);
      transportable.setTransport(null);

      if (transportable instanceof Order) {
        Order order = (Order) transportable;

        orderViewHandler.lazyLoadOrder(order, new LazyLoadOrderEnum[] {
            LazyLoadOrderEnum.COLLIES,
            LazyLoadOrderEnum.ORDER_LINES,
            LazyLoadOrderEnum.ORDER_COSTS });
        Set<Colli> collies = order.getCollies();
        removeSentFromCollies(collies);

        Set<OrderLine> orderLines = order.getOrderLines();
        if (orderLines != null) {
          PostShipment postShipment;
          for (OrderLine orderLine : orderLines) {
            postShipment = orderLine.getPostShipment();
            Deviation deviation;
            if (postShipment != null) {
              orderLine.setPostShipment(null);
              deviation = postShipment.getDeviation();
              postShipment.setOrder(null);

              postShipmentManager
                  .removePostShipment(postShipment);

              if (deviation != null) {
                managerRepository.getDeviationManager()
                    .removeObject(deviation);
              }
            }
          }
        }

        orderViewHandler.refreshOrder(order);
        order.setSentBool(false);
        order.setTransport(null);
        try {
          vismaFileCreator.createVismaFileForTransport(order);

          orderViewHandler.getOrderManager().saveOrder(order);
        } catch (ProTransException e) {
View Full Code Here

          int index = tableOrders
              .convertRowIndexToModel(transportableSelectionList
                  .getSelectionIndex());
          Transportable transportable = (Transportable) transportableSelectionList
              .getElementAt(index);
          Order order;
          if (transportable instanceof Order) {
            order = (Order) transportable;
          } else {
            order = ((PostShipment) transportable).getOrder();
          }
View Full Code Here

     */
    public void actionPerformed(ActionEvent actionEvent) {
      Util.setWaitCursor(window);
      if (actionEvent.getActionCommand().equalsIgnoreCase(
          menuItemDeviation.getText())) {
        Order order = (Order) transportableSelectionList
            .getElementAt(tableOrders
                .convertRowIndexToModel(transportableSelectionList
                    .getSelectionIndex()));
        DeviationViewHandler deviationViewHandler = deviationViewHandlerFactory
            .create(order, true, false, true, null, true);
View Full Code Here

   */
  @Override
  protected void setApplied(FaktureringV faktureringV, boolean applied,
      WindowInterface window) {
    if (faktureringVExists(faktureringV, window)) {
      Order order = managerRepository.getOrderManager().findByOrderNr(
          faktureringV.getOrderNr());
      if (applied) {
        Date invoiceDate = Util.getDate(window);
        order.setInvoiceDate(invoiceDate);
      } else {
        order.setInvoiceDate(null);
      }
      try {
        managerRepository.getOrderManager().saveOrder(order);
      } catch (ProTransException e) {
        Util.showErrorDialog(window, "Feil", e.getMessage());
View Full Code Here

  /**
   * @see no.ugland.utransprod.gui.handlers.AbstractViewHandler#getNewObject()
   */
  @Override
  public Order getNewObject() {
    return new Order();
  }
View Full Code Here

  }

  public boolean saveObjectExt(AbstractModel<Order, OrderModel> objectModel,
      WindowInterface window) {
    OrderModel object = (OrderModel) objectModel;
    Order order = object.getObject();
    int index = objectList.indexOf(order);

    handleCustomer(object, order);

    try {
View Full Code Here

  public CheckObject checkSaveObject(OrderModel object,
      PresentationModel presentationModel1, WindowInterface window) {
    String errorString = null;
    Customer customer = null;

    Order order = object.getObject();
    if (order.getOrderId() == null && objectList.contains(order)) {
      errorString = "Kan ikke lagre ordre med et ordrenummer som finnes fra f�r";
    }

    if (object.getCustomer() == null) {
      CustomerManager customerManager = (CustomerManager) ModelUtil
View Full Code Here

   * @param presentationModel1
   * @param window
   */
  public void checkAddresses(PresentationModel presentationModel1,
      WindowInterface window) {
    Order order = ((OrderModel) presentationModel1.getBean()).getObject();

    if (order.getOfferAddresses() != null) {
      OfferAddress offerAddress = (OfferAddress) JOptionPane
          .showInputDialog(window.getComponent(),
              "Ordre har flere adresser", "Velg adresse",
              JOptionPane.INFORMATION_MESSAGE, null, order
                  .getOfferAddresses().toArray(), null);

      if (offerAddress != null) {
        order.setDeliveryAddress(offerAddress.getAddress1());
        order.setPostalCode(offerAddress.getZipcode());
        order.setPostOffice(offerAddress.getCity());
      }
    }
  }
View Full Code Here

   * @param presentationModel
   * @return panel
   */
  public JPanel getDeviationPane(WindowInterface window,
      PresentationModel presentationModel) {
    Order order = ((OrderModel) presentationModel.getBean()).getObject();
    DeviationViewHandler deviationViewHandler = deviationViewHandlerFactory
        .create(order, true, true, false, null, false);

    deviationOverviewView = deviationOverviewViewFactory.create(
        deviationViewHandler, false, order, true, true, false, null,
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.