Pickitems
Form PickItemsForm
- Unit name: Forms.PickItems
- Form name: PickItemsForm
- Old form name: Form9 (unit9)
Synopsis
Form to control picking articles from the warehouse.
Functionalities
- Has a property to set Pickjob ID.
- Has a property to set TransitLocation
- Grid to show articles to be picked. When the user selects a line, reset form (clear all edits, set invisible where needed etc.).
- Active edit gets red color.
- On Show, the ShowArticles action is executed.
- A refresh button allows to call ShowArticles
- Edit allows to enter barcode. When enter is pressed, CheckArticle action is executed.
- Edit Allows to enter lotno. On enter key, execute CheckLotNo action.
- Edit allows to enter a trolley location. Only shown when picktype is ptTrolley. On enter, execute the ShowTrolleyLocationArticles action when that is enabled. On enter key, execute the CheckTrolleyLocation action.
- Edit allows to enter quantity. When enter is pressed, SaveScanData is executed.
- Button to execute RefreshData action.
- Button to execute ShowOrders action.
Actions
ShowOrders
- Always enabled.
- Show Form PickOrderList modally, passing it the current pick job id.
ShowArticles
- Always enabled.
- Saves bookmark if there is a current row in the view PickJobDetails. (use record ID)
- Shows view PickJobDetails with macros:
- Macro OrderNo is
AVIZ
when pickingtype differs from ptTrolley else it is'' as AVIZ
- Macro TLocation, for picktype ptTrolley equals
For other picktypes it is
(CASE WHEN count(distinct isnull(out.TLOCATION, ''''))>1 then ''MP999'' ELSE MAX(isnull(out.TLOCATION, '''')) END) as TLOCATION,
'' as TLOCATION
- Sort order parameter is ASC or DESC depending on form sort order.
- pickjobid is the form pick job ID.
- Bookmark is restored.
CheckArticle
- Enabled if a barcode is present.
- if The current field pickedby is not empty, an error message is shown:
Article already scanned: :Name2
- Execute DeliveryControl.PickCheckArticleScanned
- If the result has a display message, show it.
- Save the StartScanDate field.
- If HaveLotNo is true:
- Make the LotNo edit box visible and focus it.
- If HaveLotNo is false:
- if there is a trolley location edit: focus it
- if there is no trolley location: focus the quantity edit
CheckLotNo
- Only enabled when there is a lotno
- If the entered lotno equals the lotno in the current record, the focus is transferred to the tlocation edit if available, else the focus goes to the quantity edit.
- If the entered lotno is different from the lotno in the current record, an error message is shown:
The lotno edit is focused, and all is selected.
The lotno is wrong! Correct lotno is: :LotNo
ShowTrolleyLocationArticles
- Enabled if the current location is
MP999
and the text in the trolley location is different fromMP999
. - Show form TrolleyPickArticles with current Invoice, article, location, lotno and user.
- if the form closes with mrYes modal result then the trolley location text is set to
MP999
.
CheckTrolleyLocation
- Always enabled.
- Check if the current article has a trolley location:
- If yes, it is checked against the location in the trolley location edit. If they do not match, an exception is raised.
- If not, Call service call DeliveryControl.ScanTrolleyLocation with current PickJobID, invoice ID, Trolley Location name.
SaveScanData
- Is enabled if
- the current pickedby is empty.
- Article code is OK.
- LotNo is OK. (entered sme as expected)
- Quantity <= Requested quantity.
-
Trolley location is correct.
-
Execute DeliveryControl.SaveArticleScanData with the correct descriptor:
- PickJobID (int64)
- ArticleID (int64)
- LocationID (int64)
- OutDetailID (int64)
- TransitLocation from current transit location.
- StockCode from current record stockcode
- if
result.LocationEmptyStock
istrue
then the following message is shown:Stock for this article is zero now in this location.
- if
result.PickJobDone
istrue
then the following message is shown with yes/no buttons:if the user selected 'Yes', then the form is closed.This was the last job (order-line) from the order. Do you want to exit?
RefreshData action.
Tables/Views
- PickJobDetails
SELECT
-- {:OrderNo1 as} AVIZ,
outdetails.artcode,
isnull(invdetails.location, '0000') as LOCATION,
-- {TLOCATION1}
sum(outdetails.qty) as QTY,
sum(outdetails.QtyCF) as QTYCF,
count(distinct OutDetails.ID) as NoOfRows,
outdetails.stockcode,
isnull(PICKEDBY, '') as PICKEDBY,
NAME2,
(CASE
WHEN ((isnull(WEIGHT, 0) > UWEIGHT)
or (isnull(VOL, 0) > UVOLUME)
or (sum(outdetails.qty) * VOL) > TVOLUME)
THEN 1
ELSE 0
END) as SortField,
isnull(Lotno, '') as lotno,
LOCATION.SqWpk,
max(OutDetails.id) as OID
FROM
PickJob
INNER JOIN out ON (pjInvoiceFK=out.id)
inner join outdetails on (aviz = avizno)
INNER JOIN ARTICLE ON (outdetails.artcode = article.name)
left outer join invdetails on
(INVDETAILS.ID = OUTDETAILS.INVOICENO)
AND (INVDETAILS.STOCKCODE = OUTDETAILS.STOCKCODE)
AND (INVDETAILS.ARTCODE = OUTDETAILS.ARTCODE)
left outer join LOCATION on (INVDETAILS.LOCATION = LOCATION.LOCATION),
PICKINGPARAMS
where
(Pickjob.pjJodbID=:PickJobID)
GROUP BY
AVIZ,
outdetails.artcode,
isnull(invdetails.location, '0000'),
outdetails.stockcode,
isnull(PICKEDBY, ''),
NAME2,
isnull(Lotno, ''),
LOCATION.SqWpk,
WEIGHT,
UWEIGHT,
VOL,
UVOLUME,
TVOLUME
order by
SortField DESC,
LOCATION.sqwpk :sortorder,
outdetails.artcode,
TLOCATION
Needed Service Calls
DeliveryControl.ScanTrolleyLocation
To set the trolley location on an order in the pick job.
DeliveryControl.SaveArticleScanData
To save the results of the article scan.