Package no.ugland.utransprod.model

Examples of no.ugland.utransprod.model.PostShipment


    }

  }

  private void showDeviation(WindowInterface aWindow) {
    PostShipment postShipment = (PostShipment) postShipmentSelectionList
        .getElementAt(tablePostShipment
            .convertRowIndexToModel(postShipmentSelectionList
                .getSelectionIndex()));
    // PostShipment postShipment = (PostShipment)
    // postShipmentSelectionList.getSelection();

    DeviationViewHandler deviationViewHandler = deviationViewHandlerFactory
        .create(null, true, false, true, null, true);
    deviationViewHandler
        .showDeviation(postShipment.getDeviation(), aWindow);
  }
View Full Code Here


    /**
     * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
     */
    public void actionPerformed(ActionEvent arg0) {
      try {
        PostShipment postShipment = (PostShipment) postShipmentSelectionList
            .getElementAt(tablePostShipment
                .convertRowIndexToModel(postShipmentSelectionList
                    .getSelectionIndex()));
        if (postShipment != null) {
          if (Util.showConfirmDialog(window.getComponent(),
              "Slette?", "Vil du virkelig slette ettersending?")) {
            managerRepository.getPostShipmentManager().lazyLoad(
                postShipment,
                new LazyLoadPostShipmentEnum[] {
                    LazyLoadPostShipmentEnum.ORDER_LINES,
                    LazyLoadPostShipmentEnum.COLLIES });
            Set<OrderLine> orderLines = postShipment
                .getOrderLines();

            if (orderLines != null) {
              for (OrderLine orderLine : orderLines) {
                if (orderLine.getOrder().getSent() != null) {
                  if (!Util
                      .showConfirmDialog(
                          window.getComponent(),
                          "Slette?",
                          "Ordre som ordrelinjer h�rer til har blitt sendt, vil du allikevel slette ettersending?")) {
                    return;
                  }
                }
                orderLine.setPostShipment(null);
                managerRepository.getOrderLineManager()
                    .saveOrderLine(orderLine);
              }
            }
            Set<Colli> collies = postShipment.getCollies();
            if (collies != null) {
              ColliManager colliManager = (ColliManager) ModelUtil
                  .getBean("colliManager");
              for (Colli colli : collies) {
                colli.setPostShipment(null);
                colli.setOrder(postShipment.getOrder());
                colliManager.saveColli(colli);
                /*
                 * colliManager .lazyLoadColli( colli, new
                 * LazyLoadColliEnum[]
                 * {LazyLoadColliEnum.ORDER_LINES});
                 */
                // orderLines = colli.getOrderLines();
                /*
                 * for (OrderLine orderLine : orderLines) {
                 * orderLine.setColli(null);
                 * orderLineManager.saveOrderLine(orderLine); }
                 * colliManager.removeObject(colli);
                 */
              }
            }
            Deviation deviation = postShipment.getDeviation();
            Order order = postShipment.getOrder();

            if (deviation != null) {
              if (Util
                  .showConfirmDialog(
                      window.getComponent(),
View Full Code Here

    /**
     * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
     */
    public void actionPerformed(ActionEvent arg0) {

      PostShipment postShipment = (PostShipment) postShipmentSelectionList
          .getElementAt(tablePostShipment
              .convertRowIndexToModel(postShipmentSelectionList
                  .getSelectionIndex()));

      showContentForPostShipment(postShipment, window);
View Full Code Here

    /**
     * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
     */
    public void actionPerformed(ActionEvent arg0) {
      PostShipment postShipment = (PostShipment) postShipmentSelectionList
          .getElementAt(tablePostShipment
              .convertRowIndexToModel(postShipmentSelectionList
                  .getSelectionIndex()));
      CommentViewHandler commentViewHandler = new CommentViewHandler(
          login, managerRepository.getOrderManager());
      OrderComment newOrderComment = commentViewHandler
          .showAndEditOrderComment(window, null, "orderManager");

      if (newOrderComment != null) {
        Order order = postShipment.getOrder();

        if (!Hibernate.isInitialized(order.getOrderComments())) {
          orderViewHandler
              .lazyLoadOrder(
                  order,
                  new LazyLoadOrderEnum[] { LazyLoadOrderEnum.COMMENTS });
        }
        order.addOrderComment(newOrderComment);
        order.cacheComments();
        newOrderComment.setDeviation(postShipment.getDeviation());
        try {
          orderViewHandler.getOrderManager().saveOrder(order);

        } catch (ProTransException e) {
          Util.showErrorDialog(window, "Feil", e.getMessage());
          e.printStackTrace();
        }
        postShipment.cacheComments();
        PostShipmentManager postShipmentManager = (PostShipmentManager) ModelUtil
            .getBean("postShipmentManager");
        postShipmentManager.savePostShipment(postShipment);
      }

View Full Code Here

    /**
     * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
     */
    public void actionPerformed(ActionEvent arg0) {
      if (postShipmentSelectionList.getSelectionIndex() >= 0) {
        PostShipment postShipment = (PostShipment) postShipmentSelectionList
            .getElementAt(tablePostShipment
                .convertRowIndexToModel(postShipmentSelectionList
                    .getSelectionIndex()));

        Util.runInThreadWheel(window.getRootPane(),
View Full Code Here

        .getBean("supplierManager");
    Supplier supplier = supplierManager.findByName("T.O.Bull AS");
    transportPostShipment.setSupplier(supplier);

    transportManager.saveTransport(transportPostShipment);
    postShipment = new PostShipment();
    postShipment.setSent(Util.SHORT_DATE_FORMAT.parse("2008.12.15"));
    postShipment.setOrder(order);
    postShipment.setTransport(transportPostShipment);
    postShipmentManager.savePostShipment(postShipment);
  }
View Full Code Here

        .getBean("supplierManager");
    Supplier supplier = supplierManager.findByName("T.O.Bull AS");
    transportPostShipment2.setSupplier(supplier);

    transportManager.saveTransport(transportPostShipment2);
    postShipment2 = new PostShipment();
    postShipment2.setSent(Util.SHORT_DATE_FORMAT.parse("2008.12.22"));
    postShipment2.setOrder(order);
    postShipment2.setTransport(transportPostShipment2);
    postShipmentManager.savePostShipment(postShipment2);
  }
View Full Code Here

        dialogFixture.robot, commentDialog);
    commentDialogFixture.textBox("TextAreaComment").enterText("test");
    commentDialogFixture.button("ButtonCommentOk").click();
    deviationDialog.button("ButtonOk").click();
    //
    PostShipment postShipment = null;
    boolean postShipmentNotFound = true;
    int currentRowPostShipment = 0;
    while (postShipmentNotFound) {
      postShipment = ((PostShipmentTableModel) dialogFixture
          .table("TablePostShipments").target.getModel())
          .getPostShipment(currentRowPostShipment);
      if (postShipment != null
          && postShipment
              .getOrder()
              .getOrderNr()
              .equalsIgnoreCase(
                  transportable.getOrder().getOrderNr())) {
        postShipmentNotFound = false;
View Full Code Here

  @Test
  @Ignore
  public void testAddCommentToPostShipment() {

    PostShipment postShipment = ((PostShipmentTableModel) dialogFixture
        .table("TablePostShipments").target.getModel())
        .getPostShipment(0);

    assertNotNull(postShipment);
    String postShipmentComment = postShipment.getComment();
    postShipmentComment = postShipmentComment != null ? postShipmentComment
        : "";

    dialogFixture.table("TablePostShipments").cell(row(0).column(1))
        .select();
    dialogFixture.table("TablePostShipments").cell(row(0).column(1))
        .rightClick();
    JPopupMenuFixture popupMenuFixture = new JPopupMenuFixture(
        dialogFixture.robot, (JPopupMenu) dialogFixture.robot.finder()
            .findByName("PopupMenuPostShipment"));
    popupMenuFixture.menuItem("MenuItemAddComment").click();

    DialogFixture dialogComment = WindowFinder
        .findDialog("EditCommentView").using(dialogFixture.robot);
    dialogComment.textBox("TextAreaComment").enterText("test");
    dialogComment.checkBox("CheckBoxTransport").check();
    dialogComment.checkBox("CheckBoxPackage").check();
    dialogComment.button("ButtonCommentOk").click();

    postShipment = ((PostShipmentTableModel) dialogFixture
        .table("TablePostShipments").target.getModel())
        .getPostShipment(0);

    assertEquals(postShipmentComment + "test;", postShipment.getComment());
  }
View Full Code Here

   * @param transportlistable
   */
  @SuppressWarnings("unchecked")
  private void registerDeviation(ArrayListModel orderLines,
      TransportListable transportlistable) {
    PostShipment postShipment = new PostShipment();
    PostShipmentManager postShipmentManager = (PostShipmentManager) ModelUtil
        .getBean("postShipmentManager");

    DeviationViewHandler deviationViewHandler = deviationViewHandlerFactory.create(transportlistable.getOrder(), false,
        false, false, null, true);

    Deviation deviation = new Deviation();

    DeviationModel deviationModel = new DeviationModel(deviation, true);

    deviationModel.setOrderLines(orderLines);
    deviationModel.setPostShipment(postShipment);
    deviationModel.setOrder(transportlistable.getOrder());

    EditDeviationView editDeviationView = new EditDeviationView(false,
        deviationModel, deviationViewHandler, true, true);

    JDialog dialog = new JDialog(ProTransMain.PRO_TRANS_MAIN, "Avvik", true);
    dialog.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
    WindowInterface window = new JDialogAdapter(dialog);

    window.add(editDeviationView.buildPanel(window), BorderLayout.CENTER);

    window.pack();
    Util.locateOnScreenCenter(window);
    window.setVisible(true);

    postShipment = deviation.getPostShipment();

    // postShipment.setDeviation(deviation);
    postShipment.setOrder(transportlistable.getOrder());
    postShipment.cacheComments();

    if (transportlistable instanceof PostShipment) {
      postShipment.setPostShipmentRef((PostShipment) transportlistable);
    }

    postShipmentManager.savePostShipment(postShipment);
    Colli colli;
    Iterator<OrderLine> it = orderLines.iterator();
View Full Code Here

TOP

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

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.