Dolibarr / dolibarr

Dolibarr ERP CRM is a modern software package to manage your company or foundation's activity (contacts, suppliers, invoices, orders, stocks, agenda, accounting, ...). it's an open source Web application (written in PHP) designed for businesses of any sizes, foundations and freelancers.
https://www.dolibarr.org
GNU General Public License v3.0
5.13k stars 2.69k forks source link

Feature Request - Quarantine warehouse #26384

Open Ashley-Butcher opened 9 months ago

Ashley-Butcher commented 9 months ago

Feature Request

It would be useful to be able to mark a warehouse as a quarantine warehouse. This would allow stock to be recorded in inventory but be unavailable for order, without having to implement stock lotting and inventory quality recording.

A quarantine warehouse should function exactly the same as a normal warehouse, only with a boolean flag "Quarantine" set to "true" which indicates that this stock is not to be proposed on a sales order when preparing a shipment.

Use case

Dolibarr doesn't have any quality control processes, which makes rigidly implementing GxP difficult, but not impossible.

Helpful would be the ability to control the quality of the stock. At the very least, damaged stock or returned stock should be in a quarantined status pending a quality control. To do this simply, stock can enter a quarantine warehouse where it is isolated from the main stock and cannot be sold by accident.

Implementing a quarantine warehouse is a simple but very effective way of adding a small level quality control.

Scenario 1:

Scenario 2:

Scenario 3:

Suggested implementation

The simplest implemention is as follows:

  1. An additional "warehouse type" is added to the "Warehouse" settings with the possibility for two values, "Normal" (existing behaviour) and "Quarantine" (modified behavior)
  2. When creating an order shipment, any stock in a warehouse marked as "quarantine" is not considered as available
  3. Optional: If an order shipment contains a line with the warehouse set to a quarantine warehouse, display a warning that stock is emanating from a quarantine warehouse.

Suggested steps

  1. Add a "warehouse type" field to the warehouse record (llx_entrepot) of integer type with values 0 = "Normal" and 1 = "Quarantine" (maybe this can be extended in future with 'transit', but that's a user story for another day)
  2. Adjust logic when creating a shipment on a sales order that stock in a quarantine warehouse is not considered as available for sale - i.e. adjust the query that checks for stock to exclude stock in a warehouse that is marked as quarantine (type = 1)
  3. Optional: If a shipment is made with a quantity from a quarantine warehouse, adjust the order shipment page to display a warning that stock is emanating from a quarantine warehouse.
altairis-tof commented 9 months ago

Hello, maybe the constant ENTREPOT_EXTRA_STATUS already do the job ? https://wiki.dolibarr.org/index.php?title=Setup_Other#Stocks

Ashley-Butcher commented 9 months ago

@altairis-tof Well spotted :) It's close but not quite. The "internal" warehouse status would also prohibit reception (i.e. if you want to process QA steps on purchased items such as contract-manufactured goods and only release after QC pass on goods prior to sale), and won't allow you to sell the quarantine goods if you explicitly choose that warehouse (i.e. you are performing a liquidation on damaged items).

Now of course some of this could be handled by instead having inventory lotting (as would be needed for doing FIFO/LIFO costing too) with quantity parameters linked to lots, ABC analysis, etc. but this is all too complex for Dolibarr at this stage IMHO. Simpler to just implement a quarantine warehouse type to support some basic GxP processes.

josett225 commented 9 months ago

Hi there This is a great idea as all the warehouse cannot be included in the sales order process. Due to this Dolibarr limitation, in our side we developed a custom module based on virtual stocks and using stock hook. In the custom module admin, we select the warehouses that can be sold. If the warehouses are selected, they are used in the virtual stock calculation. Therefore a stock has all the features of a normal stock but cannot be sold.

Ashley-Butcher commented 9 months ago

@josett225 This is a good idea functionally to use virtual stock in this way if all you need is to block the inventory from sale, but it breaks when you need to separate your tangible stock from virtual stock for valuation.

Virtual stock is future/maybe stock and doesn't count when you look at inventory valuation. When you prepare an inventory value report, you should be looking at quantities and values such as landed cost of your physical inventory.

By having a dedicated quarantine warehouse, in the manner described, you don't need to jump through hoops to calculate your inventory value as the physical quantities are correctly registered.

josett225 commented 9 months ago

Hi @Ashley-Butcher You are totally right concerning the stock valuation. I am as you dealing with several stocks entries with return products, manufacturing stocks, reception orders with quality checks, several shops, b2c, b2b and e-commerce sites. Any improvement on stock and warehouses features is a must. Our solution is a workaround for now. Your proposal makes sense for me. But until it will be (or not) included in the core, we need to use some workarounds to simplify our business workflow.

DaBootO commented 1 month ago

Hello together,

We were having a similar need (quarantine warehouse "clogging up" the stock calculation in the product list. Therefore I brewed up this PR. Happy to hear feedback.