Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request - Quarantine warehouse #26384

Open
Ashley-Butcher opened this issue Oct 27, 2023 · 6 comments · May be fixed by #30199
Open

Feature Request - Quarantine warehouse #26384

Ashley-Butcher opened this issue Oct 27, 2023 · 6 comments · May be fixed by #30199
Labels
Feature request This is a feature request

Comments

@Ashley-Butcher
Copy link

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:

  • Customer returns an item they no longer want
  • Item should be returned to stock in the quarantine warehouse pending examination to answer if it can be resold, and if it can be resold as what quality (New/A-stock, Damaged/Used/B-stock, etc.)
  • If the item can be resold, it can be moved to a main warehouse

Scenario 2:

  • Items have been damaged in the warehouse, i.e. water damage
  • Items should be then moved to the quarantine warehouse pending a quality examination and decision to destroy, gift, rework, repurpose, etc.

Scenario 3:

  • Items have expired
  • To avoid accidentally shipping, items should be moved to a quarantine space pending destruction, donation, etc.

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.
@Ashley-Butcher Ashley-Butcher added the Feature request This is a feature request label Oct 27, 2023
@altairis-tof
Copy link
Contributor

altairis-tof commented Oct 30, 2023

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

@Ashley-Butcher
Copy link
Author

@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
Copy link
Contributor

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
Copy link
Author

@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
Copy link
Contributor

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 added a commit to DaBootO/dolibarr that referenced this issue Jun 29, 2024
…ting warehouses e.g. quarantine

This feature complements the need explained in Dolibarr#26384 and the implementation of the STATUS_OPENEXT_ALL warehouse type. With the changes a warehouse can be used e.g. as a quarantine warehouse or a temporary pre-QC warehouse. The status "Open (omitted from stock calculation)" keeps the definition vague enough as not to constrain the use of this status too much in the sense of "either quarantine or pre-QC".
For code-readability and convenience the change is using the load_stock and loadWarehouses implementation. As the option of warehouseclosed, warehouseopen and warehouseinternal is already introduced in the code we can piggyback ride with the introduction of the STATUS_OPENEXT_ALL onto the product list view, stock transfer, delivery selection etc.
@DaBootO
Copy link
Contributor

DaBootO commented Jun 29, 2024

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.

DaBootO added a commit to DaBootO/dolibarr that referenced this issue Jun 30, 2024
…non-counting warehouses e.g. quarantine"

This reverts commit 0d069b4.
DaBootO added a commit to DaBootO/dolibarr that referenced this issue Jul 1, 2024
…on-counting warehouses e.g. quarantine

This feature implements the global variable of STOCK_USE_WAREHOUSE_USAGE. This variable allows warehouses to exclude their products from stock calculations. A button was added to the stock module in the admin panel. A simple "AND" check for the warehouse_usage column in the entrepot SQL table is added to the load_stock function to facilitate this change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature request This is a feature request
Projects
None yet
4 participants