snipe / snipe-it

A free open source IT asset/license management system
https://snipeitapp.com
GNU Affero General Public License v3.0
10.98k stars 3.17k forks source link

Incorrectly count of minimal quantity of Asset. #14546

Open dboissat opened 6 months ago

dboissat commented 6 months ago

Debug mode

Describe the bug

The minimal quantity feature for asset is useful for finding out when you are approaching the end of your stock and when you need to buy more. But currently, the count is incorrect and seems perform only a comparaison between "Deployed" devices versus all devices of the models, without check the "Archived" or "Undeployable" status.

Over the years, we have more "archived" or "undeployable" devices but that we don't want to delete to keep a record.

Reproduction steps

On the demo :

  1. List "XPS 13" assets: 5 device are created.

    • 1 deployed
    • 4 ready to deploy
  2. Add minimal quantity to 3 on the model "XPS 13".

  3. Change status of 2 devices:

    • One to Archived
    • One to another "Undeployable" status as "Broken - Not Fixable"
  4. Now you have only 2 device "Ready to deploy" but no minimal alert quantity.

  5. Change the minimal quantity to 5 on the model "XPS 13"

  6. You have "4 remaining".

=> Only "Deployed" status seems used.

Expected behavior

On our side, we consider the "pending" status type as into our stock and the "Deployable" status for device "configured" and ready to be installed. But it's maybe not the more common use.

Solution 1: The feature count all devices "Deployed" versus "Deployable" and "Pending" and exclude "Undeployable" and "Archived". We obtain the number of devices in "Pending" or "Deployable" into our stock. Not perfect, but closer to what's needed.

Solution 2: We have the option to personalize how the feature count into the admin configuration tab with two lists : "Status to included" and "Status to excluded". So everyone can configure how the alert works to suit their needs.

Screenshots

snipe-it_suggest

Snipe-IT Version

v6.3.4 build 13139 (g6f9ba6ede)

Operating System

Linux

Web Server

IDK

PHP Version

8.1.27

Operating System

No response

Browser

No response

Version

No response

Device

No response

Operating System

No response

Browser

No response

Version

No response

Error messages

No response

Additional context

No response

welcome[bot] commented 6 months ago

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can.

snipe commented 6 months ago

In your general settings, do you have the “show archived in lists” box checked or unchecked?

dboissat commented 6 months ago

Hello, In my instance, yes it's checked. But on the demo, I tested with the option unchecked and I observed the same behavior.