Calculate Sales Commission Based on Gross Profit in Zoho Books: A Step-by-Step Guide

Giving a commission to salespeople is crucial to business operations, ensuring fair and accurate commission payouts to salespersons while reducing manual efforts. This documentation explains how to track commissions using Zoho Books while providing fair compensation based on Gross Profit.

Why Calculate Commission Based on Gross Profit?

Some companies calculate commissions based on the total revenue, which does not always reflect business profitability. A more accurate method is to base commission on Gross profit rather than total revenue. This ensures that sales reps are incentivized to sell higher-margin products rather than just focusing on increasing sales volume. It also aligns sales incentives with overall business profitability rather than just revenue generation.

Gross profit formula:

Gross Profit = Revenue – Cost of Goods Sold (COGS)

Example:

  • Revenue: $100
  • COGS: $60
  • Gross Profit: $40

By using Gross Profit as the basis for commissions, businesses can ensure that payouts are aligned with profit margins rather than just total sales figures, creating a balanced commission structure.

Before automating commission calculations based on Gross profit, it’s essential to understand what sales commissions are and how they impact business profitability. Explore the definition and uses of sales commissions

Business Use Case: Commission Calculation Based on Gross Profit

Consider a business that sells multiple products with varying profit margins. Instead of calculating sales commissions based on total revenue, commissions should be determined based on Gross Profit to ensure fair payouts.

Let’s assume three salespersons – John Doe, Jane Smith, and Bob Johnson each have different commission rates based on their experience and performance:

Salesperson Commission Structure:

SalespersonGross profit-based commission rate
John Doe5% of Gross Profit
Jane Smith3% of Gross Profit
Bob Johnson4% of Gross Profit

Sales Transactions:

Now consider the following sales transactions

DateInvoice No.SalesPersonTotal Invoice Payment
2024-02-09INV-1001John Doe$12,000
2024-02-09INV-1002Jane Smith$15,000
2024-02-09INV-1003Bob Johnson$20,000

Sales Commission Calculation Example:

Invoice No.Total Invoice PaymentCOGSGross profitCommission Earned
INV-1001$12,000$8,000$4000$200
INV-1002$15,000$10,000$5000$150
INV-1003$20,000$14,000$6000$240

Ensuring Fair Payouts

This commission is calculated only when the invoice is paid, ensuring that payouts are linked to received revenue. Instead of a flat percentage of total sales, this method aligns earnings with actual profit margins.

Let’s learn how easy it is to implement Gross Profit commission calculation in Zoho Books

Setting Up Custom Fields

To ensure that sales commissions are accurately calculated based on the Gross Profit, we need to set up custom fields in Zoho Books.

Adding a Custom Field for commission in the Invoice Module

Since commissions are now calculated based on the Gross profit and triggered when an invoice is paid, we need to create a custom field in the Invoice module instead of the Payments Received Module. This will allow the commission to be tracked at the invoice level and automatically updated when payments are received.

Steps to Add a Custom Field for Commission in Invoices

  1. Log in to Zoho Books and navigate to settings
    Zoho Books dashboard with the settings icon highlighted in the top-right corner.
  2. Click on Sales and select Invoices.
    Zoho Books settings page with 'Sales' and 'Invoices' options highlighted
  3. Go to the Custom Fields section and click on the New Custom Field.
    Zoho Books Invoices module with 'Field Customization' tab and 'New Custom Field' button highlighted.
  4. Enter the Field Name, and Set the Field name as Commission.
  5. For data types, choose a currency, decimal, or amount to store the commission values.
  6. Click Save to finalize the setup.
    Zoho Books 'Edit Custom Field - Invoices' screen with 'Label Name' and 'Data Type' fields highlighted, indicating the creation of a custom field.

Note: This field will automatically store commission values once the workflow and Deluge script are applied, ensuring that commissions are calculated without manual entry.

How to Setting Up a Custom Report Based on the Invoice Details

Once the custom field for Commission Amount is added to the invoices, creating a report that consolidates commission data for salespersons and provides insights into earnings based on Gross Profit is essential.

Steps to Create a Custom Commission Report

  1. Navigate to Reports in Zoho Books.
    Zoho Books dashboard highlighting the 'Reports' menu in the left sidebar, guiding users to access reporting features
  2. Select Custom Reports from the Report lists and Create a Custom Report.
    Zoho Books Reports Center highlighting 'Custom Reports' in the left sidebar and 'Create Custom Report' button to generate a new report.
  3. Now select the report you want to customize from the list of Reports; we have to choose the invoice Details.
    Zoho Books 'New Custom Report' popup window prompting users to select a report to customize, with options to proceed or cancel.
  4. Now complete the necessary steps i,e (General, Show/Hide Columns, Report Layout, Report Preferences).
    Zoho Books interface displaying the 'New Custom Report' dialog box, prompting the user to select a report to customize
  5. You can also add the Advanced Filters if needed.
    Zoho Books interface displaying the 'Advanced Filters' section in the custom report creation process, with a filter applied for Salesperson selection and options to add more filters
  6. Click save as Custom Report and name it “Commission Report by Gross Profit”.
    Zoho Books interface showing the 'Edit Custom Report' section under 'Report Preferences,' where a custom report is named 'Commission Report by Gross Profit,' with options to add a report description and configure sharing permissions

Note: This Custom Report will provide real-time insights into commission earnings, making it easier to track payouts, review sales performance and align commissions with business profitability.

Workflow Automation

This process triggers commission calculations when the system marks an invoice as paid.

Writing and Implementing Deluge Scripts

The Script Follows a structured algorithm to retrieve invoice details, calculate Gross Profit, and apply the correct commission rate.

Algorithm for Commission Calculation:

  1. Retrieve Invoice Details
    • Fetch the invoice ID and check its payment status.
    • Ensure that the invoice is marked as “Paid” before proceeding.
  2. Calculate Gross Profit
    • Fetch the total invoice amount.
    • Subtract COGS from the total invoice amount to get Gross Profit.
  3. Determine Salesperson’s Commission Rate
    • Identify the salesperson assigned to the invoice.
    • Apply the predefined commission rate.
  4. Compute Commission Amount
    • Multiply the Gross profit by the commission percentage to determine the final commission.
  5. Update Custom Field in Invoice Module
    • Store the calculated commission in the invoice’s custom “Commission” field.
  6. Handle Errors and Edge Cases
    • If the customer does not pay the invoice, stop the commission calculation.
    • If the system does not find a matching COGS transaction, log an error and prevent incorrect commission updates.

Note: This algorithm ensures fair commission distribution based on actual business margins.

You can create Workflow Actions and Rules only in Premium Plans and above.

Zoho Books pricing plan comparison table highlighting customization and automation features. The 'Custom functions' feature is marked unavailable in Free, Standard, and Professional plans, but available in Premium, Elite, and Ultimate plans

Setting Up Workflow Rules for Automatic Updates

Once implementing the Deluge script, the system creates a workflow rule to execute the script whenever an invoice is marked as “paid.”  This automates the entire process, eliminating manual effort.

Steps to create the Workflow Rule:

  1. Navigate to Zoho Books Settings → Click on Automation → Select Workflow Rules.
    Zoho Books settings page showing the 'Automation' section with 'Workflow Rules' highlighted in red
  2. Click “Create Rule” and choose the Invoice module.
    Zoho Books Workflow Rules page with a highlighted 'New Workflow Rule' button in the top right corner
  3. Define the Trigger Condition
    • When Invoice Status = “Paid”
    Zoho Books Workflow Rule Execution Condition settings with 'Event Based' workflow type and trigger set for when an invoice is created or edited
  4. Select the Action:
    • Choose Custom Function and insert the Deluge Script
    Zoho Books interface showing the 'Associate Immediate Actions' screen with a custom function named 'updates_commission' linked to invoices.
  5. Save and Activate the workflow rule.
    Zoho Books workflow rule setup screen showing an event-based workflow that triggers a custom function 'updates_commission' whenever an invoice is created or edited

Note: This workflow will run automatically for every paid invoice and store the commissions.

Conclusion

By implementing this Gross Profit based commission automation in Zoho Books, businesses can:

  • Optimize sales processes.
  • Improve financial accuracy.
  • Ensure fair and performance-driven compensation.
  • Reduce manual errors and administrative workload.

This solution provides a scalable, transparent, and automated approach to commission tracking, enabling businesses to focus on growth without the hassle of manual calculations.

If you need assistance in setting up custom commission automation in Zoho Books or Zoho Books Integration with any third-party software, Satva Solutions can help.

Our experts specialize in accounting software integrations and workflow automation, ensuring a seamless implementation tailored to your business needs. Contact us today to optimize your sales commission process!

Article by

Chintan Prajapati

Chintan Prajapati, a seasoned computer engineer with over 20 years in the software industry, is the Founder and CEO of Satva Solutions. His expertise lies in Accounting & ERP Integrations, RPA, and developing technology solutions around leading ERP and accounting software, focusing on using Responsible AI and ML in fintech solutions. Chintan holds a BE in Computer Engineering and is a Microsoft Certified Professional, Microsoft Certified Technology Specialist, Certified Azure Solution Developer, Certified Intuit Developer, and Xero Developer.Throughout his career, Chintan has significantly impacted the accounting industry by consulting and delivering integrations and automation solutions that have saved thousands of man-hours. He aims to provide readers with insightful, practical advice on leveraging technology for business efficiency.Outside of his professional work, Chintan enjoys trekking and bird-watching. Guided by the philosophy, "Deliver the highest value to clients". Chintan continues to drive innovation and excellence in digital transformation strategies from his base in Ahmedabad, India.