Module: Mobile SFA v1.0.0
What is Mobile SFA?
Mobile Sales Force Automation for Perfex CRM — territories, routes, visits, orders, and collections via REST API
This module installs into modules/mobile_sfa/ 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
- Read How to Install and activate the module.
- Skim Features so you know what screens exist.
- Complete the Quick Start checklist on this page (Settings → masters → first sample record).
- Open each screen guide under Screen-by-screen guides when you need step-by-step help.
- 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 Mobile SFA:
- Activate — Setup → Modules → activate Mobile SFA (run Upgrade if prompted).
- Permissions — Setup → Staff → Roles → enable view/create/edit (and approve/settings if needed) for this module.
- Settings — Open Mobile SFA → Settings and save company defaults, prefixes, and integrations.
- Master data — Create the first required masters (products, warehouses, templates, channels, accounts, routes, etc.).
- First transaction — Create one sample record end-to-end (save → submit/approve → complete) and confirm it appears in lists/reports.
- Cron — If the module uses alerts, sync, queues, or AI, confirm Perfex CRM cron is scheduled on the server.
Full how-to guide (from module package)
The steps below come from the module author's printable guide — follow them in order for best results.
HOW TO USE — Mobile SFA for Perfex CRM (v1.0.0)
Author: Nasbix Technologies
1) INSTALLATION
- Extract the purchased ZIP.
2. Upload the "mobile_sfa" folder to:
/modules/mobile_sfa
- Login to Perfex CRM Admin.
4. Go to: Setup → Modules
- Find "Mobile SFA" and click Activate.
- Database tables and options are created automatically.
7. Assign permissions:
Setup → Staff → Roles / Permissions → Mobile SFA capabilities
2) FIRST-TIME SETUP
1. Open: SFA (sidebar) → Settings
2. Configure:
- Enable Mobile API
- Require device approval
- Session TTL / PIN length
- GPS / geofence options
- Orders sync target (invoice or estimate)
- Collections auto-sync + default payment mode
- Webhooks / push notifications (optional)
- Save settings.
3) DAILY WORKFLOW (ADMIN)
A. Master data
- SFA → Territories → create territory → assign clients
- SFA → Sales Reps → link staff + employee code + PIN
- SFA → Devices → approve pending devices
B. Field operations
- SFA → Routes → create daily beat / use templates
- SFA → Visits → monitor check-ins, map, activity
- SFA → Orders → review submitted orders → sync
- SFA → Collections → review payments → sync / PDF receipt
C. Insights
- SFA → Dashboard
- SFA → Executive Reports
D. Integrations (optional)
- SFA → API Keys
- SFA → Webhooks
4) MOBILE API
Base URL: {your-site}/mobile_sfa/api
Login example:
POST /mobile_sfa/api/auth/login
Content-Type: application/json
{
"employee_code": "REP-0001",
"pin": "1234",
"device_uuid": "unique-device-id",
"platform": "android",
"app_version": "1.0.0"
}
Use the returned token as:
Authorization: Bearer {token}
5) UNINSTALL
1. Setup → Modules → Deactivate Mobile SFA
2. Click Uninstall
3. Removes all msfa_* tables, options, and uploads/mobile_sfa/
4. Core Perfex CRM data is kept
6) SUPPORT
Open documentation/index.html
Include Perfex version, PHP version, and msfa_db_version
Author: Nasbix Technologies
Module documentation index
Start here — full guides for Mobile SFA:
- Overview & How to Use — what it is, who uses it, daily workflow
- Quick Start Guide — first 5 minutes + printable how-to
- How to Install — upload, activate, permissions, verify
- Features (Full Detail) — every capability explained
- FAQ & Tips — common questions and best practices
- Version & Changelog — version history
Screen-by-screen guides (each tab explained)
Click a menu item below for step-by-step instructions on that Mobile SFA screen:
- Dashboard
- Sales Reps
- Territories
- Mobile Devices
- Visits
- Routes & Beats
- Orders
- Collections
- Executive Reports
- Webhooks
- API Keys
- Settings
How to use in Perfex CRM (daily operations)
- Sign in to the admin area with a role that includes Mobile SFA permissions.
- Open Mobile Sfa (sidebar) or search for Mobile SFA 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 Perfex CRM cron ran and open the module log / failed queue screen if present.
Admin menu — where to work
Open the Mobile SFA section in the admin sidebar. Screens your staff may use (depending on role):
- API Keys
- Collections
- Dashboard
- Executive Reports
- Mobile Devices
- Orders
- Routes & Beats
- Sales Reps
- Settings
- SFA
- Territories
- Visits
- Webhooks
Screens map — what each menu is for
These are the admin screens registered by Mobile SFA. Click a name in the Knowledge Base for a full how-to, or open the path in admin.
| # | Screen | Admin path | Guide |
|---|---|---|---|
| 1 | Dashboard | admin/mobile_sfa | How to use |
| 2 | Sales Reps | admin/mobile_sfa/mobile_sfa_sales_reps | How to use |
| 3 | Territories | admin/mobile_sfa/mobile_sfa_territories | How to use |
| 4 | Mobile Devices | admin/mobile_sfa/mobile_sfa_devices | How to use |
| 5 | Visits | admin/mobile_sfa/mobile_sfa_visits | How to use |
| 6 | Routes & Beats | admin/mobile_sfa/mobile_sfa_routes | How to use |
| 7 | Orders | admin/mobile_sfa/mobile_sfa_orders | How to use |
| 8 | Collections | admin/mobile_sfa/mobile_sfa_collections | How to use |
| 9 | Executive Reports | admin/mobile_sfa/mobile_sfa_reports | How to use |
| 10 | Webhooks | admin/mobile_sfa/mobile_sfa_webhooks | How to use |
| 11 | API Keys | admin/mobile_sfa/mobile_sfa_api_keys | How to use |
| 12 | Settings | admin/mobile_sfa/mobile_sfa_settings | How to use |
Detailed guide — features, workflows, API & FAQ
Phase 1 (Complete) — Foundation
- Sales rep profiles linked to Perfex CRM staff
- Territory management with client assignment
- Mobile device registration & approval
- REST API for mobile app authentication
- API keys for integration partners
- Admin dashboard, permissions, audit logs
Phase 2 (Complete) — Visits & Check-In
- Customer visit check-in/check-out with GPS
- Visit types: sales call, delivery, collection, survey
- Geofence validation against client coordinates
- Photo attachments (base64 or multipart)
- Admin: visit list, map view, rep activity report
- Visit REST API endpoints
Phase 3 (Complete) — Beat & Route Planning
- Daily beat/route plans per sales rep
- Ordered customer stops with planned times
- Reusable weekly route templates
- Route compliance: planned vs actual visit matching
- Admin: route list, create/edit, templates, compliance report
- Optional sync to Distributors & Wholesalers
dw_routes - Route REST API endpoints
Phase 4 (Complete) — Mobile Order Taking
- Mobile order capture with line items
- Product catalog API (Perfex CRM items + optional DW pricing)
- Order workflow: Draft → Submitted → Synced
- Sync to Perfex CRM invoice or estimate
- Admin: order list, detail, manual sync
- Order REST API endpoints
Phase 5 (Complete) — Collections & Payments
- Field payment recording with multiple payment modes
- Customer outstanding balance & unpaid invoices API
- Auto/manual sync to Perfex CRM invoice payments
- Collection receipt PDF generation
- Accounting Pro integration via payment hooks
- Collection REST API endpoints
Phase 6 (Complete) — Offline Sync & Enterprise
- Offline batch sync (
POST /sync/batch) with idempotent client_ref - Delta sync bundle (
GET /sync/pull?since=) - Push notifications (FCM) + route stop reminders via cron
- Inventory Management stock API integration
- Distributors van stock API (driver staff link)
- Executive reports: rep productivity, territory coverage, route compliance
- Webhooks: visit.completed, order.synced, collection.recorded/synced
Mobile API
Base URL: {your-site}/mobile_sfa/api
Login
POST /mobile_sfa/api/auth/login
Content-Type: application/json
{
"employee_code": "REP-0001",
"pin": "1234",
"device_uuid": "unique-device-id",
"platform": "android",
"app_version": "1.0.0"
}
Response includes token — use as Authorization: Bearer {token} for subsequent requests.
Endpoints (Phase 1)
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| -------- | ---------- | ------ | ------------- |
| GET | /mobile_sfa/api | — | API discovery |
| POST | /mobile_sfa/api/auth/login | — | Sales rep login |
| POST | /mobile_sfa/api/auth/logout | Session | Logout |
| GET | /mobile_sfa/api/profile | Session | Rep profile |
| GET | /mobile_sfa/api/territories | Token | Assigned territories |
| GET | /mobile_sfa/api/customers | Session | Territory customers |
| GET | /mobile_sfa/api/customers/{id} | Session | Single customer |
| POST | /mobile_sfa/api/devices/register | Session | Register device |
| GET | /mobile_sfa/api/sync/status | Token | Feature flags |
Visits (Phase 2)
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| -------- | ---------- | ------ | ------------- |
| GET | /mobile_sfa/api/visits | Session | Visit history (filters: date_from, date_to, status) |
| GET | /mobile_sfa/api/visits/active | Session | Current open check-in |
| POST | /mobile_sfa/api/visits/check-in | Session | Start visit |
| POST | /mobile_sfa/api/visits/check-out | Session | End visit |
| GET | /mobile_sfa/api/visits/{id} | Session | Visit detail + photos |
| POST | /mobile_sfa/api/visits/{id}/photos | Session | Upload photo |
| POST | /mobile_sfa/api/visits/{id}/cancel | Session | Cancel open visit |
Routes (Phase 3)
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| -------- | ---------- | ------ | ------------- |
| GET | /mobile_sfa/api/routes | Session | Route list (filters: date_from, date_to, status) |
| GET | /mobile_sfa/api/routes/today | Session | Today's beat plan with stops |
| GET | /mobile_sfa/api/routes/{id} | Session | Route detail + stops + compliance |
| POST | /mobile_sfa/api/routes/stops/{id}/skip | Session | Skip a planned stop |
Orders (Phase 4)
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| -------- | ---------- | ------ | ------------- |
| GET | /mobile_sfa/api/products | Session | Product catalog (client_id for DW pricing) |
| GET | /mobile_sfa/api/orders | Session | Order history |
| POST | /mobile_sfa/api/orders/create | Session | Create draft order |
| POST | /mobile_sfa/api/orders/update | Session | Update draft order |
| POST | /mobile_sfa/api/orders/{id}/submit | Session | Submit order |
| POST | /mobile_sfa/api/orders/{id}/cancel | Session | Cancel order |
| GET | /mobile_sfa/api/orders/{id} | Session | Order detail + lines |
Collections (Phase 5)
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| -------- | ---------- | ------ | ------------- |
| GET | /mobile_sfa/api/customers/{id}/outstanding | Session | Unpaid invoices & balance |
| GET | /mobile_sfa/api/collections | Session | Collection history |
| POST | /mobile_sfa/api/collections/record | Session | Record field collection |
| GET | /mobile_sfa/api/collections/{id} | Session | Collection detail |
| GET | /mobile_sfa/api/collections/{id}/receipt | Session | Receipt PDF |
| POST | /mobile_sfa/api/collections/{id}/cancel | Session | Cancel collection |
Check-in example:
POST /mobile_sfa/api/visits/check-in
Authorization: Bearer {token}
Content-Type: application/json
{
"client_id": 12,
"visit_type": "sales_call",
"lat": 24.8607,
"lng": 67.0011,
"notes": "Met with store manager"
}
Permissions
| Feature | Capabilities |
|---|---|
| --------- | ------------- |
| Dashboard | view |
| Sales Reps | view, create, edit, delete |
| Territories | view, create, edit, delete |
| Devices | view, edit, delete |
| Visits | view, delete |
| Routes | view, create, edit, delete |
| Orders | view, edit (sync), delete |
| Collections | view, edit (sync), delete |
| Executive Reports | view |
| Webhooks | view, create, edit, delete |
| API Keys | view, create, delete |
| Settings | view, edit |
Roadmap
All 6 phases complete. See [docs/ROADMAP.md](docs/ROADMAP.md) for full history.
Design Principles
- No core changes — hooks + module folder only
- Uses Perfex CRM clients —
tblclientsfor customer master data - Optional integrations — Distributors & Wholesalers, Invoices, Inventory
- Incremental migrations — auto-upgrade via
msfa_maybe_upgrade_database() - Clean uninstall — drops all module tables, options, and uploads
How To Use
1. Settings
Open SFA → Settings. Enable Mobile API, set device approval, session TTL, GPS/geofence, order sync target, collections payment mode, and optional webhooks/push.
2. Territories & Sales Reps
- Create a territory and assign Perfex clients.
- Create a sales rep linked to a staff member, set employee code and PIN.
3. Devices
When a mobile app registers a device UUID, approve it under SFA → Devices (if approval is required).
4. Routes, Visits, Orders, Collections
- Routes — plan daily beats or use templates; track compliance.
- Visits — monitor GPS check-ins, map, and activity.
- Orders — review submitted mobile orders and sync to invoice/estimate.
- Collections — review field payments, sync to invoice payments, download receipt PDF.
5. Reports & Integrations
Use Executive Reports for productivity and coverage. Create API keys and webhooks for partners.
Also see HOW_TO_USE.txt in this documentation folder.
Features
- Sales reps, territories, devices
- GPS visits with geofence and photos
- Beat/route planning and compliance
- Mobile orders and field collections
- Offline sync, webhooks, push queue
- REST API + API keys
- Dashboard, permissions, audit logs
- Clean uninstall
REST API Overview
Base URL: {your-site}/mobile_sfa/api
POST /mobile_sfa/api/auth/login
Content-Type: application/json
{
"employee_code": "REP-0001",
"pin": "1234",
"device_uuid": "unique-device-id",
"platform": "android",
"app_version": "1.0.0"
}
Use Authorization: Bearer {token} for authenticated calls.
| Area | Examples |
|---|---|
| Auth | /auth/login, /auth/logout, /profile |
| Master | /territories, /customers, /products |
| Field | /visits/*, /routes/*, /orders/*, /collections/* |
| Sync | /sync/batch, /sync/pull, /sync/status |
Permissions
Assign under Setup → Staff → Roles. Capabilities include Dashboard, Sales Reps, Territories, Devices, Visits, Routes, Orders, Collections, Reports, Webhooks, API Keys, Settings.
Uninstall
- Setup → Modules → Deactivate Mobile SFA
- Click Uninstall
Removes all msfa_* tables, options, and uploads/mobile_sfa/. Core Perfex data is kept.
Cron Jobs
Webhooks retry, push queue, and route reminders run via Perfex main cron:
* * * * * php /path/to/perfex/index.php cron/index > /dev/null 2>&1
After activation — configuration checklist
- Go to Setup → Modules and activate Mobile SFA.
- Reload admin if needed — migrations run automatically.
- Assign permissions under Setup → Staff → Roles.
- Open SFA → Settings and configure the module.
- Perfex CRM 2.3+ / 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 Mobile SFA.
- Setup → Staff → Roles → assign Mobile SFA permissions (view, create, edit, delete, approve, export, settings as needed).
- Open Mobile SFA → Settings and complete company defaults, prefixes, integrations, and notification options.
- Create master data (warehouses, products, templates, accounts, routes, etc.) before processing live transactions.
- Enable Perfex CRM cron (
php /path/to/perfex/index.php cron/index) for sync, retries, alerts, and scheduled jobs. - 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 Mobile SFA. 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/mobile_sfa/. 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.
Perfex CRM Knowledge Base — detailed usage guide generated from module README, HOW_TO_USE, and documentation.