
Inventory valuation plays a vital role in accurate accounting, cost control, and financial reporting. In Dolibarr, a popular open-source ERP/CRM, the default method for stock valuation is PMP (Prix Moyen Pondéré, or Weighted Average Price). While PMP is straightforward and commonly used, many businesses prefer the FIFO (First In, First Out) method for various operational, financial, and regulatory reasons.
This article explores the differences between PMP and FIFO, explains how FIFO can be applied within Dolibarr, and provides a comprehensive step-by-step implementation guide. By the end of this post, you'll understand the implications of choosing FIFO over PMP and how to properly configure and use it within your Dolibarr setup.
Understanding PMP and FIFO in Inventory Valuation
Dolibarr allows businesses to manage products, warehouses, stock movements, and valuations. By default, Dolibarr uses PMP for calculating inventory values.
-
PMP (Weighted Average Price): Each time you receive new stock, Dolibarr recalculates the average unit cost of all stock items. This average cost is then used to value outgoing stock.
-
FIFO (First In, First Out): FIFO assumes that the oldest inventory (the first received) is the first to be sold or used. This means the cost of goods sold reflects the oldest purchase prices, and the ending inventory reflects the most recent costs.
While PMP smooths out price fluctuations, FIFO is more realistic in many industries where stock rotates chronologically.
Why Use FIFO Instead of PMP?
There are several compelling reasons to switch from PMP to FIFO in Dolibarr:
-
Better Cost Tracking: FIFO aligns better with physical inventory flow, especially in perishable goods, chemicals, or pharmaceuticals.
-
Improved Profit Accuracy: FIFO offers a more accurate reflection of gross profit during inflationary periods, since older, cheaper inventory is accounted as sold first.
-
Regulatory Requirements: In some countries or industries, FIFO is the preferred or mandatory method for tax and compliance.
-
Inventory Rotation Logic: Many businesses operate physically on a FIFO basis, so matching accounting logic to operational flow helps prevent discrepancies.
-
Clearer Historical Price Visibility: FIFO retains original purchase prices, which helps during audits or cost analyses.
Limitations of PMP in Practice
While PMP simplifies calculations, it can cause challenges:
-
Price fluctuations are averaged, potentially hiding spikes or dips
-
It's harder to trace which batch a specific sale originated from
-
In scenarios of variable supply costs, PMP can distort margin analysis
For high-value or sensitive products, FIFO provides clearer insights.
Can Dolibarr Support FIFO Natively?
As of version 19.0.1, Dolibarr does not include native FIFO stock valuation in its core. The stock module primarily calculates using PMP. However, FIFO can be implemented through customization, third-party modules, or external stock valuation scripts.
Approaches to Implement FIFO in Dolibarr
Here are three practical approaches to implement FIFO within Dolibarr:
1. Manual FIFO Tracking with Batches/Lots
Dolibarr allows batch/lot number tracking for products.
Steps:
-
Enable batch management in product settings
-
Assign batch/lot numbers when receiving stock
-
When issuing stock, select the oldest lot manually
Pros:
-
Fully traceable by lot
-
Reflects FIFO manually
Cons:
-
Requires user discipline
-
Not automated for accounting valuation
Use this method for industries with strict lot tracking (e.g., food or pharmaceuticals).
2. Custom FIFO Valuation Reports via SQL or External Scripts
Since Dolibarr stores stock movement data with timestamps, it's possible to create external FIFO reports.
Steps:
-
Export stock movement logs (table:
llx_stock_mouvement
) -
Build a FIFO queue of incoming stock
-
Deduct stock chronologically and calculate costs accordingly
-
Generate a report matching FIFO valuation
Tools:
-
Custom PHP scripts
-
Python (pandas)
-
SQL views and procedures
Pros:
-
Accurate FIFO valuation
-
Can integrate with accounting exports
Cons:
-
Requires development skills
-
Not reflected inside Dolibarr UI
Best for businesses with in-house tech teams or external consultants.
3. Third-Party FIFO Modules for Dolibarr
Some modules in the Dolibarr ecosystem provide extended stock valuation functionalities.
Examples:
-
Dolistore FIFO costing modules
-
Custom-developed ERP enhancements
Before purchasing or deploying, ensure:
-
Compatibility with your Dolibarr version
-
Support and documentation availability
-
Alignment with accounting workflows
Setting Up FIFO-Compatible Stock Management
Even without native FIFO, you can prepare your Dolibarr instance to operate FIFO-logically.
-
Enable Lot/Batch Tracking:
-
Go to Setup > Modules > Products
-
Enable “Manage batches / lot numbers”
-
Configure warehouse settings
-
-
Train Warehouse Staff:
-
Always pick stock from oldest lot first
-
Enforce inventory rotation
-
-
Audit Trail with Movement Logs:
-
Use Tools > Audit logs or SQL tools to analyze FIFO adherence
-
-
Create Custom Reporting Dashboards:
-
Use Dolibarr’s export functions
-
Generate FIFO cost reports externally
-
-
Link with Accounting:
-
Tag FIFO valuations in journal entries
-
Use references from movement logs to support cost calculations
-
Example Use Case: FIFO in a Food Distribution Business
A company selling packaged food wants to use FIFO due to expiration concerns.
Setup:
-
Each incoming shipment is logged with batch number and date
-
Sales orders are fulfilled starting from oldest batch
-
Inventory movement reports show stock leaving in chronological order
-
Monthly script calculates value of goods sold based on FIFO
Impact:
-
Reduced spoilage
-
Improved audit trail
-
Better gross margin reporting
Risks and Considerations When Switching to FIFO
-
Data Accuracy: Manual lot selection must be consistent
-
Integration with Accounting: Ensure the accounting team understands and records FIFO-based costs
-
System Limitations: Reports must be generated outside Dolibarr unless using enhanced modules
-
Migration Challenges: Transitioning from PMP to FIFO may require recalculating past data
Future of FIFO in Dolibarr Core
There’s ongoing community discussion about integrating multiple stock valuation methods (FIFO, LIFO, Standard Cost, etc.) into Dolibarr’s core. Until then, community modules and customization remain necessary.
Track the Dolibarr roadmap and GitHub issues for updates.
Conclusion: FIFO with Dolibarr Is Possible—and Powerful
While Dolibarr defaults to PMP, using FIFO for stock valuation is both feasible and beneficial. Whether you're in a highly regulated sector or simply want more precise cost tracking, FIFO can improve transparency, accuracy, and decision-making.
You can start by enabling lot tracking and enforcing manual FIFO, or go further by generating FIFO reports or implementing a module. Regardless of the approach, combining FIFO logic with Dolibarr’s flexible architecture can yield powerful results for your inventory and financial workflows.
For long-term success, align your operations, training, and reporting around the FIFO methodology and monitor developments in Dolibarr's roadmap for native support in future releases.