Movehighlocation
Form MoveHighLocation
- Unit name: Forms.MoveHighLocation
- Form name: TMoveHighLocationForm
- Old form name: (unit38) Form38.
Synopsis
Form to register a move from a high to a low location.
Functionalities
- Property for Country property.
- Property for Pickjob (block id).
- Grid to show candicates locations: View HighLocationCandidates. Open on form show, take parameter from PickJob ID.
- Label to show country (caption set from property)
- Label to show picking job ID (caption set from property)
- Source group
- Edit for source location. On change, all other edits are cleared and disabled. On Enter key, execute SelectSourceLocation action.
- Edit for article code. Disabled if there is no location.
On change, quantity and destination location edits are cleared and disabled. On Enter key, execute SelectArticle action. - Edit for Move quantity (number). Disabled if there is no location and article.
On Enter key, execute CheckQuantity action. - Label for max/reserved qty.
- Label for recent picks display.
- Label for the stock and reserved stock.
- Dest group
- Edit for destination location. On Enter execute OK action.
- Disabled till there are valid source and destination locations.
- Button to execute OK action.
- Button to execute Cancel action.
Actions
CheckQuantity.
- Enabled when the article quantity edit is enabled.
- Checks that the article quantity to move is at least STOCK_RESERVED.
if not, an error is shown:
The minimum quantity you can move is: :STOCK_RESERVED.
SelectSourceLocation.
- Enabled when there is a source location.
- Checks that the entered location matches the selected line in the grid.
If not, displays an error:
the operation is aborted.
The scanned location differs from the selected location.
- Checks that the entered location exists.
If not, displays an error:
the operation is aborted.
The scanned location :Location does not exist in the database.
- The Area,Row,Place are saved.
- Article edit is enabled and focused.
SelectArticle.
- Enabled when there is a source location and article.
- Checks that the entered article exists using ArticleFromBarCode view.
- If the article does not exist, an error is shown
The article is focuses, all text selected and the operation is aborted.
The scanned article :Article does not exist in the database.
- If a move message exists, it is displayed.
- Checks that the entered article matches the selected line in the grid.
If not, displays an error:
the operation is aborted.
The scanned article differs from the selected article line.
- The article stock is checked using ArticleStockOnLocation. If no stock exists (Stock<=0), a message is shown:
The operation is aborted. The stock and reserved stock are shown.
There is no stock for article :Article on this location.
- Get the article pick count and picked quantity count (ArticleRecentPickList) from the last 30 days and display in label as
:Quantity pieces, :Picks picks in 30 days.
OK
- Enabled when there is a valid start, destination location, article and quantity.
- Check existence of destination location. (Location view)
If not, displays an error:
the operation is aborted.
The scanned location :Location does not exist in the database.
- Check if destination location has stock of other articles. (LocationHasStock view)
if yes, a confirmation dialog is shown:
if the user aborted, the operation is aborted.
On the destination, there is another article: :Article (:Pieces pieces) Press YES if you still want to continue!'
- Execute a partial move with the selected parameters if the entered quantity is less than the stock + stock_reserved quantities.
- comments is
'Move '+Edit1.TEXT+'->'+Edit3.TEXT+' '+'75'+'->'+'75',
- OpComments
' partial qty moved back from a FM'
- Transaction is move
- Scan history operation is move-fl
- Form is completely reset.
Cancel
- Always enabled.
- On Execute, Close form and show Move Menu form.
Tables/Views
-
LOCATION To check that source and destination locations exist.
-
LocationHasStock
SELECT ARTCODE, sum(QTYIN - QTYOUT) AS STOCQTY FROM STOCTOTAL WHERE ARTCODE <> :Article AND LOCATION = :Location GROUP BY ARTCODE HAVING sum(QTYIN - QTYOUT) > 0
-
ArticleStockOnLocation
select [dbo].[LOC_STOCK_MOVE_F_HIGH] (:Location,:Article ,75) AS STOCK, [dbo].[LOC_STOCKRESERVED_MOVE_F_HIGH] (:Location,:Article,75) AS STOCK_RESERVED
-
ArticleFromBarCode See StockArticle form.
-
HighLocationCandidates
SELECT E.SQWPK, B.ARTCODE, C.LOCATION, C.STOCKCODE, sum(B.QTY) AS QTY, [dbo].[LOC_STOCK_MOVE_F_HIGH](B.ARTCODE, C.LOCATION, C.STOCKCODE) AS SQTY, [dbo].[LOC_STOCKRESERVED_MOVE_F_HIGH](B.ARTCODE, C.LOCATION, C.STOCKCODE) AS STOCK_RESERVED FROM OUT A INNER JOIN OUTDETAILS B ON (A.AVIZ = B.AVIZNO) INNER JOIN INVDETAILS C ON (B.INVOICENO = C.ID) AND (B.ARTCODE = C.ARTCODE) INNER JOIN LOCATION E ON (C.LOCATION = E.LOCATION) WHERE (A.blockno = :BlockID) AND (RIGHT (C.LOCATION, 1) <> 'A')) AND (B.TRANSACTIONTYPE IN ('ORD', 'KIT')) AND (C.STOCKCODE = '75') GROUP BY E.SQWPK, B.ARTCODE, C.LOCATION, C.STOCKCODE ORDER BY E.sqwpk, B.artcode
SELECT lPickOrder, aName,lName, sum(odQuantity) AS odQuantity, (Select IsNull(SUM(idQuantity-ISNULL(QTYOUT,0)),0) AS Quantity from STOCTOTAL where (idArticleFK=article.aID) and (idLocationFK=location.lID) and (idStockCode='75')) as aQuantity, (Select IsNull(SUM(idQuantity-ISNULL(QTYReserved,0)),0) AS Quantity from STOCTOTAL where (idArticleFK=Article.aID) and (idLocationFK=location.lID) and (idStockCode='75')) as aQuantityReserved FROM OutOrder inner join OutOrderDetail on (oID=odOutOrderFK) Inner join InvDetail on (odInvDetailFK=idID) and (odArticleFK=idArticleFK) Inner join location on (idLocationFK=lID) Inner join article on (idArticleFK=aID)
WHERE (oPickJobFK = :PickJob) AND (RIGHT (lName, 1) <> 'A')) AND (odTransactionType in ('ORD', 'KIT')) AND (idStockCode = '75')
GROUP BY lPickOrder,aName,lName
ORDER BY lPickOrder,aName
- ArticleRecentPickList See Partial Move