When an invoice is paid or a consultation session lands in the right status, the system writes one or more Commission rows. for the seller, the provider, the booking agent, or the agent's supervisor. The amount is the resolved rate × the line's base. Reversal happens automatically when the invoice is voided, refunded, deleted, or the session is cancelled.

How a commission amount is decided#

1. Which rate applies (precedence)#

For every commission-eligible line, the engine picks a percentage in this order. first match wins.

  1. Per-staff override. If the staff member's HR record has a custom commission rate, that wins.
  2. Per-product rate. If the catalog product/service carries its own commission rate, that's next.
  3. Tenant policy default. Service items use default service %; product items use default product %.
  4. Zero. If none of the above resolves a rate, no commission is created.

The whole engine has a master switch. when it's off, no rates resolve and no rows are written.

2. The base#

The policy's base mode decides what the rate is applied to:

  • Net sales revenue (NSR), the default. Line total minus discount, minus tax.
  • Gross profit. NSR minus the line's cost snapshot. Use this when commissions should track margin instead of revenue. The base is clamped to zero when cost exceeds NSR — commission never goes negative.

Individual rules can opt to subtract cashback, additional discounts, taxes, or the line's service/product cost from the base before the rate applies. each subtraction is one toggle on a rule (see workflow guide).

3. The amount#

commission_amount = base × rate / 100

Each Commission row is created with the rate that resolved at the moment of the trigger. Later edits to the rate or product don't recompute historical rows.

Status flow#

  • Pending. The default state for newly created rows. Awaiting HR review.
  • Approved. HR signs off, or auto-approval kicks in for small amounts (configurable). This is also the trigger for optional GL posting.
  • Paid. The next pay run paid the commission out.
  • Reversed. A void / refund / session cancel rolled the row back. for paid rows, the claw-back mode decides what happens.
  • Cancelled. Manually struck by HR before approval.

For staff#

  • Open Accounting → Commissions to see your own rows by status (pending / approved / paid / reversed).
  • Sellers and providers earn on lines they're tagged on. booking agents and their supervisors earn on consultation sessions per the configured rules.
  • Refunds and credit notes reverse the affected rows automatically. if the commission was already paid, the next pay run absorbs the claw-back (default behaviour).
  • The Accounting → Commissions ledger supports filtering, inspecting entries, approval, and permitted amount overrides.

For HR managers#

Approval#

  1. Open Accounting → Commissions → Pending.
  2. Review by staff member and period.
  3. Approve in bulk or per row. Bulk update requires finance approval permission.
  4. Approval stamps approved_by + approved_at on each row.

Payout#

  • Approved commissions become payable on the next pay run.
  • Each pay run includes a commission earning line per employee. once the run posts, status flips to paid.
  • Pending rows are not included by default. opt in via the policy's "Include pending in pay run" switch.

Reversals#

  • When the source invoice is voided, refunded, or deleted, the engine flips affected commissions to reversed and stamps a reason code (invoice_void, invoice_deleted, refund_full, refund_partial, …).
  • Session cancel and no-show flip the corresponding consultation commissions; the no-show trigger is off by default.
  • If the commission was already paid, the policy's claw-back mode controls the behaviour (see admin section).

For admins. the settings page, field by field#

Open Settings → Commissions. The screen mirrors the per-tenant policy exactly — every field on this page maps 1:1 to a knob on the engine.

Master switch + defaults#

  • Enable commissions. When off, the engine writes no rows regardless of any rule. Use this when a clinic doesn't pay commissions at all.
  • Default for products. Falls back to this when a product line has no per-product rate and no per-staff override.
  • Default for services. Same idea, for service / consultation lines.
  • Calculation base. NSR (default) or gross profit. See base mode above.

Who earns commission, and how much (rules)#

One row per rule type. each row has its own toggle and rate. Off rules are inert.

  • Earn on each new invoice. sales consultant and supervisor variants. Fires when an invoice is paid and the patient is tagged new-patient.
  • Earn on upsell invoice. sales consultant and supervisor variants. Fires for invoices flagged as upsell.
  • Arrived consultation (≥50% arrival rate). agent and supervisor variants. Rewards agents whose booked sessions actually show up.
  • Arrived consultation (low arrival rate). agent and supervisor variants. A smaller per-session reward when the agent's arrival rate is below 50%.
  • Paid consultation. agent and supervisor variants. Fires on paid sessions.
  • Membership-paid services. when an item is paid via a membership discount, this rule decides whether commission still accrues.
  • Deduct cashback / discounts / taxes / service cost / product cost. tiny rules. when active, the named amount is subtracted from the base before the rate applies.
  • Apply only on fully paid invoices. when active, partially paid invoices skip commission until they're fully paid.

Invoice rules use a single percentage. The "earn on each new / upsell / cross-sell invoice" rules pay a flat percentage of the line base — they don't support tiered or fixed-amount rates, so those options are disabled for them. Consultation rules (arrived / paid consultation) can use a fixed amount per session.

Agent vs supervisor is detected automatically. the agent is the user who created the invoice or session; the supervisor is the manager of the agent's team, set in Business → Teams.

Per-staff overrides#

Open an employee's profile in HR → Employees and set their custom commission rate. It overrides per-product and policy defaults for every line that staff member is tagged on, subject to the "override bounds" toggle below.

Advanced → Reverse commissions automatically#

Each toggle controls one reversal trigger. When the trigger fires, affected rows flip to reversed; already-paid rows go through the claw-back mode.

  • When an invoice is voided. Covers cancellation too — cancel was merged into void on the engine.
  • When an invoice is deleted (soft delete). Triggers reversal even when the invoice was deleted rather than voided.
  • When a full refund is issued. Rolls back the affected commission rows.
  • When a partial refund is issued. Off by default. when on, the reversal is pro-rata. an extra field sets the threshold above which a partial refund is treated as full (default 50%).
  • When a booking session is cancelled. Reverses linked consultation commissions.
  • When a session is no-show / missed. Off by default. many clinics still pay agents for booked-but-missed sessions.

Advanced → If a commission was already paid (claw-back mode)#

  • Subtract from the staff's next pay run (default). A negative adjustment row lands on the next pay run. lowest friction.
  • Hold — staff or finance must handle it manually. nothing automatic; the row stays paid until someone resolves it. used rarely, often for departed employees.
  • Do nothing — keep the paid amount. for goodwill exceptions.

Advanced → Splitting between multiple staff#

  • Allow split commissions. A single sale or session can credit more than one staff member.
  • Default split strategy. how to divide a commission when more than one beneficiary is detected:
    • Equal — split evenly.
    • By role — weight toward consultant over supervisor.
    • Custom — set per-beneficiary shares.

Advanced → Per-staff override bounds#

  • Custom staff rate must fall within the active rule tier. on by default. keeps per-employee overrides inside the band the rule was designed for.

Advanced → Pay run behaviour#

  • Include pending commissions in the pay run. off by default. when on, pending rows pay alongside approved ones.
  • Allow a pay run line to go negative after claw-back. off by default. when off, residual claw-back carries to the next pay run instead of producing a negative pay-out.
  • Auto-approve below. money field. new commissions at or below this amount approve themselves without HR review. Set to 0 to disable.

Advanced → Notifications#

  • Notify staff when one of their commissions is reversed. Sends the affected staff a notification with the source invoice / session and a reason code.

How commissions connect to the rest of the system#

  • Sales / invoices. An InvoicePaid event triggers per-rule commission creation. seller and supervisor are read from the invoice + team graph.
  • Booking sessions. Arrived and paid sessions trigger consultation-flavored rules via a scheduled job (per branch, per date).
  • Refunds, voids, deletes. Each one fires a typed event the commission engine subscribes to; reversal stamps a reason code.
  • Payroll. Approved commissions land on the next pay run as a separate earning line.
  • Accounting. Optional GL auto-post on approval (Dr Commission Expense, Cr Commission Payable) when the tenant has the mapping configured; otherwise payroll posts the cash leg.
  • HR. Per-staff overrides live on the employee compensation record. team membership decides agent vs supervisor.
  • Reports + CSV export. The commission list endpoint supports filtering by status, salesperson, date; a CSV export action ships rows with salesperson, amount, source, dates.

Common situations#

  • "My patient got a partial refund. did I lose my commission?" Only if the tenant policy has partial-refund reversal turned on. by default it's off; full refunds always reverse.
  • "I sold below the floor with the owner's override. is my commission lower too?" Yes. the resolver uses the actual line total at payment time.
  • "I'm an agent. my arrival rate dropped to 40% this week. what changes?" Arrived-consultation commissions switch to the low-rate variant (typically a smaller per-session reward).
  • "The session was a no-show. did I lose the booking commission?" Only if the tenant policy has session-missed reversal turned on. it's off by default.
  • "I expected commission on this invoice but nothing showed up." Check three things in order: master switch on? rule for this scenario on? the rate resolved to non-zero? if the patient isn't tagged as new-patient, the new-invoice rule won't fire.
  • "Two people sold this together. who gets the commission?" If split commissions are allowed (default), the system writes additional Commission rows per beneficiary with a share percentage. without splits, only the primary seller is credited.
  • "My commission is small. why didn't HR have to approve it?" If the policy's Auto-approve below threshold is set, rows at or below that amount approve themselves on creation.