Ga naar inhoud

Form AddOrderArticle

  • Unit name: Forms.Details.AddOrderArticle
  • Form name: TOrderArticleForm
  • Old form name: (unit3)

Synopsis

Form to add an article to an order.

Functionalities

  1. Article edit + search button. On enter key, ASearch action is executed, and focus is put on quantity spinedit
  2. Article description label.
  3. Quantity spinedit.
  4. Stockcode dropdown.
  5. Customs clearance radio group: Duty free/Duty cleared. (can be empty)
  6. Comments edit.
  7. Checkbox "Only consider articles from this client"
  8. Checkbox 'Customized picking'. On check, enabled and fill location grid. (ArticleStockPerLocation) The stock is filled on Customer (supplier) and on stockcode if a stockcode was selected.
  9. Location grid with checkboxes. A label displays the totally selected quantity. Disabled unless Checkbox is checked
  10. Warehouse stock grid, showing selected article stock (ArticleStock).
  11. Customs stock grid, showing selected article customs stock (ArticleCustomsStock)

Actions

Search the requested article in the list of articles. 1. Active if the article edit is non-empty. 1. When executed, searches the article in the list of articles. 1. If the article is not found, an error is shown:

Article :Article is not found.
Abort the action. 1. if the article has a popup message associated with it (pop_op_flag_del) with length>1 then the message is shown in a popup message. 1. Display the warehouse stock. 1. Display the customs stock. 1. If "Customized Picking" is checked, then show the stock per location.

OK

  1. Not active unless a valid article was selected, all fields are filled (Qty>0), and if customized picking was selected, the sum of picked quantities equals or is larger than the asked quantity for the article.
  2. When executed, the following checks are done: Stockcode 25 may not be used, 75 must be used instead. Stockcode 99 may not be used, 75 must be used instead. If stockcode = 75, then customs clearance must have a value. (i.e itemindex may not be -1)
  3. if customized picking was selected, a new custompickjob id is requested, and the selected locations are inserted using the custom pick job ID in Table CustomPickJob.

  4. Action calls DeliveryControL.AddArticleToOrder

  5. The form is closed.

Cancel

Always active.

Tables/Views

  1. Article (global lookup)
  2. ArticleStock
    SELECT
      STOCKCODE AS STC,
      SUM(QTYIN-ISNULL(QTYOUT, 0)) AS QTY,
      ORDID  
    FROM
      FSTOCTOTAL(:ArticleID) A
      left join STOCKCODE B  on (A.STOCKCODE=B.NAME )
    WHERE
    --  {CustomFilter}
    GROUP BY
      STOCKCODE, ORDID
    HAVING
      SUM(QTYIN-ISNULL(QTYOUT, 0))>0
    ORDER BY
      ORDID asc
    
  3. ArticleCustomsStock
    SELECT
      STOCKCODE AS STC, SUM(QTY) AS QTY
    FROM
      FSTOCTOTALCC(:ArticleID)
    GROUP BY
      STOCKCODE
    HAVING
      SUM(QTY)>0
    ORDER BY
      stockcode asc
    
  4. ArticleStockPerLocation
    SELECT
      STOCKCODE AS STC, LOCATION, ExpiryDate, LotNo,
      SUM(QTYIN-ISNULL(QTYOUT, 0)) AS QTY,
      ORDID  
    FROM
      FSTOCTOTAL(:ArticleID) A
      left join STOCKCODE B ON (A.STOCKCODE=B.NAME)
    WHERE
    --  {CustomFilter}
    GROUP BY
      STOCKCODE, LOCATION, ExpiryDate, Lotno, ORDID
    HAVING
      SUM(QTYIN-ISNULL(QTYOUT, 0))>0
    ORDER BY
      ORDID asc
    

Needed Service Calls

None.

Reports