calculate_commission
Calculate commission
Use this when the user wants to calculate sales commission for one rep: a flat rate, a tiered commission ("5% up to 50k then 8% above"), quota attainment with accelerators or decelerators, a cap, a draw against commission, split deals ("split commission 60/40"), SPIFFs, clawbacks for refunded or cancelled deals, gross-margin commission, or OTE/target variable pay. Give either a sales_total or the deals. Returns the commission per deal with the tier applied, the tier breakdown, marginal and retroactive results when the plan does not say which, the draw recovery, the amount payable now, and a PDF commission statement plus an Excel file. Does not compute taxes or take-home pay. Do not use for a whole team or an uploaded deals file (use generate_commission_statements) or for commission-free trading.
Parametersplanrequireddealscurrencyrep_nameperiod_endsales_totalcompany_nameperiod_labelperiod_startprior_balance
generate_commission_statements
Generate commission statements
Use this when the user wants commission statements for several reps, asks "how much commission did each rep earn this month", or attaches a deals export (CSV or Excel from a CRM or spreadsheet with rep, deal, amount, margin, close date, status columns; columns are matched automatically). Applies one plan to all reps (with per-rep quota, draw and prior balance overrides), handles split deals, SPIFFs, clawbacks, caps and draws, and returns a team summary, a commission statement PDF with one section per rep, and an Excel workbook listing each deal line. Does not compute taxes, withholding or take-home pay, and does not read PDF or image files. Do not use for a single quick commission question (use calculate_commission).
Parametersfileplanrequireddealscurrencyrep_namecolumn_mapperiod_endsheet_namecompany_nameperiod_labelperiod_startrep_overrides
compare_comp_plans
Compare comp plans
Use this when the user wants to compare two commission plans or comp plans ("compare these two comp plans", "which plan pays more at 120% of quota"): computes the commission each plan pays at several sales levels, the difference, and where one plan overtakes the other, with tiers, accelerators, quota percentages and caps applied, computed in cents. Does not handle draws, deal lists or taxes, and does not judge which plan is fair. Do not use for a single plan's payout (use calculate_commission).
Parametersplan_arequiredplan_brequiredcurrencysales_levels