Our client sells trrvel and concierge services to consumers. They needed a solution to automatically calculate the sales commission for each of their commission earners.
They have target based sales commission and bonus programmes that are applied to different roles in the company, e.g. Sales Reps, Deal Managers, Territory managers, Marketing Managers, Collections managers, Training Managers.
Sales commissions and any bonus amounts are paid every 2 weeks according to the sales performance exceeding the bonus criteria within a specified 4 week Bonus Calendar period.
We developed the solution using Process builder and headless Visualforce Flows. The flows we created included the following functionality.
- Identify records that satisfy OR logic filter criteria
- Count the number of different reps who won deals in a period
- Evaluate bonus eligibility for each deal compared with deals won in a specified period
- Create Commission Payment records and statements for each eligible commission earner every 2 weeks
This note describes the design of the application.
Commission Scheme Overview
Deals are won and lost by Reps and Deal Managers in separate Sales locations which are supervised by Territory Managers (SSM's)
When a deal is won by the sales team, the deal is deemed ‘Accepted’ on the date that the contract is signed by the client. An 'Accepted 'or won deal counts towards the bonus target.
However the deal is only eligible for commission when the full payment for the contract has been received. At this point the deal is deemed to be ‘Completed’
Commission is only paid on deals that have been completed. If a deal is completed before the next Cut off Date , then the commission will be paid out in the next fortnightly payment run, the next working day following the Cut Off date .
Some commission earners are entitled to a Bonus commission.
The company operates a Target Bonus calendar of 4 - week periods throughout the year. For example:
Deal dates Cut Off Date
04/01/2016 - 31/12/2016 03/02/2016
01/02/2016 - 28/02/2016 02/03/2016
29/02/2016 - 27/03/2016 30/03/2016
A sales rep will receive a bonus commission on a deal if they won more than N deals within the Deal Date four week period that the deal was Accepted.
e.g if the rep signed a deal as Accepted on 07/02/2016 and this deal was fully paid for on 29/03/2016, then if the rep won N deals between 01/02/2016 – 28/02/2016, he would receive a commission and bonus commission during the commission Payable Period commencing 31/03/2016.
A more complicated criterion applies for a Deal manager who supervises the sale of the rep.
A Deal Manager is entitled to bonus commission on a new deal if he/ she has supervised more than X deals from at least 3 separate Reps within the Deal dates that include the Accepted date of the new deal.
The names of the Rep and the Deal Manager are logged on each contract, but other commission earners are not.
A Territory manager is entitled to a bonus on the new deal if there are more than Y deals won in his / her Sales locations within the Deal Accepted dates window.
Other commission earners only receive a basic commission percent and are not entitled to a bonus commission.
Objects to Enable Commission Automation Solution
Custom Setting: Bonus Target Dates.
This is a public list custom setting that defines the Cut off date for each ‘From – Accepted Date’ to ‘To – Accepted date’ period for each calendar year.
This record identifies
- the name of the commission earner, employment, contractor status and role
- the invoice address of his/ her account,
- the IGIC/ Tax rate to be applied to the invoice
- The commission / bonus rates that this earner is entitled to and any bonus target criteria that must be met.
Commission Payable Period:
- This record is a child of each Commission account record.
- It defines the period of deals that are eligible for payment up to the Cut off date .
- The record also calculates the sum of all commissions and bonuses due for each deal that was completed prior to the end of the cut off date.
- The record sums the deductions that should be applied for this period and calculates the net amount to be paid to the commission earner.
A Commission Payable record is automatically created each time a Subscriber contract is completed and marked as ‘eligible for commission ‘ by populating the field Commission Eligible Date.
This record contains the following information;
- Commission Type: e.g Rep Deal, TOM Deal (Deal manager), SSM Deal (Territory manager) , . These values determine how the commission and bonus due is calculated.
- Subscriber Contract.
- Commission Opportunity
- Rep Name, TOM Name
- Deal Gross value, Deal Nett value, Balance Amount
- Deal Commission value ( e.g: Deal Nett value x commission percent for this commission earner)
- Target dates: these are the start and end dates of the commission period for this deal whose Accepted date is within these dates.
- Deal written. : The number of deals written by this commission earner or manager within these target dates
- Bonus Percent: The percentage that should be applied if the bonus criteria has been met or exceeded
- Bonus Value: Deal net Value x Bonus percent
- Spiff Commission; A place to record a discretionary value for a Spiff deal payment.
The workflow – VisualFlow solution
Process Builder Workflow
A master headless flow and a series of subflows are launched by a Process Builder workflow ‘Trigger flow to Create Commission Payment records’
This workflow launches a headless flow when the field ‘Commission Eligible Date’ is entered into the ‘Subscriber Contract’ object record.