Form Returns
- Unit name: Forms.Returns
- Form name: ReturnsForm
- Old form name: Unit125 (Form125)
Synopsis
Form to process returns (returned goods)
Functionalities
This form displays the following information
- Grid with List of returns (X days) Shows result of ReturnInvoicesInPeriod view, where parameter MinreturnDate equals the system date -X X is default 30 days, can be modified (dropdown or hyperlink) An edit allows to quickly jump to a specific invoice number.
- Grid with List of palets (X days) Shows result of ReturnInvoicesInPeriod view, where parameter PalletsWithReturnInPeriod equals the system date -X X is default 30 days, can be modified (dropdown or hyperlink)
- Above 2 grids are on 2 tabs of a page control, only one can be active at a time.
- Grid with Retour order list. Shows result of RetourOrders view, where parameter PalletsWithReturnInPeriod equals the system date -X X is default 30 days, can be modified (dropdown or hyperlink)
- Grid with Current return/pallete contents. (below list of returns/palet)
As soon as a return/return pallette is selected, the contents of the order/pallette is shown in this grid.
This is DA View INVDETAILS with dynamic where:
Invoice is the selected row's ReturnNo, and TransactionType the selected rows's Transactiontype. if a pallet was selected, the following is added to the filter:
(Invoice=:Invoice) and (TransactionType=:TransactionType)
Where PalNo is the number of the selected pallette (field PAL).AND (COLNO=:PalNo)
- This list can be printed. (ReturnInvoiceContent).
- RETOURNO return ID of selected record.
- TransactionType Transaction type of selected record.
- CustomFilter is empty or the filter on pallette number (as above) Remark: There is a second print button, check why it is there and why it differs ?
- A difference list (report ReturnDifferenceList) can be printed. It gets the selected return invoice as the InvoiceID parameter.
- Below the RetourOrders view, there is a grid with the details of the selected retour order; It shows the RetourOrderDetails view, with as filter parameter the ID of the RETUROUT record.
- The retour order detail can be printed. (report ReturnOrderContent)
- There is a button to suggest locations.
When clicked, it will call the server service
where the invoice is the currently selected return invoice.
StockControl.SuggestReturnLocation(invoice)
- A Return moving list can be printed. This will print report ReturnMovingList. It passes the currently selected invoice as InvoiceNo parameter.
- A button 'Add' adds the currently selected pallet to the selected return order. (see below)
- A button 'New order' creates a new return order.
- A button 'Delete order' deletes the currently selected return order.
Deze actie wordt gelogd via de UserHistory call:
Opmerking: op server doen, cascade foreign key leggen .
UserHistory(ID, 'RETUR-ORDER', 'ORDER COMPLETELY DELETED', 'RETUR MENU');
- A button "Excel export" allows to export the return order details to excel.
- A button "Delete pallet" allows to remove the selected pallet from the return order (see below).
Add button
On Click, the program first checks whether the pallet already exists in another return order (returout) using the StockControl.CheckPalletInReturn call. if it already exists, an error message is shown. if it does not exist yet, a new entry is made in RetourOrderDetails: Fields are mapped as follows:
Field | source |
---|---|
IDNO | Currently selected return order |
PalNo | number of currently selected pallet |
ReturNo | Invoce ID of selected pallet |
TransactionType | Transaction type of selected pallet |
CreationDate | Date |
CreationTime | Time |
PCName | Currently logged in user |
New order button
A new record is added to the dataset RetourOrders with the following fields:
| Field | source |
|-------|--------|
|Creationdate | Date |
|CreationTime | Time in hhss format|
|PCName | current user |
The record is activated, the RetourOrderDetails view is refreshed.
Excel export button
The program exports the contents of the RetourOrderDetails view as is to an excel file.
Delete pallet button.
The program checks whether the 'Picked' field equals "Y". If it does, an error message is shown and nothing is done. Error message:
If it is not "Y", the pallet is removed from the return order (all pallet lines with the same pallet number). The action is logged in the user history with:
Form1.UserHistory(PalNo, 'RETUR-PALET', 'PALET REMOVED FROM ORDER', 'RETUR MENU');
Tables/Views
- INVDETAILS
- ReturnInvoicesInPeriod
returns the invoice numbers of returned invoices
Parameters:
SELECT DISTINCT Invoice as ReturnNo, TransactionType, max(Filldate) as TheDate FROM INVDETAILS WHERE (FILLDATE>=:MinReturnDate) AND LEFT(TRANSACTIONTYPE, 3)='RET' GROUP BY Invoice, TransactionType ORDER BY Invoice DESC
-
MinReturnDate Minimum date for returned article.
-
PalletsWithReturnInPeriod returns the palettes with returned invoices
Parameters:SELECT DISTINCT Colno AS PAL, Invoice as ReturnNo, TransactionType, max(Filldate) FROM INVDETAILS WHERE (FILLDATE>=:MinReturnDate) AND LEFT(TRANSACTIONTYPE, 3)='RET' AND isnull(COLNO, '')<>'' GROUP BY Colno, Invoice, TransactionType ORDER BY colno DESC
-
MinReturnDate Minimum date for return order
-
RetourOrders
Returns a list of return orders created in the last X daysParameters:SELECT DISTINCT ID AS OrderNo, max(CreationDate) as Date, PCName as UserName FROM RETUROUT WHERE (CreationDate>=:MinReturnDate) Group by ID, PCName ORDER BY ID DESC
-
MinReturnDate Minimum date for returned article.
-
RetourOrderDetails
Parameters:SELECT A.*, (SELECT TOP 1 X.LOCATION+ ' '+STR(COUNT (X.ID))+' pcs' FROM Invdetails X WHERE (X.COLNO=A.PALNO) GROUP BY X.LOCATION ORDER BY COUNT(X.ID) DESC ) AS LOCATION FROM RETUROUTDET A WHERE (IDNO=:OrderNo) ORDER BY PALNO ASC
- OrderNo ID from RETUROUT record.