Stockarticle
Form StockArticle
- Unit name: Forms.StockArticle
- Form name: StockArticleForm
- Old form name: Unit4 (form4)
Synopsis
Form to check stock & print palette label.
Functionalities
- Edit to enter article barcode (scan). On enter key, execute ShowArticeList action. As soon as the edit changes, the
- Button to execute ShowArticeList action.
- Button to execute SearchArtice action.
- Grid to show ArticleStockForScanner view. 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).
- Button to print pallete label report.
- Button to execute close action.
Actions
Close
- Always Enabled
- Closes the form.
SearchArticle
- Always enabled.
- Show the SearchArticleByDescription form.
- If the form result is
mrOK
: - get the selected Articlecode and enter it in the article code edit.
- Execute ArticleFromBarCode
ShowArticleList
- Only enabled when article code edit is non-empty.
- On execute, check article barcode existence using ArticleFromBarCode
- If it does not exist, show an error:
Unknown barcode :barcode.
- If the article exists, show article stock using ArticleStockForScanner
- focus the edit, select all.
ShowArticleDetails
- Only enabled when a grid line is selected.
- On execute, Show Form StockArticleDetails (modal).
- Pass it the ArticleStockForScanner data.
Tables/Views
-
ArticleFromBarCode
Updateable: EANCODE* fields can be changed.SELECT ID, NAME, NAME2, EANCODE, EANCODE1, EANCODE2, EANCODE3, EANCODE4, GetDate() as CrtDate, Pop_up_flag_mov, FLOTNO, ExpiryTime from ARTICLE where :BarCode in (EANCODE, EANCODE1, EANCODE2, EANCODE3, EANCODE4)
-
ArticleStockForScanner
With ArtSel as ( SELECT 1 AS TypeRecord, '' as AVIZNO, A.ARTCODE, LOCATION, A.STOCKCODE, SUM(QTYIN - ISNULL(QTYOUT, 0)) AS QTY, '' as country, A.SUPPLIER, A.FDATE, A.Lotno, A.ExpiryDate FROM FSTOCTOTAL(:ArticleID) A INNER JOIN ARTICLE C ON (A.ARTCODE = C.NAME) GROUP BY A.STOCKCODE, A.ARTCODE, A.Location, A.Lotno, A.ExpiryDate, A.SUPPLIER, A.FDATE HAVING SUM(QTYIN - ISNULL(QTYOUT, 0)) > '0' UNION SELECT 2 AS TypeRecord, A.AVIZNO, A.ARTCODE, B.LOCATION, a.stockcode, a.qty, D.COUNTRY, B.SUPPLIER, B.FILLDATE AS FDATE, B.Lotno, B.ExpiryDate 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 D ON (A.AVIZNO = D.AVIZ) WHERE (a.ARTCODE = :ArticleID) AND (pickedby = '') AND (A.TransactionType IN ('ORD', 'KIT')) AND (A.filldate > :StartDate) UNION SELECT 3 AS TypeRecord, A.AVIZNO, A.ARTCODE, A.TransitLocation AS Location, a.stockcode, a.qty, '' AS Country, B.SUPPLIER, B.FILLDATE AS FDATE, B.Lotno, B.ExpiryDate FROM OUTDETAILS A INNER JOIN INVDETAILS B ON (b.ID = a.INVOICENO) AND (b.STOCKCODE = a.STOCKCODE) AND (b.ARTCODE = a.ARTCODE) WHERE a.ARTCODE = :ArticleID AND (pickedby <> '') AND (checkedby = '') AND (A.TransactionType = 'KIT') AND (A.TransitLocation <> '') AND A.filldate > :Startdate ) select ArtSel.*, C.NAME2, C.EANCODE3 from ArtSel Inner JOIN Article C on (ArtSel.ArtCode=C.Name) ORDER BY TypeRecord,AvizNo
Add Calculated fields:
- 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+ '*'