Пример #1
0
 public void widgetSelected(SelectionEvent e) {
   String text = customerSearchText.getText();
   OrderID orderID = (OrderID) getArticleContainerEdit().getArticleContainerID();
   //			CustomerPaymentDeliveryWizard wiz = new CustomerPaymentDeliveryWizard(
   ReservationPaymentDeliveryWizard wiz =
       new ReservationPaymentDeliveryWizard(
           text,
           orderID,
           AbstractCombiTransferWizard.TRANSFER_MODE_BOTH,
           TransferWizard.Side.Vendor);
   //			DynamicPathWizardDialog dlg = new DynamicPathWizardDialog(wiz);
   DynamicPathWizardDialog dlg = new ReservationWizardDialog(wiz);
   int returnCode = dlg.open();
   boolean transferSuccessful = wiz.isTransfersSuccessful();
   if (logger.isDebugEnabled()) {
     logger.debug("ReservationWizardDialog OrderID = " + orderID); // $NON-NLS-1$
     logger.debug("ReservationWizardDialog returnCode = " + returnCode); // $NON-NLS-1$
     logger.debug(
         "ReservationWizardDialog.isTransfersSuccessful() = "
             + transferSuccessful); //$NON-NLS-1$
   }
   if (returnCode == Dialog.OK && transferSuccessful) {
     createNewOrder();
   }
 }
Пример #2
0
 protected boolean payAndDeliverAll() {
   CombiTransferArticleContainerWizard wizard =
       new CombiTransferArticleContainerWizard(
           getArticleContainerEdit().getArticleContainerID(),
           AbstractCombiTransferWizard.TRANSFER_MODE_BOTH);
   wizard.setErrorHandler(new QuickSaleErrorHandler());
   DynamicPathWizardDialog dialog = new DynamicPathWizardDialog(wizard);
   int returnCode = dialog.open();
   if (returnCode == Window.CANCEL) return false;
   return wizard.isTransfersSuccessful();
 }
Пример #3
0
  protected void solveAutomaticPressed() {
    okPressed();
    Set<ArticleID> articleIDs = new HashSet<ArticleID>();

    if (getPaymentDatas() != null
        && (transferWizard.getTransferMode() & TransferWizard.TRANSFER_MODE_PAYMENT) > 0) {
      // add all ArticleIDs from all invoices of all payments
      Set<PayableObjectID> payableObjectIDs = new HashSet<PayableObjectID>();
      for (PaymentData pd : getPaymentDatas()) {
        payableObjectIDs.addAll(pd.getPayment().getPayableObjectIDs());
      }
      Set<InvoiceID> invoiceIDs = CollectionUtil.castSet(payableObjectIDs);
      List<Invoice> invoices =
          InvoiceDAO.sharedInstance()
              .getInvoices(
                  invoiceIDs,
                  new String[] {FetchPlan.DEFAULT, Invoice.FETCH_GROUP_ARTICLES},
                  NLJDOHelper.MAX_FETCH_DEPTH_NO_LIMIT,
                  new NullProgressMonitor());
      for (Invoice invoice : invoices) {
        Collection<? extends ArticleID> tmpArticleIDSet =
            NLJDOHelper.getObjectIDSet(invoice.getArticles());
        articleIDs.addAll(tmpArticleIDSet);
      }
    }
    if (getDeliveryDatas() != null
        && (transferWizard.getTransferMode() & TransferWizard.TRANSFER_MODE_DELIVERY) > 0) {
      // add all ArticleIDs from all deliveryNotes of all deliveries
      for (DeliveryData dd : getDeliveryDatas()) {
        articleIDs.addAll(dd.getDelivery().getArticleIDs());
      }
    }

    CombiTransferArticlesWizard wizard =
        new CombiTransferArticlesWizard(articleIDs, transferWizard.getTransferMode());
    wizard.setErrorHandler(new QuickSaleErrorHandler());
    DynamicPathWizardDialog dialog = new DynamicPathWizardDialog(wizard);
    dialog.open();
    this.transfersSuccessful = wizard.isTransfersSuccessful();
  }