How to calculate commission on sales?
The practical need of every business is to measure sales and to further motivate and/or reward successful ones. The most common way for a company is to calculate commission for its salesmen or lobbyists.
For simplicity, the most common form is flat rate commission (eg, on each sales order 5% of its value is charged). It is simple but it leaves many questions, and some of which are:
- Is this applicable to all types of businesses?
- How is the customer return calculated?
- Should all commercialists have the same commission?
- If the margin is different, should the same percentage always be calculated?
- What if more people are participating in sales?
- If the buyer is granted a discount, does the commission need to be reduced?
- A higher sales order amount to account for a higher percentage?
- The calculation should be done only when the goods are delivered?
- Etc …
Since the simple way cannot meet the needs, there are different types of commission calculation (straight, tiered, gross, placement fees, gates, share of margin, etc.). The more time passes, the more complex the calculations become.
For us as software developers to implementing all these methods is a big challenge. Not only because of their complexity but that the methods are evolving. Depending on the market conditions, companies change their calculations. Each change takes time as well as new hours of development, which requires additional costs, especially for SMBs.
- What is the solution?
The solution is to enable each company to independently set up the calculation.
No one can understand and set up a calculation other than the company itself.
- How? When a visitor has no programming experience or access to the programmer’s code?
ERPAG has integrated Google Blocky ( https://developers.google.com/blockly ), a visual programming language ( VPL ) that allows users more unprecedented customization.
In this text, we will do an example of commission calculation.
2. Custom fields
Custom fields are a very useful option in customization (for more details check out this link: https://learn.erpag.com/project/products-and-services/document-templates/custom-fields).
Due to data integrity, enrollment is limited to custom fields only. So we will open up new fields to store the results.
Opening a new custom filed is done by activating the “add new” option in the “custom fields” panel when entering a sales order (new or edit mode of an existing one).
In our example we will create a custom field, that is a type: List.
Where we will enter a list of our sales representatives:
And we will create an additional “commission” field, that has an “Amount” type (numeric). “Read-only” status can be turned on in order to forbid the operators to change the values.
Note: Opened Custom fields can be dragged-and-dropped to any position in the document. In our example, we will place it in the “document header” section.
3. Creating the Blockly Script
This option is located in Administration > Integrations > Blockly Scripts
Upon activating the “Create” button, we will choose “Sales Order”.
When entering a document, the Blockly toolbar also has ERPAG variables (highlighted in red) in addition to the standard options (highlighted in green).
Programming is done like stacking with the mouse (drag & drop technique). You can find more information on Google for Education ( https://edu.google.com ).
4. Creating the script
It is necessary that for the sales specialist “Nikola Tesla” we calculate the commission of 5% and added 2% on amounts over $1000 when the invoice is generated from the sales order.
Since the script will be executed at every recording of any sales order, we have to set the condition that the calculation is valid only for “Nikola Tesla”.
What we recommend is that when comparing text data you should always include “UPPER CASE”, because operators do not care if data is case sensitive or not.
What we put inside the “IF” block will be executed if the data from the custom field called “sales specialist” equals “NIKOLA TESLA”.
In the example from the picture custom field named “Commission” will have 5% of the sales order value.
In order to only be accounted for when the invoice is generated, we need to add another condition.
And we still have to do an extra 2% if the invoices are over $1000.
And in such a simple way, we did a complex calculation without having to hire professional developers.
5. Activating the script
To prevent unfinished scripts from running, each script is paused when it is saved.
All blocks are colored in gray when the script is paused. Script activation is via the “Run” option.
The active script has the status “Running”, it can be stopped by activating the “Pause” option.
6. Results in Sales Order
To see the results we will create a Sales Order, where we will mark the corresponding “sales specialist”.
Before the invoice, the commission value will be 0 and it will not be displayed (custom fields that are empty or value is 0 are not being displayed).
When we “invoice” the sales order, the value of the “commission” custom field will be populated.
7. Manipulations with Scripts
This script is done for one sales specialist, for others, you can insert in the same script or form a new one. ERPAG has no specific limit on how many scripts you can have per document type.
When in edit mode you can use copy/paste options to copy.
We will activate “copy” in “Nikola’s commission” and we will paste it into a new Script and refine it a bit.
On the script list, we can see which ones are currently active.
If we have more than one script for the same document, the priority for executing will be its number.
Forming the scripts may seem unclear at first glance, especially to someone who has not had prior experience. The biggest benefit you get is the ability to customize the system on your own.
Visual programming languages (such as Google Blockly) are already a part of the elementary school’s educational program today. Therefore mastering this tool will not pose as a big challenge.
2019. ERPAG Inc.