Ga naar inhoud

Kittostockstart

Form KitToStockStart

  • Unit name: Forms.KitToStockStart
  • Form name: KitToStockStartForm
  • Old form name: form34 (unit34)

Synopsis

Start a kit-to-stock move operation.

Functionalities

  1. Grid showing kitting orders as returned by KitReadyOrders view. (filled on show)
  2. When a line is selected, the smallest ready quantity of the selected kit is displayed in an edit and a label. This is calculated using the KitReadyQuantity view: The smallest possible quantity is calculated using a loop:
    MyQty:=floor(pickedqty/unitqty);
    while not QUERY1.eof do
      begin
      MyQTY1:=floor(pickedqty/unitqty);
      if MyQty1<MyQTY then
        MyQTY:=MyQty1;
      QUERY1.Next;
      end;
    
  3. Label to show maximum available items for the kit order.
  4. Edit to enter quantity. Default is the minimum quantity of the currently selected order in the view. (see above)
  5. Button to execute SelectKitOrder action.

Actions

SelectKitOrder

  1. Enabled when an order is selected, and the entered quantity>0 and is less (or equal to) than the rest quantity: TQty-RQty
  2. On Execute, shows the KitToStockFinalizeForm form and passes it
  3. the order kit
  4. quantity
  5. Lot number
  6. Expiry date from the selected kit.

Tables/Views

  • KitReadyOrders
    SELECT
      DISTINCT AVIZ AS OrderNo,
      B.TransitLocation,
      C.QTY AS TQTY,
      C.ReadyQTY AS RQTY,
      C.MLOTNO,
      C.MEXPIRYDATE,
      C.ARTCODE AS MARTCODE
    FROM
      OUT A
      INNER JOIN CGROUP C ON AVIZ = 'KG' + CAST (C.ID AS VARCHAR (15)),
      INNER JOIN OUTDETAILS B ON (A.AVIZ = B.AVIZNO) AND (B.TRANSACTIONTYPE = 'KIT')
    WHERE
      (A.SYSTEMDATE >= dateadd(DAY, - 100, getdate()))
      AND (pickedby <> '') AND (checkedby = '')
      AND isnull(C.QTY, 0) > isnull(C.ReadyQTY, 0)
      AND (B.PickedBy<>'')
      /* last condition Was:  
        A.AVIZ NOT IN (SELECT X.AVIZNO FROM OUTDETAILS X WHERE X.AVIZNO = A.AVIZ AND (pickedby='')
        But since it is an inner join...
      */  
      )
    ORDER BY
      AVIZ DESC
    
  • KitReadyQuantity
    SELECT
      sum(isnull(qtycf, B.qty)) as pickedqty,
      d.unitqty,
      b.artcode
    FROM
      [OUT] A
      INNER JOIN OUTDETAILS B ON (A.AVIZ = B.AVIZNO) AND (B.TRANSACTIONTYPE = 'KIT')
      INNER JOIN CGROUP C ON AVIZ = 'KG' + CAST (C.ID AS VARCHAR (15))
      INNER JOIN CGROUPDET D ON (C.ID = D.IDNO) AND (B.ARTCODE = D.ARTCODE)
    WHERE
      (pickedby <> '')
      AND (checkedby = '')
      AND avizno = :AvizNo
    GROUP BY
      BlockNo,
      d.unitqty,
      b.artcode
    ORDER BY
      BLOCKNO DESC
    

Needed Service Calls

None.

Reports

None.