Skip to content

Sales Management

Applies to: SuperAdmin only. Last reviewed: 2026-11-18.

Sales Management is the part of DriveFlow where the platform owner keeps track of referral partners ("salespeople"), the driving schools they brought in, the commission those schools' subscription payments earned, and the payouts made to each salesperson.

It is platform data. It does not belong to any driving school, and no school role can open it, whatever permissions that role has.

Contents of this section

Page What it covers
This page Who can use Sales Management, the menu, the overall flow, and the Sales Dashboard
Salespeople Registering and maintaining salespeople and their referral codes
Customer Referrals How a school is linked to a salesperson and the rules for referral codes
Commission management The commission formula, worked examples, statuses, approving, refunds and clawbacks
Gateway Fee Settings The gateway fee rates used to estimate fees
Monthly commission reports The monthly report, its filters, columns and exports
Commission payments Recording payouts to salespeople

Who can use it

Action Who
Open any Sales Management page A user in the SuperAdmin role
Call any /api/admin/sales/... endpoint A user in the SuperAdmin role
Enter a referral code for their own school at checkout A school user with the Subscription.Manage permission (by default the Owner). See Customer Referrals

Important

The whole API controller carries [Authorize(Roles = "SuperAdmin")]. The check is on the role, not on a permission, so giving a school role every permission in the system still does not open Sales Management. The integration tests confirm this for every school role.

If someone who is not a SuperAdmin opens a Sales Management address directly (for example /sales), the page shows a lock icon with:

You don't have access to this page Sales Management is for DriveFlow administrators only.

and a Dashboard button that leads back to /dashboard. No data is requested from the server.

Where to find it

Sign in as a SuperAdmin. The left-hand menu shows one section, PLATFORM, with a group named Sales Management. Click the group to expand it.

Menu item Page title Address
Dashboard Sales Dashboard /sales
Salespeople Salespeople /sales/salespeople
Customer Referrals Customer Referrals /sales/referrals
Sales Commissions Sales Commissions /sales/commissions
Gateway Fee Settings Gateway Fee Settings /sales/gateway-fees
Monthly Reports Monthly Reports /sales/reports
Commission Payments Commission Payments /sales/payments

There is also a detail page for one salesperson at /sales/salespeople/{id}. It is opened by clicking a row on the Salespeople page.

Screenshot to be added

Screen: SuperAdmin sidebar. Should show: the PLATFORM section with the Sales Management group expanded, showing all seven items.

How the whole process fits together

flowchart TD
    A[SuperAdmin registers a salesperson<br/>Sales Management > Salespeople > Add Salesperson] --> B[The salesperson gets a referral code,<br/>for example DF-THILY-001]
    B --> C[A driving school enters the code before its first payment<br/>at checkout, or the SuperAdmin enters it under Subscriptions]
    C --> D[Referral is Awaiting first payment:<br/>it can still be changed or removed]
    D --> E[The school's first subscription payment is received]
    E --> F[Referral is locked. The salesperson's percentage and period<br/>at that moment become the school's agreed terms.<br/>The commission period starts.]
    F --> G[Each payment for a plan or a monthly add-on inside the period<br/>creates one commission with status Pending]
    G --> H[SuperAdmin approves it - Sales Commissions<br/>status Approved]
    H --> I[SuperAdmin pays the salesperson from the bank,<br/>then records the payout - Commission Payments<br/>status Paid]

If a school's payment is refunded or charged back, the SuperAdmin marks it under Sales Commissions. The commission becomes Reversed. If it had already been paid out, a negative "clawback" line is added and comes off the salesperson's next payout.

Note

DriveFlow never moves money to a salesperson. It only records what the SuperAdmin did at the bank.

Rules that apply everywhere in Sales Management

  • Amounts are shown in rand. Every money figure on these pages is formatted as R 1,234.56 (a negative figure as -R 1,234.56). Commissions and payouts are stored with a currency code, which is ZAR for every payment DriveFlow creates today.
  • Dates are shown as dd MMM yyyy, for example 18 Nov 2026.
  • Money is counted by the day the school's payment was received. Reports never use the date an invoice was created.
  • Day and month boundaries are in UTC. A payment received at 01:00 South African time on the 1st of a month was received at 23:00 UTC the day before, so it falls in the previous month in the dashboard and the monthly report.
  • Figures are snapshots. A commission stores the amount, the gateway fee and the percentage used when it was created. Later changes to a salesperson, a plan price or a gateway fee rate never change an existing commission.
  • Three totals are used on every page, and they always add up:
Total Meaning
Generated Commissions that are not Reversed. Clawback lines are left out.
Paid Commissions settled by a recorded payout. A clawback settled in a payout counts as a negative amount.
Outstanding Commissions that are Pending or Approved. A clawback that has not been settled yet counts as a negative amount.

Generated minus Paid equals Outstanding, and Paid equals the sum of the payouts recorded.

The Sales Dashboard

Menu: Sales Management > Dashboard

The dashboard shows how referrals and commissions performed over a date range.

Screenshot to be added

Screen: Sales Dashboard. Should show: the From/To filter, the nine summary cards and the four charts.

Choosing the period

  1. Open Sales Management > Dashboard.
  2. Set From and To. When the page opens, From is the first day of the month eleven months ago and To is today, so you see the last 12 months including the current one.
  3. Click Apply.

Rules for the range:

Situation What happens
To is before From A warning appears: "The end date can't be before the start date." Nothing is loaded.
The range covers more than 36 months The server refuses it and the page shows "Unable to load the dashboard. Choose a range of up to 36 months."

The note under the filter reads: "Money is counted by the day the school's payment was received; referrals by the day the code was applied."

Summary cards

Card What it counts Limited to the date range?
Registered Salespeople Every salesperson on record No
Active Salespeople Salespeople whose status is Active No
Referred Driving Schools Referrals whose code was applied inside the range Yes
Active Referred Customers Of those referrals, the schools whose current subscription status is Active. A school on trial is not counted. Yes
Revenue from Referrals The commissionable amount (without VAT) of the generated commissions Yes, by payment date
Gateway Fees The gateway fees on those commissions Yes, by payment date
Commissions Generated The commission on those commissions Yes, by payment date
Commissions Paid Commissions with a payment date in the range that a payout has settled Yes, by payment date
Outstanding Commissions Commissions with a payment date in the range that are Pending or Approved Yes, by payment date

Note

"Commissions Paid" is filtered by the date the school paid, not by the date you paid the salesperson. A payout you record today for a commission earned three months ago shows in the month the school's payment was received.

Charts

Chart Type What it shows per month
Referred customers per month Bar Number of referral codes applied
Subscription revenue from referrals Line Commissionable revenue
Commissions generated per month Bar Commission generated
Commissions paid versus outstanding Bar, two series (Paid, Outstanding) Paid and outstanding commission

Month labels look like Nov 26.

Top-performing salespeople

A table of up to five salespeople with the highest generated commission in the range.

Column Meaning
Salesperson Name, linked to the salesperson's detail page. If the salesperson record no longer exists the name reads "Removed salesperson".
Paying Customers Number of different schools whose payments earned this salesperson commission in the range
Commission Generated commission in the range

If nothing was earned the table reads "No commissions were earned in this period."

Audit trail

Sales Management has no separate audit log screen. What is recorded:

What Where it is kept
Who created and last changed each salesperson, gateway fee rate, referral, commission and payout, and when The CreatedBy, CreatedOn, ModifiedBy and ModifiedOn columns on each record. The database context fills these in on every save. They hold the user id, not the name.
When a commission was approved, paid or reversed ApprovedOn, PaidOn, ReversedOn on the commission
Why a commission was reversed ReversalReason on the commission (shown under the status on the Sales Commissions page)
Which payout settled a commission The payout reference, shown under the status as "Payout {reference}"
The figures a commission was calculated with Stored on the commission itself and never recalculated

Limits of this trail, so that nobody relies on more than exists:

  • Approving commissions in bulk and settling them in a payout are done with a direct database update. Those two actions set ApprovedOn/PaidOn and ModifiedOn, but they do not record which user did it.
  • Only the last change to a record is kept. There is no history of earlier values (for example the previous commission percentage of a salesperson).
  • The created-by and modified-by values are not shown on any page. They can only be read in the database.
  • The permission AuditLogs.View exists in the permission list, but there is no audit log page and no audit log table behind it.

Limitations and notes

  • There is no way to delete a salesperson, a commission, a gateway fee rate or a payout from the user interface or the API. A salesperson is switched off by changing the status. A gateway fee rate is switched off with the Active switch.
  • A payout cannot be edited or undone once recorded. The confirmation box says so: "This cannot be undone here."
  • Approval cannot be undone. An approved commission can only move on to Paid or Reversed.
  • Salespeople have no sign-in account. They cannot see their own figures. Everything is viewed and reported by the SuperAdmin.
  • No email or other notification is sent to a salesperson when a school uses the code, when a commission is created, or when a payout is recorded.
  • All figures are added together without regard to currency. This is correct today because every subscription payment is created in ZAR. If payments in another currency are ever added, the totals on the dashboard and reports would mix currencies.