Easy way to adjust stock
  • Rob

    Easy way to adjust stock

    by Rob » Thu Aug 06, 2009 4:54 pm

    Hi,

    I operate a small business with only a few staff and want to avoid having to to do formal stocktakes if I just want to adjust a few stock item quantities at a time.

    Can I set-up an 'on-the-fly' stocktake adjustment on the stock record using scripting?
  • COBS Tech Support
    Posts: 678
    Joined: Fri Sep 09, 2005 8:23 am

    by COBS Tech Support » Thu Aug 06, 2009 5:00 pm

    Yes, the steps are:

    1. Go to Screen Builder
    2. Open Stock Screen
    3. Add a new field to the stock screen with these values:

    User Field: ADJSTOCK

    Type: Quantity

    Sort: None

    Label: Adjust Stock

    4. Press OK to close.

    5. From the menu select File|Screen Script.

    6. Paste this script into the window:

    Code: Select all

    If Mode = 9 .And. Focus = "ADJSTOCK"
       Declare nAdjust Type Number
       nAdjust := SCRRead("ADJSTOCK")
       SCRWrite("ADJSTOCK", 0)
       SCRWrite("STOCK_IN", SCRRead("STOCK_IN") - nAdjust)
       SCRWrite("STVARIANCE", SCRRead("STVARIANCE") + nAdjust)
    Endif


    7. Press Save
    8. Select File|Exit then press Yes to save changed.

    You should now be able to enter adjustment quantities onto your stock record that will reduce your stock on hand and your stock variance.

Who is online

Users browsing this forum: No registered users and 1 guest