Page 1 of 1

Easy way to adjust stock

Posted: Thu Aug 06, 2009 4:54 pm
by Rob
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?

Posted: Thu Aug 06, 2009 5:00 pm
by COBS Tech Support
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.