Ga naar inhoud

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

  1. 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.
  2. 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)
  3. Above 2 grids are on 2 tabs of a page control, only one can be active at a time.
  4. 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)
  5. 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=:Invoice) and (TransactionType=:TransactionType)
    
    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:
       AND (COLNO=:PalNo)
    
    Where PalNo is the number of the selected pallette (field PAL).
  6. This list can be printed. (ReturnInvoiceContent).
  7. RETOURNO return ID of selected record.
  8. TransactionType Transaction type of selected record.
  9. 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 ?
  10. A difference list (report ReturnDifferenceList) can be printed. It gets the selected return invoice as the InvoiceID parameter.
  11. 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.
  12. The retour order detail can be printed. (report ReturnOrderContent)
  13. There is a button to suggest locations. When clicked, it will call the server service
      StockControl.SuggestReturnLocation(invoice)
    
    where the invoice is the currently selected return invoice.
  14. A Return moving list can be printed. This will print report ReturnMovingList. It passes the currently selected invoice as InvoiceNo parameter.
  15. A button 'Add' adds the currently selected pallet to the selected return order. (see below)
  16. A button 'New order' creates a new return order.
  17. A button 'Delete order' deletes the currently selected return order. Deze actie wordt gelogd via de UserHistory call:
       UserHistory(ID, 'RETUR-ORDER', 'ORDER COMPLETELY DELETED', 'RETUR MENU');
    
    Opmerking: op server doen, cascade foreign key leggen .
  18. A button "Excel export" allows to export the return order details to excel.
  19. 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 hh🇲🇲ss 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
    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
    
    Parameters:
  • MinReturnDate Minimum date for returned article.

  • PalletsWithReturnInPeriod returns the palettes with returned invoices

    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
    
    Parameters:

  • MinReturnDate Minimum date for return order

  • RetourOrders
    Returns a list of return orders created in the last X days

    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
    
    Parameters:

  • MinReturnDate Minimum date for returned article.

  • RetourOrderDetails

    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
    
    Parameters:

  • OrderNo ID from RETUROUT record.

Needed Service Calls

Call 1

Call 2

Reports