Sidebar

Combodo

iTop Extensions

Supplies Stock Management

šŸ¤¦ šŸ¤¦ šŸ¤¦ Combodo's customers only from version 1.1.0 šŸ˜Ž šŸ˜Ž šŸ˜Ž

name:
Supplies stock management
description:
Manage supplies stocks: through movements and/or from tickets
version:
1.1.2
release:
2025-02-07
itop-version-min:
3.0.0
diffusion:
iTop Hub
code:
itop-stock-mgmt
php-version-max:
PHP 8.1

This extension adds to iTop the capability to manage stock of various elements, which have no identifier or none that you want to handle.

Features

Stock Management extension introduces the capability to manage stock of items for which you don't have or don't want to track any unique identifier.

  • Such stock element can be of different type: stock of RJ45, stock of cables, stock of video cardsā€¦ defined through a simple typology class ā€œStock Typeā€.
  • A Stock follows a life cycle: once created, it can be supplied (ie available quantity can be increased) and quantity can be consumed.
    • Stock supply and consumption can be done either through a life cycle action, which keep track of stock movements,
    • Or through a Ticket which can consume or supply one or multiple stocks (quantity is specified on the link between the stock and the Ticket)

If the Stock falls below the user defined Warning level, the stock is moved to Empty state and a notification may be sent, if configured.

When listing the stocks, the empty ones are highlighted:

Empty stocks

The stock moves back to the Restocked state if enough quantity is added to the stock.

Revision History

Date Version Description
2025-02-07 1.1.2 * NĀ°8141 - Restore Stock compatibility with iTop 3.2.1
* Raise iTop min 3.1.0
2023-11-21 1.1.1 * Breaks 2.7.x compatibility
* NĀ°6756 - Put colors and icons on Stock based on its status
* NĀ°6749 - Stocks tab added on all Ticket sub-classes
* NĀ°6332 - Supply and consume Stock from Ticket and without Ticket, with comment
* NĀ°6753 - Compute Stock status on the fly when quantity is changed
* NĀ°6745 - Remove manual and cronified stock computation
* NĀ°6697 - Add quantity in lnk stock to ticket form
* NĀ°6970 - Order stock moves with most recent first
2023-07-19 1.0.2 * NĀ°3707 - No dictionaries entry for tab name related to stock on Document screen
* NĀ°6033 - Add label, friendlyname, uniqueness rules on Link classes
2022-11-10 1.0.1 * NĀ°5493 - Add compatibility with PHP 8.0
2019-09-02 1.0.0 Add location, description, provider,ā€¦
Allow Support Agent and Change Implementor to consume Stocks
2016-06-07 0.1.0 First version

Limitations

  • No control on consumption exceeding the Stock, the quantity can become negative
  • If Ticket using Stocks are archived or deleted, the Stock current quantity can become wrong, especially before iTop 3.1.1 (See Q&A for more details)
  • Do not modify StockMove quantity and stockelement_id as this is not handle for Stock computation. It's not allowed in the UI, so don't do it by REST or customization.
  • Direct creation of a StockMove or an lnkStockElementToTicket on a Stock is not prevented if this consumption exceed the Stock remaining quantity, leading to a negative stock value. Consumption from the Stock itself or from a Ticket is protected.

Requirements

  • iTop version depends on extension version used, check history for this.

Installation

Use the Standard installation process for this extension.

Configuration

No specific configuration parameter is required for the extension.

Usage

The ā€œStocksā€ menu available under the Configuration management section allows you to list, filter and search the stock element objects that have been created in iTop.  Simple Stock Management menu

New Stock

From a list or the detail screen of Stock, clicking on the ā€œNewā€ button displays the following form:

 New stock element

Stock properties

A stock element has the following attributesā€¦

Field Type Comment Mandatory ?
Name Alphanumeric string Yes
Organization Foreign key to an Organization Yes
Location Foreign key to a Location not limited to the organization No
Type Foreign key to a Stock Type Stock type is a simple topology No
Provider Foreign key to an Organization No
Status Enumeration Possible values: New, Restocked, Empty Yes
Restocking date Date and time Set when the stock was supplied for the last time No
Warning level Integer Stock quantity under which a notification can be sent No
Current quantity Integer Current quantity of elements in stock. Figure is automatically computed. No
Owner Foreign key to a Contact No
Description HTML text Information on how to manage this stock No
Tab Description
Tickets Tickets related to the stock
Movements History of Stock movements made through the transition ā€œAdd to Stockā€ and ā€œConsume from Stockā€
Documents Documents related to the stock
New Restocked Empty or nearly

Stock type

New type of stock can be created on the fly while editing a stock, with the + button. The Configuration Manager can see all Stock types at once in the dashboard displayed by the menu Data administration / Typology configuration

Movements

It's possible to provision and consume elements in a stock without doing it though Tickets, this will be stored as Movements.

From a particular Stock, choose the action you want to perform:

Add To Stock

  • Allowed users (which includes the Configuration Manager) can supply the Stock through the ā€œAdd to stockā€ transition.
  • The Quantity must be specified, by default 100 is displayed. It cannot be negative.
  • A Comment can be entered.
  • Once done, the Stock detail screen is displayed again with updated information:

 Supplying stock  Add to stock pop-up  Supplied stock

  • ā€œAdd to stockā€ action can be done any time.

Consume from Stock

  • Allowed users can consume from any Stock, using the transition ā€œā€œConsume from Stockā€
  • Action is only available when the Stock status is ā€œRestockedā€, meaning the Current quantity is higher than the Warning level

  • The quantity must be specified, by default 1 is proposed.
  • A comment can be entered.
  • Once done, the Stock detail screen is displayed again with updated information

History of Movements

Tickets

Another mean to use the Stocks, is to handle them through the ā€œStocksā€ tab available in the iTop console, on any Ticket class.

  • From that Ticket, go to the Stocks tab and add applicable Stocks, in the link, specifies:
    • The required Quantity (can only be positive) - mandatory
    • Action is usually to Get from stock but Ticket can also be used to provision a Stock
    • An optional Comment

As soon as submitted, the stock current quantity is updated in background.

Current quantity is the difference between the sum of all quantities that have been added to the stock element and the sum of all quantities consumed. It is computed on the fly, as soon as a Stock Move or a link between a Ticket and a Stock, is created, modified or deleted.

Notification

The extension doesn't automatically create any notification. Should you wish to notify the stock owner or any other contact that the quantity in stock has fallen below the threshold, ask your iTop administrator to create the notification first.

For that purpose, a trigger on entering a state must be created, like:

Empty stock element

The associated trigger action is standard. Only point to keep in mind: the owner of the stock element is defined by the attribute owner_id. Destination of the mail can be, therefore, defined like this:

SELECT Person WHERE id= :this->owner_id

Internal

Not displayed Stock fields

Accumulated quantity Integer Quantity that have been supplied from the date the Stock has been created. Figure is automatically computed Mandatory
Quantity to move (out or into) the stock Integer Quantity to add or remove from the Stock, requested during ā€œAdd to Stockā€ and ā€œConsume from Stockā€ transitions. Default to 1 in consumption, to 100 in supply
Comment Explanation about a particular stock move, can be either to describe a supply or a consumption or just readjust the true available quantity, after in inventory Optional

Those fields are not displayed by default. The Cumulated quantity attribute stores the global quantity of objects that have been added to the current stock element. This figure never decreases.

Quantity and Comment if displayed in a list, will show the last values which was entered for them, it's meaningless. They are just used temporarily to create a Stock Move from the Stock it-self, in a kind of more intuitive manner than through the Stock Moves tab and a manual creation.

Questions & Answers

Q: What if my stock current quantity is wrong?
A: If the Stock quantity displayed in iTop does not correspond to what is truly in your stock after an inventory, just ā€œAdd to Stockā€ or ā€œRemove from Stockā€ the required quantity to align them again, and in the comment explain that this move correspond to a realignment after inventory

More background details

  • Since version 1.1.0, computation of stock current quantity and status is done on the fly by adding or removing a quantity.
  • It's a delta computation. Also we keep track of all moves, we don't compute their sum each time.
  • It is supposed to be same as the sum of all Stock Movements on that Stock, to which iTop adds the sum of all Tickets usage of that Stock.
  • The full computation is performed by the method ComputeStock, executed only when editing the Stock and its Ticket links together.
  • From iTop 3.1.1, it is possible de deactivated the edition of Ticket links combined with the edition of the Stock itself, in which case ComputeStock would never be called.
  • If a Ticket using the Stock is archived, a full computation would change the Stock current quantity and make it wrong.

Q: What if I want to display a image associated to each stock?
A: Add an image attribute to the Stock element class and make it the class image.

extensions/itop-stock-mgmt.txt Ā· Last modified: 2025/03/14 18:03 by 127.0.0.1
Back to top
Contact us