ITrack/Pro/Quantity
ITrack is an inventory system - tracking quantities is srs bzns.
Quantity on hand
Unless otherwise specified, this is what people are talking about when they say "quantity" in the context of inventory.
QOH is how many of a part that you have sitting in your inventory, in stock. This number can be found in the `inventory` table, in the `quantity` field.
ITrack Pro stores inventory quantities as integers, which means that fractional quantities are not tracked. However, the sales screen does allow you to sell fractional quantities. Those fractional quantities get trimmed or rounded or something when the database is updated.
When does QOH change?
Inventory quantity can be changed at any time by a user with the correct permissions.
Other than a user changing quantity manually, inventory quantity should only change if the part is depletable, in one of the following cases:
- If a part is on a build order as a lineitem, its quantity will be decremented by the lineitem quantity when the build order is closed.
- If a part is on an invoice as a lineitem, its quantity will be decremented by the lineitem quantity the first time the invoice is saved.
- If a child part is sold, and the user answers "yes" at a particular dialog, the parent part will have its quantity set to 0 (among other changes).
- If a part is on a purchase order as a lineitem, its quantity will be incremented by the number the user enters in the "received" column before they save.
Quantity available
The concept of "available quantity" revolves around the reality that even though you may have 5 widgets on a shelf, you may have promised some of them to someone else.
The term used to describe this promising of a part to something is called putting the part "on hold".
To put some quantity of an inventory record on hold:
- The part must be on any type of quote document
- The quote must not be expired
- The quote must not be closed
- The "hold" checkbox must be checked on the lineitem with the part
The quantity put on hold will be equal to the quantity on that lineitem.
Available quantity is not stored in the database, and must be calculated dynamically.