Module StockMonitor

From Dolibarr ERP CRM Wiki
Jump to navigation Jump to search

Template:Module

Description

StockMonitor provides exhaustive monitoring of all stock movements in Dolibarr. It captures 100% of stock movements with full context including stack traces, HTTP request details, and user information. Ideal for auditing, debugging stock discrepancies, and monitoring warehouse activity.

Key Features

  • Complete movement capture — Monitors all stock movements via Dolibarr triggers (STOCK_MOVEMENT)
  • Full context logging — Records stack trace, HTTP method, URL, user agent and user ID for every movement
  • Advanced search — Filter movements by product, warehouse, date range, movement type (entry/exit), and source module
  • Multi-warehouse support — Proper handling of multiple warehouses with warehouse-specific filtering
  • Prefix detection — Automatic product reference prefix analysis to identify product families
  • Export — Export filtered movement data to Excel (XLSX), PDF and CSV
  • Dashboard statistics — Admin page showing total movements, data volume, and movement trends
  • Real-time trigger — No cron needed, movements are captured instantly via Dolibarr's trigger system

Installation

  1. Download the ZIP file from DoliStore
  2. Unzip the stockmonitor folder into your Dolibarr /htdocs/custom/ directory
  3. Go to Home → Setup → Modules and activate "StockMonitor"
  4. The trigger will automatically start capturing all stock movements

Usage

Viewing movements

  1. Navigate to Products → Stock Monitor
  2. Use the filters to search by product, warehouse, date, or type
  3. Click on any movement to see the full context (source module, stack trace, etc.)

Exporting data

  1. Apply your desired filters on the movement list
  2. Click "Export Excel", "Export PDF" or "Export CSV"
  3. The export respects all active filters

Prerequisites

  • Dolibarr >= 16.0
  • PHP >= 7.0
  • Stock module must be enabled
  • Optional: PhpSpreadsheet for Excel export

Links