Module: Inventory Management v1.1.0
Enterprise inventory management module for BIXCRM
Screen-by-screen guides (each tab explained)
Click a menu item below for step-by-step instructions on that Inventory Management screen:
- Dashboard
- Warehouses
- Locations / Bins
- Stock Overview
- Opening Stock
- Stock Movements
- Stock Transfers
- Stock Adjustments
- Batch & Serial Tracking
- Reorder Rules
- Low Stock Alerts
- Purchase Receiving
- Reports
- Audit Logs
- Settings
How to use in BIXCRM (daily operations)
- Sign in to the admin area with a role that includes Inventory Management permissions.
- Open Inventory Management (sidebar) or search for Inventory Management in the admin menu.
- Start on the Dashboard (if available) to see open tasks, pending approvals, and KPIs.
- Review Settings after upgrades — new options may need defaults for your company.
- Create or import master data first; most modules block transactions until masters exist.
- Run the main business flow (create → submit → approve → post/complete) using the screens listed in Admin menu below.
- Use Reports / Analytics screens to reconcile stock, finance, compliance, or SLA metrics.
- For integrations (API, EDI, gateways, tax), confirm credentials in Settings and monitor logs or webhook delivery screens.
- Train staff with role-based access — give approvers approve permissions only, operators create/edit on their area.
- If something fails overnight, check BIXCRM cron ran and open the module log / failed queue screen if present.
Admin menu — where to work
Open the Inventory Management section in the admin sidebar. Screens your staff may use (depending on role):
- Audit Logs
- Batch & Serial Tracking
- Dashboard
- Inventory
- Locations / Bins
- Low Stock Alerts
- Opening Stock
- Purchase Receiving
- Reorder Rules
- Reports
- Settings
- Stock
- Stock Adjustments
- Stock Movements
- Stock Overview
- Stock Transfers
- Warehouses
Detailed guide — features, workflows, API & FAQ
Features
Dashboard & stock
- Live dashboard with stock value, movement trends, low-stock count, and expiring items
- Multi-warehouse stock overview with batch/serial/expiry columns
- Opening stock entry
- Stock movements ledger (full audit trail)
Warehouses & locations
- Warehouse CRUD with manager assignment
- Bin/location management (zone, aisle, rack, shelf, bin code)
Operations
- Stock transfers — draft → approval → in transit → received workflow
- Stock adjustments — increase/decrease with optional approval
- Reorder rules — min/max qty per item/warehouse
- Low stock alerts — in-app notifications and email (realtime + cron)
Batch, serial & expiry
- Batch/serial tracking on stock rows
- Batch/serial CRUD with status badges
- Expiry alerts for stock nearing expiration
Purchase integration
- Syncs with Purchase Management module (
modules/purchase_management/) - GRN posting updates inventory stock and creates movements
- GRN cancel reverses stock correctly
- Mirrors GRN records in
inventory_purchase_receives
Reports & audit
- Stock valuation, movement, transfer, adjustment, and expiry reports
- CSV export on supported reports
- Full audit log viewer with detail view and CSV export
BIXCRM integration
- Invoice stock deduction (configurable trigger: manual, creation, sent, paid)
- Credit note stock restoration (v1.1.0)
- Invoice cancel/delete stock restoration (v1.1.0)
- Estimate stock reservation (optional)
- “Manage Stock” link on invoice item modal and items list
REST API (v1.1.0)
- Read-only endpoints for warehouses, stock, movements, and low stock
- API key authentication (
X-INV-API-Key) - Disabled by default — enable in Settings
Cron & email alerts
- Low stock alerts from reorder rules
- Expiry alerts from stock rows within alert window
- Cooldown deduplication via
inventory_alert_logs - Recipients: warehouse manager, optional extra staff IDs, active admins
---
Requirements
| Requirement | Notes |
|---|---|
| ------------- | ------- |
| BIXCRM | 2.3.x or later |
| PHP | 7.4+ (8.x supported) |
| MySQL / MariaDB | InnoDB |
| BIXCRM cron | Required for scheduled alerts |
| Purchase Management | Optional — for GRN sync |
---
Permissions
| Feature key | Capabilities | Menu area |
|---|---|---|
| ------------- | -------------- | ----------- |
inventory_management | view | Dashboard |
inventory_dashboard | view | Dashboard widget |
inventory_warehouse | view, create, edit, delete | Warehouses, Locations |
inventory_stock | view, create, edit, adjust | Stock, Movements, Transfers*, Adjustments*, Batches, Reorder, Purchases |
inventory_transfer | view, create, approve, receive | Stock transfers |
inventory_adjustment | view, create, approve | Stock adjustments |
inventory_reports | view, export | Reports, Audit logs |
inventory_settings | view, edit | Settings |
\* Transfer and adjustment capabilities use their own feature keys when approval workflows apply.
---
Quick start
- Create a warehouse — Inventory Management → Warehouses
- Add locations (optional) — Inventory Management → Locations / Bins
- Enter opening stock — Inventory Management → Opening Stock
- Set reorder rules — Inventory Management → Reorder Rules
- Review dashboard — Inventory Management → Dashboard
---
Settings reference
| Option | Default | Description |
|---|---|---|
| -------- | --------- | ------------- |
inventory_enable_negative_stock | 0 | Allow stock to go below zero |
inventory_stock_deduction_trigger | manual | When invoices deduct stock |
inventory_enable_batch_tracking | 1 | Track batch numbers on stock |
inventory_enable_serial_tracking | 1 | Track serial numbers on stock |
inventory_enable_expiry_alerts | 1 | Include expiry in cron alerts |
inventory_expiry_alert_days | 30 | Days ahead for expiry alerts |
inventory_default_warehouse | 0 | Default warehouse for operations |
inventory_valuation_method | average | average or fifo |
inventory_auto_reorder_alerts | 1 | Low stock notifications |
inventory_transfer_approval_required | 1 | Transfers need approval |
inventory_adjustment_approval_required | 1 | Adjustments need approval |
inventory_show_item_tab | 1 | Show stock links on items |
inventory_enable_estimate_reservation | 0 | Reserve stock on estimates |
inventory_sync_purchase_management | 1 | Sync GRN from Purchase Management |
inventory_cron_alerts_enabled | 1 | Run alerts on BIXCRM cron |
inventory_cron_email_alerts | 1 | Send email in addition to notifications |
inventory_cron_alert_cooldown_hours | 24 | Hours before same alert repeats |
inventory_cron_alert_staff_ids | (empty) | Comma-separated extra staff IDs |
inventory_restore_stock_on_credit_note | 1 | Restore stock when credit note is created |
inventory_restore_stock_on_invoice_cancel | 1 | Restore stock when invoice cancelled/deleted |
inventory_api_enabled | 0 | Enable read-only REST API |
inventory_api_key | (auto-generated) | Send as header X-INV-API-Key |
Configure under Inventory Management → Settings. Use Run Alerts Now to test cron alerts without waiting for the scheduler.
---
Workflows
Stock transfer
Draft → Request approval → Approved → In transit → Received
↓ ↓
Rejected Cancelled
When approval is required (default), stock is reserved/deducted at the appropriate stage and received into the destination warehouse.
Stock adjustment
Draft → Pending approval → Approved (stock updated)
↓
Rejected
Low stock alert
Triggered when available_qty <= min_qty on an active reorder rule:
- Realtime — on stock update via
inventory_management_notify_low_stock() - Cron — scans all reorder rules on each cron run
- Respects cooldown per item/warehouse combination
Expiry alert
Triggered when stock has expiry_date within inventory_expiry_alert_days and qty_available > 0.
---
Purchase Management integration
When Purchase Management is installed and sync is enabled:
| Hook | Action |
|---|---|
| ------ | -------- |
pm_after_grn_posted | Increase stock, create movement, mirror receive record |
pm_after_grn_cancelled | Reverse stock (deduct qty added by GRN) |
pm_after_purchase_return_completed | Audit log entry |
Stock updates are idempotent — duplicate movements for the same reference are prevented.
Manual purchase receiving is still available under Inventory Management → Purchase Receiving for non-GRN workflows.
---
Cron alerts
Registered with BIXCRM via:
after_cron_run→inventory_management_cron_handlernumbers_of_features_using_cron_job— counts this module when enabledused_cron_features— shows “Inventory Management stock & expiry alerts”
Recipients (in order):
- Warehouse manager (
inventory_warehouses.manager_id) - Extra staff from
inventory_cron_alert_staff_ids - All active admin staff
Deduplication: Alerts are logged in inventory_alert_logs. The same alert key is not sent again within the cooldown window.
---
BIXCRM hooks used
Outbound (this module registers)
| Hook | Handler |
|---|---|
| ------ | --------- |
after_invoice_added | Stock deduction on invoice creation |
invoice_status_changed | Stock deduction on sent/paid |
after_payment_added | Stock deduction when invoice paid |
after_estimate_added/updated/deleted | Stock reservation |
before_invoice_item_modal_form_close | “Manage Stock” button |
app_admin_footer | Item list stock link |
pm_after_grn_posted | Purchase sync |
pm_after_grn_cancelled | Purchase sync reversal |
pm_after_purchase_return_completed | Purchase return audit |
after_invoice_deleted | Restore stock on invoice delete |
invoice_marked_as_cancelled | Restore stock on invoice cancel |
after_create_credit_note | Restore stock on credit note |
created_credit_note_from_invoice | Restore stock (idempotent) |
after_cron_run | Low stock & expiry alerts |
Filters
| Filter | Purpose |
|---|---|
| -------- | --------- |
get_dashboard_widgets | Dashboard widget |
numbers_of_features_using_cron_job | Cron feature count |
used_cron_features | Cron feature label |
---
Development notes
Items table column
BIXCRM stores items in tblitems with primary key id, not itemid. Dropdowns alias id AS itemid via inventory_management_get_items(). Always join on items.id.
Date filters in queries
Avoid CodeIgniter query builder with DATE() or DATE_FORMAT() in WHERE clauses — use raw SQL or datetime ranges. This prevents DataTables infinite loading and dashboard SQL errors.
DataTables JSON format
Server-side tables must return:
{
"draw": 1,
"iTotalRecords": 0,
"iTotalDisplayRecords": 0,
"aaData": []
}
Use inventory_management_get_table_path() for table view paths.
Paths in module code
Prefer FCPATH . 'modules/inventory_management/' over module_dir_path() inside models and helpers.
Helper functions (common)
| Function | Purpose |
|---|---|
| ---------- | --------- |
inventory_management_can($cap, $feature) | Permission check |
inventory_update_stock() | Increase/decrease stock |
inventory_create_movement() | Log stock movement |
inventory_create_audit_log() | Write audit entry |
inventory_get_low_stock_items() | Low stock query |
inventory_management_dispatch_alert() | Send notification + email |
---
Troubleshooting
| Symptom | Likely cause | Fix |
|---|---|---|
| --------- | -------------- | ----- |
| Stock Overview table spins forever | Wrong items join (itemid vs id) | Ensure joins use items.id |
| Dashboard SQL error | DATE_FORMAT in query builder WHERE | Use raw SQL (fixed in Stock_model) |
| GRN cancel adds stock | Wrong qty direction in purchase sync | Update Purchase Management helper |
| No cron alerts | Cron not running or alerts disabled | Enable cron + settings; use Run Alerts Now |
| Duplicate alert emails | Cooldown too low | Increase inventory_cron_alert_cooldown_hours |
| Purchase sync not working | PM module inactive or sync disabled | Enable PM module + setting |
| Item stock link missing | Setting disabled or wrong page | Enable inventory_show_item_tab; check invoice items page |
Check Setup → Activity Log for inventory cron summaries and sync errors.
---
Extended module documentation
Requirements
| Item | Version |
|---|---|
| ------ | --------- |
| BIXCRM | 2.3.x+ |
| PHP | 7.4+ (8.x supported) |
| MySQL / MariaDB | InnoDB |
| BIXCRM cron | Required for scheduled alerts |
Optional: Purchase Management module for GRN sync.
---
Permissions
| Feature | Capabilities |
|---|---|
| --------- | ------------- |
inventory_management | view (dashboard) |
inventory_warehouse | view, create, edit, delete |
inventory_stock | view, create, edit, adjust |
inventory_transfer | view, create, approve, receive |
inventory_adjustment | view, create, approve |
inventory_reports | view, export |
inventory_settings | view, edit |
---
Workflows
Stock transfer
Draft → Requested → Approved → In transit → Completed
↓
Rejected / Cancelled
Stock adjustment
Draft → Pending approval → Approved
↓
Rejected
Sales integration
| Event | Stock action |
|---|---|
| ------- | ------------- |
| Invoice (per trigger setting) | Deduct stock (sale_issue) |
| Credit note created | Restore stock (stock_return) |
| Invoice cancelled/deleted | Restore net remaining stock |
Settings control credit note and invoice restoration independently.
---
REST API
Enable under Settings → API Settings.
| Endpoint | Description |
|---|---|
| ---------- | ------------- |
GET /inventory_management/api | Module info |
GET /inventory_management/api/warehouses | All warehouses |
GET /inventory_management/api/stock | Stock rows (filter: warehouse_id) |
GET /inventory_management/api/stock/{item_id} | Stock for one item |
GET /inventory_management/api/movements | Recent movements (filters: item_id, warehouse_id, movement_type, limit) |
GET /inventory_management/api/low_stock | Low stock from reorder rules |
Authentication: Header X-INV-API-Key: your-key or query ?api_key=your-key
API is read-only and disabled by default.
---
Purchase Management integration
| Hook | Action |
|---|---|
| ------ | -------- |
pm_after_grn_posted | Increase stock + mirror receive |
pm_after_grn_cancelled | Audit (stock reversed by PM) |
pm_after_purchase_return_completed | Audit log |
---
Cron alerts
Registered on after_cron_run. Sends low-stock and expiry alerts with cooldown deduplication via inventory_alert_logs.
---
Extended module documentation
Requirements
| Item | Version |
|---|---|
| ------ | --------- |
| BIXCRM | 2.3.x+ |
| PHP | 7.4+ (8.x supported) |
| MySQL / MariaDB | InnoDB |
| BIXCRM cron | Required for scheduled alerts |
Optional: Purchase Management module for GRN sync.
---
Permissions
| Feature | Capabilities |
|---|---|
| --------- | ------------- |
inventory_management | view (dashboard) |
inventory_warehouse | view, create, edit, delete |
inventory_stock | view, create, edit, adjust |
inventory_transfer | view, create, approve, receive |
inventory_adjustment | view, create, approve |
inventory_reports | view, export |
inventory_settings | view, edit |
---
Workflows
Stock transfer
Draft → Requested → Approved → In transit → Completed
↓
Rejected / Cancelled
Stock adjustment
Draft → Pending approval → Approved
↓
Rejected
Sales integration
| Event | Stock action |
|---|---|
| ------- | ------------- |
| Invoice (per trigger setting) | Deduct stock (sale_issue) |
| Credit note created | Restore stock (stock_return) |
| Invoice cancelled/deleted | Restore net remaining stock |
Settings control credit note and invoice restoration independently.
---
REST API
Enable under Settings → API Settings.
| Endpoint | Description |
|---|---|
| ---------- | ------------- |
GET /inventory_management/api | Module info |
GET /inventory_management/api/warehouses | All warehouses |
GET /inventory_management/api/stock | Stock rows (filter: warehouse_id) |
GET /inventory_management/api/stock/{item_id} | Stock for one item |
GET /inventory_management/api/movements | Recent movements (filters: item_id, warehouse_id, movement_type, limit) |
GET /inventory_management/api/low_stock | Low stock from reorder rules |
Authentication: Header X-INV-API-Key: your-key or query ?api_key=your-key
API is read-only and disabled by default.
---
Purchase Management integration
| Hook | Action |
|---|---|
| ------ | -------- |
pm_after_grn_posted | Increase stock + mirror receive |
pm_after_grn_cancelled | Audit (stock reversed by PM) |
pm_after_purchase_return_completed | Audit log |
---
Cron alerts
Registered on after_cron_run. Sends low-stock and expiry alerts with cooldown deduplication via inventory_alert_logs.
---
Features
Enterprise inventory management module for BIXCRM
- Live dashboard with stock value, movement trends, low-stock count, and expiring items
- Multi-warehouse stock overview with batch/serial/expiry columns
- Opening stock entry
- Stock movements ledger (full audit trail)
- Warehouse CRUD with manager assignment
- Bin/location management (zone, aisle, rack, shelf, bin code)
- **Stock transfers** — draft → approval → in transit → received workflow
- **Stock adjustments** — increase/decrease with optional approval
- **Reorder rules** — min/max qty per item/warehouse
- **Low stock alerts** — in-app notifications and email (realtime + cron)
- Batch/serial tracking on stock rows
- Batch/serial CRUD with status badges
- Expiry alerts for stock nearing expiration
- Syncs with **Purchase Management** module (`modules/purchase_management/`)
- GRN posting updates inventory stock and creates movements
- GRN cancel reverses stock correctly
- Mirrors GRN records in `inventory_purchase_receives`
- Stock valuation, movement, transfer, adjustment, and expiry reports
- CSV export on supported reports
- Full audit log viewer with detail view and CSV export
Permissions
Granular staff capabilities are registered on activation. Assign them under Setup → Staff → Roles for the Inventory Management capability group.
Typical capabilities include view, create, edit, delete, plus module-specific actions (approve, export, settings, API access).
Cron Jobs
Background tasks (if enabled) run through BIXCRM's main cron. Example crontab (every 5 minutes):
* * * * * php /path/to/bixcrm/index.php cron/index > /dev/null 2>&1
Check module settings for scheduled jobs (alerts, sync, reports, retention).
After activation — configuration checklist
- Go to Setup → Modules and activate Inventory Management.
- If prompted, click Upgrade Database or reload admin — migrations run automatically.
- Assign permissions under Setup → Staff → Roles.
- Open the module menu and configure settings.
- BIXCRM 3.0+
- PHP 7.4+ (8.1+ recommended)
- MySQL 5.7+ / MariaDB 10.3+ (InnoDB)
- PHP extensions: mysqli, json, mbstring, curl, fileinfo
One-time setup (first time only)
- Setup → Modules → activate Inventory Management.
- Setup → Staff → Roles → assign Inventory Management permissions (view, create, edit, delete, approve, export, settings as needed).
- Open Inventory Management → Settings and complete company defaults, prefixes, integrations, and notification options.
- Create master data (warehouses, products, templates, accounts, routes, etc.) before processing live transactions.
- Enable BIXCRM cron (
php /path/to/bixcrm/index.php cron/index) for sync, retries, alerts, and scheduled jobs. - Optionally enable REST API / webhooks in module settings if you integrate external systems.
BIXCRM Knowledge Base — usage guide generated from module README and documentation.