Enhanced Commissions
Related to Features Incident 14761.
The current xTuple sales rep commissions feature has limited functionality that may not meet the needs of businesses with more complex and dynamic comissioning requirements. For example, the current system only allows for one sales rep per Sales Order, and only supports a flat commission rate per rep.
The Enhanced Commissions spec covers both core (C++) changes and the contents of a new package (scripts) that will be maintained as part of the Enterprise Edition. The core updates are not described here, but are covered by a number of incidents associated with the omnibus Enhanced Commissions incident # 14761. The contents of the Enhanced Commissions package are covered in this specification.
Functional Requirements
-
Setup Options
-
Enable Enhanced Commissions feature.
- Once enabled, if entries are made in new tables, cannot be disabled
- If the Enhanced Commissions feature is not enabled, all existing commissions functionality should continue to work as it has.
- Additional configuration options for setting up commission splits
-
Enable Enhanced Commissions feature.
-
Configure Sales Rep options
- Use Commission Schedule checkbox
- Receives check checkbox
-
Assign Sales Rep to Expense Category
- Because the Enhanced Commissions package will allow Vouchers to be created to pay commissions, reps must be assigned to expense categories.
-
Define Commission Schedules
- A Commission Schedule has a name, a description, and a list of Commission Schedule Items.
-
Define Commission Schedule Items
- Commission Schedule Items show a Percent off List value and a Commission Percentage value.
-
Assign Commission Schedules
-
Commission Schedules can be assigned to
- Sales Rep
- Ship-To
- Customer
- Item
- Product Category
- Customer Type
- Sales Rep Group
Or a combination of the above.
-
-
Define Primary Sales Rep and Additional Sales Reps for a Customer and Ship-To location
- If there is only one rep on the Customer or Ship-to, that rep is the Primary. If additional Reps are assigned, one must be designated as Primary.
-
Assign multiple Sales Reps to a Salesline or Invoiceline
- Use the Salesrep assignment algorithm, defined below
- Defaults can be overridden on the Salesline
-
Calculate Commssions per Salesline
-
The commission amount for a given Sales Order Line / Sales Rep will equal:
- Sales Order Extended Line Price * Commission % * Adjustment %
-
The commission amount for a given Sales Order Line / Sales Rep will equal:
-
View Commissions Summary on Sales Order
- Not editable
- Shows all reps and commissions
- Report on Commissions due and paid
-
Generate Vouchers for Commissions payments
- Allow checks to be written to Employees who are not Vendors
New Terms and Definitions
- The expense category to be used for Sales Rep commissions (can be different for each rep)
- Each Commission Schedule has a Code (name) and a Description.
- Commission Schedules contain Items. Each Item describes a commission rate to be paid when an item is sold up to a certain discount from the list price
- Commission Schedules can be assigned to various entities to narrow the range of items to which they would apply.
- The base commission percentage for a rep will determined on each Sales Order Line by finding any applicable Commission Schedules and applying the correct commission rate.
- The Adjustment Percentage is a fraction of the total number of Sales Reps found in the Sales Rep Assignment table “repassign” in excess of the assigned Sales Rep and his Manager. For example, if 1 Sales Rep is found in “repassign” the percentage is 100% (1/1). If two are found the percentage is 50% (1/2). If three are found the percentage is 33.33% (1/3).
- The commission amount for a given Sales Order Line / Sales Rep. Commissions for a Sales Order should be calculated per line, and added together for a total for the Order.
Related Existing Functionality
This functionality will still be supported in the enhanced version, but may be overridden by enabling the Enhanced Commissioning system.
If the Enhanced Commissions feature is not enabled, all existing commissions functionality should continue to work as it has.
Similar and Related Requests
NA
Conflicting Features
NA
User-Level Functionality
There are number of user-level changes that will be included in the enhancement.
Window Changes
-
Checkbox on the Setup screen “Use Enhanced Commissions”
- Note: Once Enhanced Commissions has been enabled, if entries are made that use the new tables the user will not be able to disable the feature.
- All Enhanced Commissions features will be hidden if this is unchecked
-
Additional setup options for Commissions
-
Primary Sales Rep receives FULL/SPLIT/NONE (default FULL)
-
Primary Sales Rep’s Manager receives FULL/SPLIT/NONE (default FULL)
-
Additional Sales Reps receive FULL/SPLIT/NONE (default SPLIT)
-
Additional Managers receive FULL/SPLIT/NONE (default NONE)
-
Managers split commission with: Sales Reps/Managers (default MANAGERS)
-
-
The Sales Configuration screen will be modified to provide for the next Commissions Batch number when a Sales Rep is paid through Payroll.

-
add Expense Category widget
- See custom widget section below for description of widget
- This widget will be disabled until the "Use Commission Schedule" box is checked.
-
add “Use Commission Schedule” checkbox
-
When checked the Commission Rate field will be disabled and set to 0.
- When this is checked, the Expense Category will be enabled.
-
-
add “Receives Check” checkbox
- If this is checked, the Sales Rep receives a physical check generated from xTuple through a Voucher created in the Commissions Payment and Reporting Display processing section. If this is left unchecked, the commission amount determined during Commissions Payment and Reporting Display processing will be linked to a unique Commission Batch number that can be displayed on a commissions report.

Sales Order and Invoice

-
New tab “Commissions”
-
This tab presents the following columns and provides a summary view of Commissions for that order:
- Sales Rep
- Role
- Commission Amount
- It will show totals summarized from the Sales Order lines by Sales Rep by Item. Total the Saleslines first, then add together for SO total.
- It will be ordered by Item, and then by Sales Rep and provide totals for the Commission Amount column.
-
Right-click menu options:
- View Salesline (opens to the Commissions tab)
- Edit Salesline (opens to the Commissions tab)
-
This tab presents the following columns and provides a summary view of Commissions for that order:

-
A new tab will be created on the Sales Order Item and Invoice Item screens showing rows with the following:
- Sales Rep
- Role
- Split (Adjustment Percentage)
- Commission Percentage
- Commission Amount
- User can add or remove Sales Reps from the SO Item or Invoice Item.
- User can edit Sales Rep Commission settings for the item.

-
New screen lists all Commission Schedules
- Add and Delete buttons
-
New screen to add or modify a Commission Schedule
- Code
- Description
- Commission Schedule Items list
-
Add or modify a Commission Rate and Discountupto values
Commission Schedule Assignment

- The sales history information screen (accessed from the Sales History report) will have to be modified to show all commissions when they are opened.

-
This screen will enable the user to select:
- Sales Rep
- Date Range
- Show Status
- Show All Reps
- The user must select a Sales Rep or click Show All Reps and enter a Date Range (based on the Invoice Date).
- The Show Status drop down will contain three options:
- Show All Commissionable
- Show Paid Commissionable
- Show Unpaid Commissionable
-
Display Columns:
- Sales Rep
- Sales Order
- Sales Order Line
- Invoice
- Invoice Line
- Invoice Date
- Item
- Invoice Qty
- Invoice Price
- Invoice Extended Price
- Voucher Number (only displays when paid)
- Commission (with total at bottom of screen)
- This display will not show a row with a commission of 0.
- When the user selects the Show Unpaid Commissionable option, the button on the screen called Pay Commissions is enabled. The user may multi-select rows on the display and then click the Pay Commission button. Shift to multi-select a range will be supported. Include a “Select All” option to prevent having to use Shift-Click to highlight the entire range.
-
The following occurs:
- A Miscellaneous Voucher is created for each Sales Rep's Employee's Vendor when the Sales Rep is defined as Receives Check true. A Miscellaneous Distribution Voucher Line is created for the Sales Rep's Expense Category as defined in the table “salesrepexpcat”. The amount is based on the total commissionable amount multi-selected for that Sales Rep.
- When the Sales Rep is defined with Receives Check false, an the next Commissions Batch number is fetched and used in lieu of a Voucher id.
- All Sales Reps who are set to "receive check" will be linked to a Vendor.
- Note: On the Commissions Payment and Reporting Display, the concept of “paid” versus “unpaid” is determined based on the presence or absence of a row in the “compaid” table. A row for an invcitem_id indicates payment for a specified salesrep_id. Absence of a row indicates that no payment has been made. There are no partial payments.
-
The Commission amount is determined by joining from the invcitem_id to the “invcitemcom” table’s invcitemcom_invcitem_id and invcitemcom_salesrep_id. The field Commission amount is calculated as:
- invcitemcom_compercent * invcitemcom_adjpercent * invcitem_billed * invcitem_price
- Apply the base commission percentage from the applicable Commission Schedule or from the sales rep default (if not using commission schedules), and then adjust it by the adjustment percentage.
- if EnCom is not enabled, use cohist.
- if enabled, use compaid table to record commission payments.
-
How to reconcile these systems? Make entries in compaid for commissions paid in old system?
- no. There is no concept of commissions paid in the old system.
- NOTE: As part of the EnCom package, the xTuple core will be updated to require SalesReps, Users, and Employee records to be linked to a CRMAccount record. Sales Reps do not need to be employees. We will then be able to link a salesrep to a vendor record, without requiring the salesrep to be an employee. However, if the sales rep is to have a manager defined in the system, he will need to be an employee.
Report Changes
- This report will be a modification of the existing Earned Commissions report.
- Once Enhanced Commissions is enabled, the "old" commission information will need to be included in this report, along with the new commission info.
- The EnComm version of the commissions report will need to include the commissions from the cohist table, but they will not be able to be marked as PAID.
- The report will show all invoices by date range (Invoice Date) that have not been paid by the Sales Rep in the “coitemcom” table. This report shows the Invoice Header information and line information along with the total commission calculated for that Sales Rep on each invoice. This report excludes invoices that have been paid (closed in aropen). The report is grouped by Sales Rep and page breaks on Sales Rep.
- The user enters a date range. The report displays all Vouchers or Commision Batches within that date range grouped by Sales Rep that appear in the “compaid” table. The report shows the invoice header information and commission paid on each invoice. The report is grouped by Sales Rep and page breaks on Sales Rep.
Batch Manager Changes
Need to make sure that the modified reports can be run in Connect
Usability Considerations
We will need to write documentation explaining how to use the Enhanced Commissions functionality.
Problems and Alternatives
NA
Internal Design
Internally, there are a number of new processes and tables.
Basic Algorithms
Sales Rep Assignment method
N/A
Schema Changes
What changes do we anticipate making to the database schema? New tables? Views? Indexes?
salesrepexpcat
New table called “salesrepexpcat” with the following columns:
|
Column Name |
Description |
Data Type |
Comments |
|
salesrepexpcat_id |
pkey |
integer |
primary key |
|
salesrepexpcat_salesrep_id |
fkey |
integer |
foreign key to salesrep_id |
|
salesrepexpcat_expcat_id |
key |
integer |
foreign key to expcat_id |
repassign
The Sales Rep field on the Ship To screen will be replaced with a new tab called Sale Rep Assignment. This tab will enable to population of the new “reapassign” table. Only a single Sales Rep can be flagged as the Primary Rep.
|
Column Name |
Description |
Data Type |
Comments |
|
repassign_id |
pkey |
integer |
primary key |
|
repassign_salesrep_id |
fkey |
integer |
foreign key to salesrep_id |
|
repassign_cust_id |
fkey |
integer |
foreign key to cust_id |
| repassign_shipto_id | fkey | integer | foreign key to shipto_id |
| repassign_primary | primary salesrep | boolean | only a single salesrep may be primary on a customer and shipto |
comsched
|
Column Name |
Description |
Data Type |
Comments |
|
comsched_id |
pkey |
integer |
primary key |
|
comsched_code |
commission schedule code |
text |
name of the commission schedule |
|
comsched_descrip |
schedule description |
text |
description of the commission schedule |
|
Column Name |
Description |
Data Type |
Comments |
|
comscheditem_id |
pkey |
integer |
primary key |
|
comscheditem_comsched_id |
fkey |
integer |
foreign key on comsched_id |
| comscheditem_discountupto | discount up to | numeric | percentage off the list price |
|
comscheditem_comrate |
commission rate |
numeric |
commission rate for the given Commission Schedule and discount |
comschedass
|
Column Name |
Description |
Data Type |
Comments |
|
comschedass_id |
pkey |
integer |
primary key |
|
comschedass_comsched_id |
fkey |
integer |
foreign key to comsched table |
|
comschedass_descrip |
schedule assignment description |
integer |
description of the commission schedule assignment |
| comschedass_salesrep_id | fkey | integer | foreign key to salesrep table |
| comschedass_shipto_id | fkey | integer | foreign key to shipto table |
| comschedass_cust_id | fkey | integer | foreign key to custinfo table |
| comschedass_item_id | fkey | integer | foreign key to item table |
| comschedass_custtype_id | fkey | integer | foreign key to custtype table |
| comschedass_prodcat_id | fkey | integer | foreign key to prodcat table |
| comschedass_salesrepgrp_id | fkey | integer | foreign key to salesrepgrp table |
| comschedass_exclusive | is schedule exclusive | boolean | exclusive schedules may not be combined |
| comschedass_inclmngr | include managers | boolean | should salesrep managers be added to coimtemcom or invcitemcom |
A new table will be called “coitemcom” and will store information about the specific Commission Schedule, commission percentage, adjustment percentage, and commission for a salesline.
|
Column Name |
Description |
Data Type |
Comments |
|
coitemcom_id |
pkey |
integer |
primary key |
|
coitemcom_coitem_id |
fkey |
integer |
foreign key on coitem_id |
|
coitemcom_salesrep_id |
fkey |
integer |
foreign key on salesrep_id |
| coitemcom_default | use default values | boolean | if true, calculate role, type, compercent and adj percent. If false, allow manual override |
| coitemcom_ismngr | rep or manager | boolean | used to determine which commission adjustment pool to use |
| coitemcom_split | full or split | boolean | if true, adjust commission, if not, pay full |
| coitemcom_compercent | commission rate | numeric | commission rate for the salesrep for this salesline |
| coitemcom_adjpercent | adjustment percentage | numeric | adjustment percentage for this salesrep for this salesline |
Note: Unlike the way in which tax is calculated in xTuple where the amount is determined with a DB function and not stored in the database, the Commission Percentage and Adjustment Percentage are calculated initially based on table lookups, but are modifiable for a given Sales Order Line and therefore must be stored in a table.
|
Column Name |
Description |
Data Type |
Comments |
|
invcitemcom_id |
pkey |
integer |
primary key |
|
invcitemcom_coitem_id |
fkey |
integer |
foreign key on coitem_id |
|
invcitemcom_salesrep_id |
fkey |
integer |
foreign key on salesrep_id |
| invcitemcom_default | use default values | boolean | if true, calculate role, split, compercent and adj percent. If false, allow override |
| invcitemcom_ismngr | rep or manager | boolean | used to determine which adj group to use |
| invcitemcom_split | split or full | boolean | if true, use adjustment, if not, use full |
| invcitemcom_compercent | commission rate | numeric | commission rate for the salesrep for this salesline |
| invcitemcom_adjpercent | adjustment percentage | numeric | adjustment percentage for this salesrep for this salesline |
Note: Unlike the way in which tax is calculated in xTuple where the amount is determined with a DB function and not stored in the database, the Commission Percentage and Adjustment Percentage are calculated initially based on table lookups, but are modifiable for a given Sales Order Line and therefore must be stored in a table.
compaid
|
Column Name |
Description |
Data Type |
Comments |
|
compaid_id |
pkey |
integer |
primary key |
|
compain_invcitem_id |
fkey |
integer |
foreign key on invcitem_id |
|
compaid_salesrep_id |
fkey |
integer |
foreign key on salesrep_id |
| compaid_vohead_id | fkey | integer | foreign key on vohead_id |
| compaid_combatch | commission batch number | integer | if salesrep receives check, combatch is used instead of vohead |
| compaid_commission | commission | integer | amount of commission paid |
| compaid_createdate | date | timestamp | date the row is inserted |
Note: On the Commissions Payment and Reporting Display, the concept of “paid” versus “unpaid” is determined based on the presence or absence of a row in the “compaid” table. A row for an invcitem_id indicates payment for a specified salesrep_id. Absence of a row indicates that no payment has been made. There are no partial payments.
Privilege changes
|
Privileges for feature |
|
|
Name |
Description |
|
MaintainSalesRep (existing priv) |
Can Add/Edit/Delete Sales Rep tab (on the Sales Order Header), Commissions tab (on the Item screen), Commissions tab (on Sales Order Line), Commissions tab (on Sales Order Header), Commissions Reporting Display |
| MaintainEnhancedCommissions | Can Add/Edit/Delete on these screens: Commissions Schedules (new screen), Commission Schedule Assignments (new screen), Enable/Disable Enhanced Commissions (Setup) |
|
MaintainVouchers |
Use Pay Commissions button (button on the dspCommissions report screen)Can Add/Edit/Delete on these screens: Commissions Schedules (new screen), Commission Schedule Assignments (new screen), Enable/Disable Enhanced Commissions (Setup) |
| ViewCommissions | Can View Sales Rep tab (on the Sales Order Header), Commissions tab (on the Item screen), Commissions tab (on Sales Order Line), Commissions tab (on Sales Order Header), Commissions Reporting Display |
Stored Procedure Changes
Performance Considerations
NA
Error Handling
Commission confusion—what rate applies?
QA Considerations
Does this feature require any special tools or data to test? Is it testable (some features may be hard to reach from the user level)?
What are some anticipated areas of concern that require special attention?
Test various commission scenarios, make sure Primary, Manager and all other reps are commissioned correctly
Documentation Considerations
Is there a significant documentation impact?
Does the feature require a standalone essay or only field-level descriptions?
This feature will require documentation to clarify the functionality. It will need a short product guide to describe some use-case scenarios.
Release Considerations
If this is done in time, it should be incorporated into a 3.8 release.
- Key Phrases:
- Accounting CRM Software ,
- Accounting Mac Software ,
- Accounting Software for Small Business ,
- Bookkeeping Software ,
- Business Accounting Software ,
- Business ERP Software ,
- ERP Accounting ,
- Small Business Accounting Software ,
- Windows Accounting Software ,
- Open Source Accounting Software ,
- Company Financial Software ,
- Cross-Platform Business Software
This looks good. A few thoughts at first glance:
If enhanced commissions is turned on, once some entries have been made that use those tables you shouldn't be able to turn it off. Otherwise you could have some serious confusion about things in a mixed state.
What happens to the "old" commission functionality when enhanced is turned on? The legacy commissions features are largely incompatible with this I think. So shouldn't some fields and reports be hidden? What happens if I turn enhanced commissions on and I've been using the old method? Does the data migrate? Is there any interaction between old and new commission data and interfaces?
The sales history screens will have to be modified to show the commission break out when they are opened.
Currently you can define a default sales rep and commission globally for customers which in turn copies from customers to sales orders. You'll need to at least provide a new way to hand the customer commissions default. I'm not so sure about the global default for customers, but you'll at least need to hide the "old" settings if not provide an alternate interface for the new break out method.
John
How about situations where commissions are only paid on invoices that are paid? I am not clear on how this would be handled.
The Commissions report, which is used to determine payment of commissions, is based on paid invoice items only.






