Stockperlocation
Form StockPerLocation
- Unit name: Forms.StockPerLocation
- Form name: StockPerLocationForm
- Old form name: Unit14 (form14)
Synopsis
Form to check the stock on a location.
Functionalities
- Edit to enter a location. On enter key, execute ShowLocationArticles action.
- Button to execute ShowLocationArticles action.
- Grid to show LocationStockForScanner data. For double click or enter while grid is focused, execute ShowArticleDetails action. Color the lines:
- Lines type record 2 (reserved) are red.
- Lines type record 3 (production) are green (moneygreen).
Actions
ShowArticleDetails
- Only enabled when a grid line is selected.
- On execute, Show Form StockArticleDetails (modal).
- Pass it the LocationStockForScanner data.
ShowLocationArticles
- Active when there is a location in the entry box.
- When executed, the LocationStockForScanner view is opened and shown in the grid.
Action2
Tables/Views
-
LocationStockForScanner
Add Calculated fields:SELECT 1 as typerecord, ARTCODE, NAME2, A.LOCATION, A.STOCKCODE, SUM(QTYIN - ISNULL(QTYOUT, 0)) AS QTY, '' as country, A.Lotno, A.ExpiryDate, B.EANCODE3 FROM STOCTOTAL A INNER JOIN ARTICLE B ON (B.NAME = A.ARTCODE) WHERE A.LOCATION = :Location GROUP BY A.STOCKCODE, A.ARTCODE, A.Location, A.Lotno, A.ExpiryDate, B.EANCODE3, B.NAME2 HAVING SUM(QTYIN - ISNULL(QTYOUT, 0)) > 0 UNION SELECT 2 as typerecord, a.artcode, c.name2, B.LOCATION, a.stockcode, a.qty, E.COUNTRY, B.Lotno, B.ExpiryDate, C.EANCODE3 FROM OUTDETAILS a INNER JOIN INVDETAILS b ON (b.ID = a.INVOICENO) AND (B.STOCKCODE = A.STOCKCODE) AND (b.ARTCODE = a.ARTCODE) INNER JOIN ARTICLE c on (a.artcode = c.name) INNER JOIN OUT E ON (A.AVIZNO = E.AVIZ) WHERE B.LOCATION = :location AND (pickedby = '') AND (A.TransactionType IN ('ORD', 'KIT')) AND (A.filldate > :StartDate) UNION SELECT 3 as TypeRecord, A.artcode, c.name2, B.LOCATION, A.stockcode, A.qty, '' as country, B.Lotno, B.ExpiryDate, C.EANCODE3 FROM OUTDETAILS A INNER JOIN INVDETAILS B ON (b.ID = a.INVOICENO) AND (b.STOCKCODE = a.STOCKCODE) AND (b.ARTCODE = a.ARTCODE) INNER JOIN ARTICLE C ON (a.artcode = c.name) WHERE (pickedby <> '') AND (checkedby = '') AND (A.TransactionType = 'KIT') AND (A.TransitLocation = :Location) AND A.filldate > :StarTDate Order by TypeRecord, artcode
-
ArtBareCore:
'*' + B.ARTCODE + '*'
- STATUS
- TypeRecord=1: Empty.
- TypeRecord=2:
'Reserved /' + avizno
. - TypeRecord=3:
'Production / ' + avizno
. - STATUS1
- TypeRecord=1:
'Stock'
. - TypeRecord=2:
'Reserved'
. - TypeRecord=3:
'Production'
. - STATUS2
- TypeRecord=1: Empty.
- TypeRecord=2:
Country
. - TypeRecord=3: Empty.
- LotNo2:
- If Lotno empty: empty
- If Lotno not empty:
'*'+LotNo+'*'
- ProductLot:
- If LotNo<>'' then
'*' + ARTCODE + '-' + LOTNO + '*'
- If LotNo='' then '' + ARTCODE+ ''
- ProductLot1:
- If LotNo<>'' then
'*' + EANCODE3 + '-' + LOTNO + '*'
- If LotNo='' then
'*' + EANCODE3+ '*'