Mobile SFA — Overview & How to Use

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

  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 Mobile SFA:

  1. Activate — Setup → Modules → activate Mobile SFA (run Upgrade if prompted).
  2. Permissions — Setup → Staff → Roles → enable view/create/edit (and approve/settings if needed) for this module.
  3. Settings — Open Mobile SFA → 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.

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

  1. Extract the purchased ZIP.

2. Upload the "mobile_sfa" folder to:

/modules/mobile_sfa

  1. Login to Perfex CRM Admin.

4. Go to: Setup → Modules

  1. Find "Mobile SFA" and click Activate.
  2. 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)

  1. 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:

Screen-by-screen guides (each tab explained)

Click a menu item below for step-by-step instructions on that Mobile SFA screen:

How to use in Perfex CRM (daily operations)

  1. Sign in to the admin area with a role that includes Mobile SFA permissions.
  2. Open Mobile Sfa (sidebar) or search for Mobile SFA 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 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.

#ScreenAdmin pathGuide
1Dashboardadmin/mobile_sfaHow to use
2Sales Repsadmin/mobile_sfa/mobile_sfa_sales_repsHow to use
3Territoriesadmin/mobile_sfa/mobile_sfa_territoriesHow to use
4Mobile Devicesadmin/mobile_sfa/mobile_sfa_devicesHow to use
5Visitsadmin/mobile_sfa/mobile_sfa_visitsHow to use
6Routes & Beatsadmin/mobile_sfa/mobile_sfa_routesHow to use
7Ordersadmin/mobile_sfa/mobile_sfa_ordersHow to use
8Collectionsadmin/mobile_sfa/mobile_sfa_collectionsHow to use
9Executive Reportsadmin/mobile_sfa/mobile_sfa_reportsHow to use
10Webhooksadmin/mobile_sfa/mobile_sfa_webhooksHow to use
11API Keysadmin/mobile_sfa/mobile_sfa_api_keysHow to use
12Settingsadmin/mobile_sfa/mobile_sfa_settingsHow 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)

MethodEndpointAuthDescription
-------------------------------------
GET/mobile_sfa/api—API discovery
POST/mobile_sfa/api/auth/login—Sales rep login
POST/mobile_sfa/api/auth/logoutSessionLogout
GET/mobile_sfa/api/profileSessionRep profile
GET/mobile_sfa/api/territoriesTokenAssigned territories
GET/mobile_sfa/api/customersSessionTerritory customers
GET/mobile_sfa/api/customers/{id}SessionSingle customer
POST/mobile_sfa/api/devices/registerSessionRegister device
GET/mobile_sfa/api/sync/statusTokenFeature flags

Visits (Phase 2)

MethodEndpointAuthDescription
-------------------------------------
GET/mobile_sfa/api/visitsSessionVisit history (filters: date_from, date_to, status)
GET/mobile_sfa/api/visits/activeSessionCurrent open check-in
POST/mobile_sfa/api/visits/check-inSessionStart visit
POST/mobile_sfa/api/visits/check-outSessionEnd visit
GET/mobile_sfa/api/visits/{id}SessionVisit detail + photos
POST/mobile_sfa/api/visits/{id}/photosSessionUpload photo
POST/mobile_sfa/api/visits/{id}/cancelSessionCancel open visit

Routes (Phase 3)

MethodEndpointAuthDescription
-------------------------------------
GET/mobile_sfa/api/routesSessionRoute list (filters: date_from, date_to, status)
GET/mobile_sfa/api/routes/todaySessionToday's beat plan with stops
GET/mobile_sfa/api/routes/{id}SessionRoute detail + stops + compliance
POST/mobile_sfa/api/routes/stops/{id}/skipSessionSkip a planned stop

Orders (Phase 4)

MethodEndpointAuthDescription
-------------------------------------
GET/mobile_sfa/api/productsSessionProduct catalog (client_id for DW pricing)
GET/mobile_sfa/api/ordersSessionOrder history
POST/mobile_sfa/api/orders/createSessionCreate draft order
POST/mobile_sfa/api/orders/updateSessionUpdate draft order
POST/mobile_sfa/api/orders/{id}/submitSessionSubmit order
POST/mobile_sfa/api/orders/{id}/cancelSessionCancel order
GET/mobile_sfa/api/orders/{id}SessionOrder detail + lines

Collections (Phase 5)

MethodEndpointAuthDescription
-------------------------------------
GET/mobile_sfa/api/customers/{id}/outstandingSessionUnpaid invoices & balance
GET/mobile_sfa/api/collectionsSessionCollection history
POST/mobile_sfa/api/collections/recordSessionRecord field collection
GET/mobile_sfa/api/collections/{id}SessionCollection detail
GET/mobile_sfa/api/collections/{id}/receiptSessionReceipt PDF
POST/mobile_sfa/api/collections/{id}/cancelSessionCancel 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

FeatureCapabilities
----------------------
Dashboardview
Sales Repsview, create, edit, delete
Territoriesview, create, edit, delete
Devicesview, edit, delete
Visitsview, delete
Routesview, create, edit, delete
Ordersview, edit (sync), delete
Collectionsview, edit (sync), delete
Executive Reportsview
Webhooksview, create, edit, delete
API Keysview, create, delete
Settingsview, edit

Roadmap

All 6 phases complete. See [docs/ROADMAP.md](docs/ROADMAP.md) for full history.

Design Principles

  1. No core changes — hooks + module folder only
  2. Uses Perfex CRM clients — tblclients for customer master data
  3. Optional integrations — Distributors & Wholesalers, Invoices, Inventory
  4. Incremental migrations — auto-upgrade via msfa_maybe_upgrade_database()
  5. 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

  1. Create a territory and assign Perfex clients.
  2. 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.

AreaExamples
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

  1. Setup → Modules → Deactivate Mobile SFA
  2. 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

  1. Go to Setup → Modules and activate Mobile SFA.
  2. Reload admin if needed — migrations run automatically.
  3. Assign permissions under Setup → Staff → Roles.
  4. Open SFA → Settings and configure the module.
  5. Perfex CRM 2.3+ / 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

Staff permissions (from module)

Assign under Setup → Staff → Roles. Each feature can expose different actions:

FeatureActions
Dashboard
msfa_dashboard
view
Sales Reps
msfa_sales_reps
view, create, edit, delete
Territories
msfa_territories
view, create, edit, delete
Mobile Devices
msfa_devices
view, edit, delete
Visits
msfa_visits
view, delete
Routes & Beats
msfa_routes
view, create, edit, delete
Orders
msfa_orders
view, edit, delete
Collections
msfa_collections
view, edit, delete
API Keys
msfa_api
view, create, delete
Settings
msfa_settings
view, edit
Webhooks
msfa_webhooks
view, create, edit, delete
Executive Reports
msfa_reports
view

One-time setup (first time only)

  1. Setup → Modules → activate Mobile SFA.
  2. Setup → Staff → Roles → assign Mobile SFA permissions (view, create, edit, delete, approve, export, settings as needed).
  3. Open Mobile SFA → 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 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.

Did you find this article useful?