# Stock numbers does not add up

**URL:** <https://www.dolibarr.org/forum/t/stock-numbers-does-not-add-up/30380>\
**Category:** PM modules\
**Created:** [May 28, 2025, 11:00am UTC](https://www.dolibarr.org/forum/t/stock-numbers-does-not-add-up/30380 "2025-05-28T11:00:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonbendtsen](https://www.dolibarr.org/forum/letter_avatar_proxy/v4/letter/j/977dab/32.png) [@jonbendtsen](https://www.dolibarr.org/forum/u/jonbendtsen)\
**Post date:** [May 28, 2025, 11:01am UTC](https://www.dolibarr.org/forum/t/stock-numbers-does-not-add-up/30380/1 "2025-05-28T11:01:00Z")

</div>

Dolibarr version 21.0.1 - docker image

My stock numbers does not add up, seems like it is counting invoices, and not quantity on invoices. Am I wrong, or is this a bug?

My “product” in question is a service, and I have enabled stockmanagement for services.  
Looking at the stock tab for this service I see 5+12

 ![service_stocks](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/7/7673cc454cf915530e8a425baac89cd5c07aa1e4.png)

It does not matter if I change the date on /product/stock/stockatdate.php?mode=future&productid=128 it is still always 5+12 - when will this change?

Using the API I get the same - /api/index.php/products/128/stock

```auto
{
  "stock_reel": -5,
  "stock_theorique": -12,
  "stock_warehouses": {
    "1": {
      "real": "-5",
      "id": "68"
    }
  }
}

```

Looking at related items I see 17 invoices, and 5+12 is 17. But 3 of those 17 invoices have the same service twice on them. So the numbers should be 20, not 17?  
/product/stats/facture.php?showmessage=1&id=128

 ![related_items](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/4/47a3a0b49d6a92a4be751cfef32bac5cc0f8ae80.png)

Is this a bug, or how do I get accurate stock numbers that adds up?

Here is my stock module configuration

 ![configuration_stock_decrease](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/f/f4c7d7e8f0f6bc80bc5cc12ddfe6900acfaaf6b9.png)  
 ![configuration_stock_increase](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/1/16f8377a89f891186538ada8b21f3df9855342f1.png)  
 ![configuration_stock_negative](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/a/a5498b3a5f0d1b99c9d0dd99e904df25d153c103.png)  
 ![configuration_stock_other](https://www.dolibarr.org/forum/uploads/dolibarrorg/original/2X/8/83f88a41724474ae195c9313c8f76304f6036ef2.png)
