Calculate Sales Commission Based on Gross Profit in Zoho Books: A Step-by-Step Guide Chintan Prajapati February 25, 2025 4 min read 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: $40By 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 commissionsBusiness Use Case: Commission Calculation Based on Gross ProfitConsider 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 rateJohn Doe5% of Gross ProfitJane Smith3% of Gross ProfitBob Johnson4% of Gross ProfitSales Transactions:Now consider the following sales transactionsDateInvoice No.SalesPersonTotal Invoice Payment2024-02-09INV-1001John Doe$12,0002024-02-09INV-1002Jane Smith$15,0002024-02-09INV-1003Bob Johnson$20,000Sales Commission Calculation Example:Invoice No.Total Invoice PaymentCOGSGross profitCommission EarnedINV-1001$12,000$8,000$4000$200INV-1002$15,000$10,000$5000$150INV-1003$20,000$14,000$6000$240Ensuring Fair PayoutsThis 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 BooksSetting Up Custom FieldsTo 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 ModuleSince 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 Log in to Zoho Books and navigate to settings Click on Sales and select Invoices. Go to the Custom Fields section and click on the New Custom Field. Enter the Field Name, and Set the Field name as Commission. For data types, choose a currency, decimal, or amount to store the commission values. Click Save to finalize the setup. 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 DetailsOnce 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 Navigate to Reports in Zoho Books. Select Custom Reports from the Report lists and Create a Custom Report. Now select the report you want to customize from the list of Reports; we have to choose the invoice Details. Now complete the necessary steps i,e (General, Show/Hide Columns, Report Layout, Report Preferences). You can also add the Advanced Filters if needed. Click save as Custom Report and name it “Commission Report by Gross Profit”. 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 AutomationThis process triggers commission calculations when the system marks an invoice as paid.Writing and Implementing Deluge ScriptsThe Script Follows a structured algorithm to retrieve invoice details, calculate Gross Profit, and apply the correct commission rate.Algorithm for Commission Calculation: Retrieve Invoice Details Fetch the invoice ID and check its payment status. Ensure that the invoice is marked as “Paid” before proceeding. Calculate Gross Profit Fetch the total invoice amount. Subtract COGS from the total invoice amount to get Gross Profit. Determine Salesperson’s Commission Rate Identify the salesperson assigned to the invoice. Apply the predefined commission rate. Compute Commission Amount Multiply the Gross profit by the commission percentage to determine the final commission. Update Custom Field in Invoice Module Store the calculated commission in the invoice’s custom “Commission” field. 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. Setting Up Workflow Rules for Automatic UpdatesOnce 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: Navigate to Zoho Books Settings → Click on Automation → Select Workflow Rules. Click “Create Rule” and choose the Invoice module. Define the Trigger Condition When Invoice Status = “Paid” Select the Action: Choose Custom Function and insert the Deluge Script Save and Activate the workflow rule. Note: This workflow will run automatically for every paid invoice and store the commissions.ConclusionBy 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!