Ga naar inhoud

Stockarticle

Form StockArticle

  • Unit name: Forms.StockArticle
  • Form name: StockArticleForm
  • Old form name: Unit4 (form4)

Synopsis

Form to check stock & print palette label.

Functionalities

  1. Edit to enter article barcode (scan). On enter key, execute ShowArticeList action. As soon as the edit changes, the
  2. Button to execute ShowArticeList action.
  3. Button to execute SearchArtice action.
  4. Grid to show ArticleStockForScanner view. For double click or enter while grid is focused, execute ShowArticleDetails action. Color the lines:
  5. Lines type record 2 (reserved) are red.
  6. Lines type record 3 (production) are green (moneygreen).
  7. Button to print pallete label report.
  8. Button to execute close action.

Actions

Close

  1. Always Enabled
  2. Closes the form.

SearchArticle

  1. Always enabled.
  2. Show the SearchArticleByDescription form.
  3. If the form result is mrOK:
  4. get the selected Articlecode and enter it in the article code edit.
  5. Execute ArticleFromBarCode

ShowArticleList

  1. Only enabled when article code edit is non-empty.
  2. On execute, check article barcode existence using ArticleFromBarCode
  3. If it does not exist, show an error:
    Unknown barcode :barcode.
    
  4. If the article exists, show article stock using ArticleStockForScanner
  5. focus the edit, select all.

ShowArticleDetails

  1. Only enabled when a grid line is selected.
  2. On execute, Show Form StockArticleDetails (modal).
  3. Pass it the ArticleStockForScanner data.

Tables/Views

  • ArticleFromBarCode

    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)
    
    Updateable: EANCODE* fields can be changed.

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

  1. ArtBareCore: '*' + B.ARTCODE + '*'
  2. STATUS
  3. TypeRecord=1: Empty.
  4. TypeRecord=2: 'Reserved /' + avizno.
  5. TypeRecord=3: 'Production / ' + avizno.
  6. STATUS1
  7. TypeRecord=1: 'Stock'.
  8. TypeRecord=2: 'Reserved'.
  9. TypeRecord=3: 'Production'.
  10. STATUS2
  11. TypeRecord=1: Empty.
  12. TypeRecord=2: Country.
  13. TypeRecord=3: Empty.
  14. LotNo2:
  15. If Lotno empty: empty
  16. If Lotno not empty: '*'+LotNo+'*'
  17. ProductLot:
  18. If LotNo<>'' then '*' + ARTCODE + '-' + LOTNO + '*'
  19. If LotNo='' then '' + ARTCODE+ ''
  20. ProductLot1:
  21. If LotNo<>'' then '*' + EANCODE3 + '-' + LOTNO + '*'
  22. If LotNo='' then '*' + EANCODE3+ '*'

Needed Service Calls

Reports