Distributors & Wholesalers Management — Overview & How to Use

Module: Distributors & Wholesalers Management v1.0.0

What is Distributors & Wholesalers Management?

Complete distributors and wholesalers management — brands, products, warehouses, inventory, sales orders, and reports.

This module installs into modules/distributors_wholesalers/ and adds its own admin menus, permissions, and database tables — without editing Perfex CRM core files.

Who should use this module?

  • Admins — activate the module, configure Settings, assign roles, and manage integrations.
  • Operators / day-to-day staff — create and update records (orders, attendance, shipments, messages, etc.).
  • Managers / approvers — review queues, approve workflows, and monitor dashboards/KPIs.
  • Finance / compliance / ops leads — run reports, exports, and audit trails when the module supports them.

What you can achieve

  • Keep all related work in one place inside Perfex CRM instead of spreadsheets.
  • Control who can view, create, edit, approve, or export with role permissions.
  • Use dashboards and reports to see status, bottlenecks, and history.
  • Connect to other CRM data (customers, invoices, items, staff) where the module integrates.

Recommended learning path

  1. Read How to Install and activate the module.
  2. Skim Features so you know what screens exist.
  3. Complete the Quick Start checklist on this page (Settings → masters → first sample record).
  4. Open each screen guide under Screen-by-screen guides when you need step-by-step help.
  5. Check Version & Changelog after upgrades for new options.

Tip: Train one admin first, then create a limited role for operators so they only see the screens they need.

5-minute Quick Start

Follow this short path the first time you use Distributors & Wholesalers Management:

  1. Activate — Setup → Modules → activate Distributors & Wholesalers Management (run Upgrade if prompted).
  2. Permissions — Setup → Staff → Roles → enable view/create/edit (and approve/settings if needed) for this module.
  3. Settings — Open Distributors & Wholesalers Management → Settings and save company defaults, prefixes, and integrations.
  4. Master data — Create the first required masters (products, warehouses, templates, channels, accounts, routes, etc.).
  5. First transaction — Create one sample record end-to-end (save → submit/approve → complete) and confirm it appears in lists/reports.
  6. Cron — If the module uses alerts, sync, queues, or AI, confirm Perfex CRM cron is scheduled on the server.

Module documentation index

Start here — full guides for Distributors & Wholesalers Management:

How to use in Perfex CRM (daily operations)

  1. Sign in to the admin area with a role that includes Distributors & Wholesalers Management permissions.
  2. Open Distributors Wholesalers (sidebar) or search for Distributors & Wholesalers Management in the admin menu.
  3. Start on the Dashboard (if available) to see open tasks, pending approvals, and KPIs.
  4. Review Settings after upgrades — new options may need defaults for your company.
  5. Create or import master data first; most modules block transactions until masters exist.
  6. Run the main business flow (create → submit → approve → post/complete) using the screens listed in Admin menu below.
  7. Use Reports / Analytics screens to reconcile stock, finance, compliance, or SLA metrics.
  8. For integrations (API, EDI, gateways, tax), confirm credentials in Settings and monitor logs or webhook delivery screens.
  9. Train staff with role-based access — give approvers approve permissions only, operators create/edit on their area.
  10. If something fails overnight, check Perfex CRM cron ran and open the module log / failed queue screen if present.

Admin menu — where to work

Open the Distributors & Wholesalers Management section in the admin sidebar. Screens your staff may use (depending on role):

  • Account Statement
  • Analytics
  • Brands
  • Categories
  • Commissions
  • Dashboard
  • Delivery Routes
  • Distributors
  • Integrations
  • Inventory
  • Pick Lists
  • Place Order
  • Price Lists
  • Product Catalog
  • Products
  • Promotions
  • Quick Order
  • Rebates
  • Reports
  • REST API
  • Sales Orders
  • Sales Returns
  • Settings
  • Shipments
  • Territory Managers
  • Transfer Requests
  • Vans
  • Van Sales
  • Warehouses
  • Webhooks

Detailed guide — features, workflows, API & FAQ

Module status

AreaStatus
--------------
Product master (brands, categories, products)Complete
Multi-warehouse inventory & lot trackingComplete
Distributor management & statementsComplete
Sales orders, returns, invoicingComplete
Price lists, commissions, promotions, rebatesComplete
Pick/pack/ship, transfer requestsComplete
Barcode pick-list scannerComplete
Tier auto-upgrade + rebate accrual cronComplete
Report export rate limitingComplete
Van sales, routes, mobile APIComplete
REST API with rate limitingComplete
Client portal (orders, catalog, statement)Complete
Webhooks with URL validationComplete
Territory manager RBACComplete
Security hardening (MIME, SSRF, CSRF, territory scope)Complete
CodeCanyon packaging (LICENSE, CHANGELOG, docs)Complete
Complete uninstall cleanupComplete

Features

  • Product master via Perfex CRM Items + module extension fields
  • Distributors via Perfex CRM Clients + credit limits, territories, customer tiers, statements
  • Multi-warehouse stock (internal engine or Nasbix Inventory Management)
  • Sales order workflow: draft → approval → partial/full delivery → invoice
  • Tiered & volume pricing via price lists
  • Sales rep commission rules (calculated on delivery)
  • Multi-currency sales orders
  • REST API (Bearer token) for products, distributors, orders, stock
  • Distributor client portal (orders, catalog, self-service ordering, statement, repeat order)
  • Audit trail on sales orders and commission payouts
  • Automatic credit hold on overdue invoices
  • Commission payout workflow (approve / mark paid / export)
  • Pick/pack/ship workflow with pick lists and shipment records
  • Batch/lot tracking with FIFO consumption and expiry alerts
  • Transfer requests with optional approval workflow
  • Promotions & coupon codes with auto-apply and redemption tracking
  • Volume rebate programs with tiered accruals and payout workflow
  • Outbound webhooks with HMAC signatures, delivery log, and cron retry queue
  • Analytics dashboard (KPIs, trends, promotion ROI, top distributors)
  • Van sales with mobile stock, route stops, and cash collections
  • Delivery routes with driver assignment, stop visits, and completion webhooks
  • Dashboard/analytics query caching for scale
  • REST API pagination (limit, offset, since)
  • Sales returns with optional Perfex CRM credit notes
  • 11 report types with Excel/PDF export
  • Territory manager scoping for field teams
  • Integration with Purchase Management (GRN, reorder PO)

Languages

English (source), French, Arabic, and Urdu. Rebuild translations from English:

php modules/distributors_wholesalers/language/build_locales.php --force

Permissions

PermissionDescription
-------------------------
dw_brandsBrand management
dw_productsProducts
dw_warehousesWarehouses
dw_inventoryStock operations
dw_distributorsDistributor master
dw_sales_ordersSales orders
dw_sales_returnsSales returns
dw_price_listsPrice lists & customer tiers
dw_commissionsCommission rules
dw_promotionsPromotions & coupons
dw_rebatesRebate programs
dw_webhooksOutbound webhooks
dw_analyticsAnalytics dashboard
dw_vansVan fleet & van stock
dw_routesDelivery routes
dw_van_salesField van sales
dw_apiREST API keys
dw_reportsReports
dw_territoriesTerritory assignments
dw_settingsModule settings

Finance rules (v1.8+)

  • Ledger: Delivered orders count as receivable only when no Perfex CRM invoice is linked. Invoices are the receivable source once created.
  • Receivables aging: Uninvoiced delivered orders + open invoice balances + opening balance. No double-counting.
  • Tax mapping: Invoices and credit notes created from orders/returns include Perfex CRM line taxes from item tax settings, with fallback to calculated or default rate.

REST API (v1.8+)

Enable in module settings (dw_enable_rest_api). Create API keys under Distributors & Wholesalers → REST API.

Authentication uses the Authorization: Bearer {token} header only.

GET  /distributors_wholesalers/api/products
GET  /distributors_wholesalers/api/distributors
GET  /distributors_wholesalers/api/orders
GET  /distributors_wholesalers/api/orders/{id}
POST /distributors_wholesalers/api/orders
GET  /distributors_wholesalers/api/stock
GET  /distributors_wholesalers/api/vans?van_id={id}
GET  /distributors_wholesalers/api/routes?date=YYYY-MM-DD
POST /distributors_wholesalers/api/van_sales
Authorization: Bearer {token}

Van/route endpoints require Enable van/route mobile API in module settings.

Client portal (v1.8+)

Distributor contacts see Sales Orders and Account Statement in the client area at /clients/dw/*.

Tests

Install dev dependencies once:

cd modules/distributors_wholesalers && composer install

Unit tests (no database):

composer test

Related modules

  • Inventory Management — optional stock engine
  • Purchase Management — GRN sync, reorder purchase orders

Extended module documentation

Table of contents

  1. [Overview](#overview)
  2. [Installation](#installation)
  3. [Menu & permissions](#menu--permissions)
  4. [Sales order workflow](#sales-order-workflow)
  5. [Finance & receivables](#finance--receivables)
  6. [REST API](#rest-api)
  7. [Client portal](#client-portal)
  8. [Webhooks](#webhooks)
  9. [Integrations](#integrations)
  10. [Security](#security)
  11. [Uninstall](#uninstall)

---

Overview

Distributors & Wholesalers extends Perfex CRM for wholesale and distribution operations:

AreaDescription
-------------------
ProductsPerfex CRM Items + dw_product_details extension
DistributorsPerfex CRM Clients + dw_distributor_details extension
StockMulti-warehouse engine or Nasbix Inventory Management
OrdersFull order-to-cash with approval, delivery, invoicing
Field salesVan stock, routes, mobile API

Version 1.8.6 — all six implementation phases complete.

---

Menu & permissions

Admin path: Distributors & Wholesalers (sidebar)

PermissionFeature
---------------------
dw_brands / dw_categories / dw_productsProduct master
dw_warehouses / dw_inventoryStock
dw_distributorsDistributor master
dw_sales_orders / dw_sales_returnsOrder workflow
dw_price_lists / dw_commissionsPricing & incentives
dw_promotions / dw_rebatesPromotions
dw_webhooks / dw_apiIntegrations
dw_vans / dw_routes / dw_van_salesField sales
dw_analytics / dw_reportsReporting
dw_territoriesField team scoping
dw_settingsModule configuration

Each permission supports: view, create, edit, delete, approve.

---

Sales order workflow

Statuses: draft → pending_approval → approved → partially_delivered → delivered → invoiced

  1. Create order (admin, quick order, or client portal).
  2. Credit limit and approval threshold checks on submit.
  3. Approve → pick list (optional auto-create) → ship → deliver.
  4. Create Perfex CRM invoice from delivered order.
  5. Commission calculated on delivery; promotions/rebates applied per settings.

---

Finance & receivables

  • Delivered orders without invoice count as receivable.
  • Once invoiced, Perfex CRM invoice is the receivable source (no double-count).
  • Distributor statements combine ledger entries, open invoices, and uninvoiced deliveries.
  • Credit hold blocks new orders when overdue threshold exceeded.

---

REST API

Enable in Settings (dw_enable_rest_api). Create keys under REST API.

Authorization: Bearer {token}
MethodEndpoint
------------------
GET/distributors_wholesalers/api/products
GET/distributors_wholesalers/api/distributors
GET/POST/distributors_wholesalers/api/orders
GET/distributors_wholesalers/api/stock
GET/distributors_wholesalers/api/vans
GET/distributors_wholesalers/api/routes
POST/distributors_wholesalers/api/van_sales
  • Read/write scopes per key
  • Rate limit per key (default 60/min; configurable)
  • Bearer header only — query-string tokens are not accepted
  • Pagination: limit, offset, since on list endpoints

---

Client portal

Distributor contacts access /clients/dw/*:

  • Order list and detail
  • Product catalog and self-service ordering
  • Repeat order from previous order
  • Account statement (PDF)

Requires distributor flag on client record and portal ordering enabled in settings.

---

Webhooks

Configure under Distributors & Wholesalers → Webhooks.

Events: order.created, order.approved, order.delivered, order.partially_delivered, order.invoiced, shipment.created, van_sale.completed, route.completed.

  • HMAC-SHA256 signature in X-DW-Signature header
  • Only public HTTP/HTTPS URLs accepted (private/reserved IPs blocked)
  • Delivery log with response codes

---

Integrations

ModuleIntegration
---------------------
Inventory ManagementStock sync via warehouse mapping
Purchase ManagementGRN posting, reorder PO from low-stock suggestions

---

Security

ControlImplementation
-------------------------
Admin authPerfex CRM AdminController session
Permissions20 feature groups with approve capability
Territory RBACNon-admin staff with territory assignments see scoped data only
API authSHA-256 hashed tokens, Bearer header, rate limits
CSRFPerfex CRM forms + AJAX hash refresh
UploadsExtension whitelist + MIME validation
WebhooksURL validation, HMAC signatures
SQL/XSSParameterized queries, e() / html_escape() in views

Run smoke tests:

php modules/distributors_wholesalers/tests/dw_logic_test.php

---

Extended module documentation

Table of contents

  1. [Overview](#overview)
  2. [Installation](#installation)
  3. [Menu & permissions](#menu--permissions)
  4. [Sales order workflow](#sales-order-workflow)
  5. [Finance & receivables](#finance--receivables)
  6. [REST API](#rest-api)
  7. [Client portal](#client-portal)
  8. [Webhooks](#webhooks)
  9. [Integrations](#integrations)
  10. [Security](#security)
  11. [Uninstall](#uninstall)

---

Overview

Distributors & Wholesalers extends Perfex CRM for wholesale and distribution operations:

AreaDescription
-------------------
ProductsPerfex CRM Items + dw_product_details extension
DistributorsPerfex CRM Clients + dw_distributor_details extension
StockMulti-warehouse engine or Nasbix Inventory Management
OrdersFull order-to-cash with approval, delivery, invoicing
Field salesVan stock, routes, mobile API

Version 1.8.6 — all six implementation phases complete.

---

Menu & permissions

Admin path: Distributors & Wholesalers (sidebar)

PermissionFeature
---------------------
dw_brands / dw_categories / dw_productsProduct master
dw_warehouses / dw_inventoryStock
dw_distributorsDistributor master
dw_sales_orders / dw_sales_returnsOrder workflow
dw_price_lists / dw_commissionsPricing & incentives
dw_promotions / dw_rebatesPromotions
dw_webhooks / dw_apiIntegrations
dw_vans / dw_routes / dw_van_salesField sales
dw_analytics / dw_reportsReporting
dw_territoriesField team scoping
dw_settingsModule configuration

Each permission supports: view, create, edit, delete, approve.

---

Sales order workflow

Statuses: draft → pending_approval → approved → partially_delivered → delivered → invoiced

  1. Create order (admin, quick order, or client portal).
  2. Credit limit and approval threshold checks on submit.
  3. Approve → pick list (optional auto-create) → ship → deliver.
  4. Create Perfex CRM invoice from delivered order.
  5. Commission calculated on delivery; promotions/rebates applied per settings.

---

Finance & receivables

  • Delivered orders without invoice count as receivable.
  • Once invoiced, Perfex CRM invoice is the receivable source (no double-count).
  • Distributor statements combine ledger entries, open invoices, and uninvoiced deliveries.
  • Credit hold blocks new orders when overdue threshold exceeded.

---

REST API

Enable in Settings (dw_enable_rest_api). Create keys under REST API.

Authorization: Bearer {token}
MethodEndpoint
------------------
GET/distributors_wholesalers/api/products
GET/distributors_wholesalers/api/distributors
GET/POST/distributors_wholesalers/api/orders
GET/distributors_wholesalers/api/stock
GET/distributors_wholesalers/api/vans
GET/distributors_wholesalers/api/routes
POST/distributors_wholesalers/api/van_sales
  • Read/write scopes per key
  • Rate limit per key (default 60/min; configurable)
  • Bearer header only — query-string tokens are not accepted
  • Pagination: limit, offset, since on list endpoints

---

Client portal

Distributor contacts access /clients/dw/*:

  • Order list and detail
  • Product catalog and self-service ordering
  • Repeat order from previous order
  • Account statement (PDF)

Requires distributor flag on client record and portal ordering enabled in settings.

---

Webhooks

Configure under Distributors & Wholesalers → Webhooks.

Events: order.created, order.approved, order.delivered, order.partially_delivered, order.invoiced, shipment.created, van_sale.completed, route.completed.

  • HMAC-SHA256 signature in X-DW-Signature header
  • Only public HTTP/HTTPS URLs accepted (private/reserved IPs blocked)
  • Delivery log with response codes

---

Integrations

ModuleIntegration
---------------------
Inventory ManagementStock sync via warehouse mapping
Purchase ManagementGRN posting, reorder PO from low-stock suggestions

---

Security

ControlImplementation
-------------------------
Admin authPerfex CRM AdminController session
Permissions20 feature groups with approve capability
Territory RBACNon-admin staff with territory assignments see scoped data only
API authSHA-256 hashed tokens, Bearer header, rate limits
CSRFPerfex CRM forms + AJAX hash refresh
UploadsExtension whitelist + MIME validation
WebhooksURL validation, HMAC signatures
SQL/XSSParameterized queries, e() / html_escape() in views

Run smoke tests:

php modules/distributors_wholesalers/tests/dw_logic_test.php

---

Features

Complete distributors and wholesalers management for Perfex CRM — by Nasbix Technologies.

  • Product master via Perfex CRM Items + module extension fields
  • Distributors via Perfex CRM Clients + credit limits, territories, customer tiers, statements
  • Multi-warehouse stock (internal engine or Nasbix Inventory Management)
  • Sales order workflow: draft → approval → partial/full delivery → invoice
  • Tiered & volume pricing via price lists
  • Sales rep commission rules (calculated on delivery)
  • Multi-currency sales orders
  • REST API (Bearer token) for products, distributors, orders, stock
  • Distributor client portal (orders, catalog, self-service ordering, statement, repeat order)
  • Audit trail on sales orders and commission payouts
  • Automatic credit hold on overdue invoices
  • Commission payout workflow (approve / mark paid / export)
  • Pick/pack/ship workflow with pick lists, barcode scanner, and shipment records
  • Distributor tier auto-upgrade from rolling sales (optional cron)
  • Scheduled rebate accrual rebuild and report export rate limits
  • Batch/lot tracking with FIFO consumption and expiry alerts
  • Transfer requests with optional approval workflow
  • Promotions & coupon codes with auto-apply and redemption tracking
  • Volume rebate programs with tiered accruals and payout workflow
  • Outbound webhooks with HMAC signatures, delivery log, and cron retry queue
  • Analytics dashboard (KPIs, trends, promotion ROI, top distributors)
  • Van sales with mobile stock, route stops, and cash collections

Permissions

Granular staff capabilities are registered on activation. Assign them under Setup → Staff → Roles for the Distributors & Wholesalers 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 Perfex CRM's main cron. Example crontab (every minute):

* * * * * php /path/to/perfex_crm/index.php cron/index > /dev/null 2>&1

Module cron hooks (via after_cron_run): low-stock alerts, webhook retry queue, rebate accrual rebuild, and distributor tier auto-upgrade. Toggle rebate and tier jobs under module Settings.

After activation — configuration checklist

  1. Go to Setup → Modules and activate Distributors & Wholesalers Management.
  2. If prompted, click Upgrade Database or reload admin — migrations run automatically.
  3. Assign permissions under Setup → Staff → Roles.
  4. Open the module menu and configure settings.
  5. Perfex CRM 3.0+
  6. PHP 7.4+ (8.1+ recommended)
  7. MySQL 5.7+ / MariaDB 10.3+ (InnoDB)
  8. PHP extensions: mysqli, json, mbstring, curl, fileinfo

One-time setup (first time only)

  1. Setup → Modules → activate Distributors & Wholesalers Management.
  2. Setup → Staff → Roles → assign Distributors & Wholesalers Management permissions (view, create, edit, delete, approve, export, settings as needed).
  3. Open Distributors & Wholesalers Management → Settings and complete company defaults, prefixes, integrations, and notification options.
  4. Create master data (warehouses, products, templates, accounts, routes, etc.) before processing live transactions.
  5. Enable Perfex CRM cron (php /path/to/perfex/index.php cron/index) for sync, retries, alerts, and scheduled jobs.
  6. Optionally enable REST API / webhooks in module settings if you integrate external systems.

Tips for success

  • Always configure Settings before creating live transactions.
  • Create master data (items, warehouses, templates, channels, accounts) first — most modules block incomplete records.
  • Use a test/sample record before going live with real customers or production stock.
  • Separate roles: operators create/edit; managers approve; finance/reporting get view/export only.
  • After any module upgrade, reopen Settings and confirm new options have sensible defaults.
  • If overnight jobs fail, verify Perfex CRM cron and check the module log / failed queue screen.

Common questions (FAQ)

Where do I find the module after activation?

In the admin sidebar look for Distributors & Wholesalers Management. If missing, your role may lack view permission — fix under Setup → Staff → Roles.

Do I need to edit core Perfex CRM files?

No. Keep all custom code under modules/distributors_wholesalers/. Activate/deactivate from Setup → Modules.

What happens if I uninstall?

Deactivate keeps data. Uninstall usually removes module tables/options (see the Install article). Core customers, invoices, and items are not deleted by well-built modules.

Why can't my staff see a screen?

Almost always a permissions issue. Give the role at least view on that feature, then ask the user to log out and back in.

Reports/export buttons do nothing

Confirm the role has export (or view reports) permission, and that filters return at least one row. Try PDF/CSV from a wider date range.

FAQ from module documentation

Support

Nasbix Technologies — module changes are scoped to modules/distributors_wholesalers/ only; core Perfex CRM files are not modified.

Support

Nasbix Technologies — module scoped to modules/distributors_wholesalers/ only.

See also: README.md, UPGRADE.md, CHANGELOG.md, docs/ROADMAP.md.

Support

Nasbix Technologies — module scoped to modules/distributors_wholesalers/ only.

See also: README.md, UPGRADE.md, CHANGELOG.md, docs/ROADMAP.md.


Perfex CRM Knowledge Base — detailed usage guide generated from module README, HOW_TO_USE, and documentation.

Did you find this article useful?