Ga naar inhoud

Form AddOrderToReturnForm

  • Unit name: Dialogs.AddOrderToReturn
  • Form name: AddOrderToReturn
  • Old form name: Form61. (unit61)

Synopsis

Form to select original order and articles.

Functionalities

  1. Edit to enter order number.
  2. On Enter key, execute search action.
  3. Button to execute search action.
  4. Combobox for return reason (view ReturnReason)
  5. Grid with select for article lines.
  6. Property to set order number. When set, edit is filled, and Search is executed.
  7. Button to execute OK action.
  8. Button to execute Cancel action.

Actions

  1. Enabled when an order number is entered.
  2. When executed, show articles from view ReturnArticleCandidates in grid.

OK

  1. Enabled when an order number is entered, a return reason is entered, and one or more articles were selected.
  2. On execute, service call AddInvoiceToReturn is executed with source risOrder (see AddInvoiceToReturn)

Cancel

  1. Always enabled
  2. When executed, closes the form with modal result mrCancel.

Tables/Views

ReturnArticleCandidates

SELECT
  A.ID A.ARTCODE, sum(A.QTY) AS QTY, B.ExpiryDate, B.LotNo
FROM
  OUTDETAILS A
  INNER JOIN INVDETAILS B ON
    (A.INVOICENO=B.ID)
    AND (A.ARTCODE=B.ARTCODE)
WHERE
  A.AVIZNO =:OrderID
GROUP BY
  A.ARTCODE, B.ExpiryDate, B.LotNo
ORDER BY ARTCODE asc