Form AddOrderToReturnForm
- Unit name: Dialogs.AddOrderToReturn
- Form name: AddOrderToReturn
- Old form name: Form61. (unit61)
Synopsis
Form to select original order and articles.
Functionalities
- Edit to enter order number.
- On Enter key, execute search action.
- Button to execute search action.
- Combobox for return reason (view ReturnReason)
- Grid with select for article lines.
- Property to set order number. When set, edit is filled, and Search is executed.
- Button to execute OK action.
- Button to execute Cancel action.
Actions
Search
- Enabled when an order number is entered.
- When executed, show articles from view ReturnArticleCandidates in grid.
OK
- Enabled when an order number is entered, a return reason is entered, and one or more articles were selected.
- On execute, service call AddInvoiceToReturn is executed with source risOrder (see AddInvoiceToReturn)
Cancel
- Always enabled
- 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