The following description explains the core commission schema.
Here are the main entities whose relationships we will discuss:
Plan - Plans represent commission structures. Each plan has a set of eligibility, crediting, attainment, and payout rules.
Calculation - Calculations determine commission payouts for one specific plan (ex: Quarterly Bonus) and period (ex: Q4).
CalculationCommission - Calculation commissions track per-transaction payouts. Calculation commissions cannot track payouts which are not per-transaction (ex: cash bonuses).
CalculationCredit - Calculation credits track which transactions were credited to which users / teams. Calculation credits are also used to determine attainment.
CalculationResult - Calculation results summarize payouts per payee. Calculation results do not track commissions at the transaction level.
SystemUser - System users are users within your workspace (ex: full admins, limited admins, participants, etc.).
Team - Teams can be used to grant permissions or to perform rollups.
Transaction - Transactions represent commissionable events (ex: opportunities, orders, invoices, payments, etc.).
Here is a partial overview of the schema and relationships, focusing on calculation-related entities.
Calculation
The goal of calculations is to capture
credits and
rewards (payouts) for a given period and plan.
One calculation will always point to:
One plan
For example, we could have the following:
One calculation for January points to plan "Individual Commissions".
Another calculation for February points to same plan "Individual Commissions".
Another calculation for March points to plan "Team Commissions".
From this, we can see that a calculation always points to one plan.
Conversely, a plan will have many calculations (one per period).
CalculationCredit
The goal of calculation credits is to a/ capture
assignment of transactions, and b/ store how much credit was given towards attainment / quotas.
One calculation credit will always point to:
One calculation
One transaction
One credited user OR team
This depends on whether the plan is user-based on team-based
For example, we could have the following:
One calculation credit is for transaction T1 and calculation "January" of plan "Individual Commissions".
The credited user is "Fred" and 3 points were credited.
Another calculation credit is also for transaction T1 and also calculation "January" of plan "Individual Commissions".
The credited user is "Lisa" and 10 points were credited.
Another calculation credit is also for for transaction T1 and calculation "March" of plan "Team Commissions".
The credited team is "New York Team" and $1000 was credited.
From this, we can see that a calculation credit always points to one calculation, one transaction, and one credited user OR team.
If the plan is user-based, the credit will point to a user. If the plan is team-based, the credit will point to a team.
We can also see that, within 1 calculation, the same transaction T1 may be credited multiple times (ex: to both Fred and Lisa).
Each credit records a "credited amount" which counts towards attainment / quotas.
This credited amount may be revenue, profit, a score, or a custom
metric.
CalculationCommission
The goal of calculation commissions is to track individual per-transaction commissions.
One calculation commission will always point to:
- One calculation credit
- One payee
- One calculation result
- Explained later below
For example, we could have the following:
- One calculation commission points to the credit for [T1 + "Fred" + January calculation for "Individual Commissions"]
- The payee is "Fred" and the commission amount on T1 is $1.23
- Another calculation commission points to the credit for [T1 + "Lisa" + January calculation for "Individual Commissions"]
- The payee is "Fred" and the commission amount on T1 is $5.67 (Fred is Lisa's manager so he got another payout via Lisa)
- Another calculation commission points to the credit for [T1 + "New York Team" + March calculation for "Team Commissions"]
- The payee is "Lisa" and the commission amount on T1 is $8.91 (Lisa manages the NY team)
From this, we can see that a calculation commission always points to one calculation credit.
Since the calculation credit itself always points to a transaction, this means that a calculation commission only works for per-transaction commissions.
For example, if you add a flat manual reward worth $100 (not related to any specific transaction), this cannot be tracked using calculation commissions.
The next paragraph explains the role of calculation results to represent such "floating" payouts (disconnected from transactions).
Finally, observe that the payee may be different from the credited user (Fred is Lisa's manager so he got another payout via Lisa).
One calculation result will always point to:
- One calculation
- One payee
From this, we can see that a calculation result does NOT require any association with a specific transaction or calculation credit.
For example, if you add a flat manual reward worth $100 (not related to any specific transaction), this will be represented as a calculation result.
However, per-transaction commissions always point to a calculation result, which has the sum.
For example, if Fred received 2 per-transaction calculation commissions worth $1.23 and $5.67, a calculation result worth $6.90 (sum) will be created.
Calculation results allow you to query payouts without getting into the detail of each per-transaction amount.
Note: if a per-transaction calculation commission is adjusted, the associated summary calculation result is also adjusted.
Putting It Together
For an overview of the schema and entities, see this KB.
For examples of advanced SQL queries, see this KB.