Skip to content

Discount and margin control: how an AI Worker keeps trade terms in check

DYNAMINDS Labs team · · 6 min

AI Workers

In brief

Discount control means checking every discount on invoices and orders against the pricing policy and the customer's contract, then calculating how much of the list price is left after all reductions. An AI Worker flags discounts above the threshold, given without approval, inconsistent with the contract or applied twice, calculates volume rebates for the period and shows the effect of discounts on each customer's margin. Corrections, credit notes and changes to terms in the ERP are approved by a person.

The price waterfall: from list price to what is left

The discount on the invoice is only part of what a company gives a customer. The full picture comes from the price waterfall: the path from the list price to the price that actually remains after every reduction. A worked example for one wholesale customer, per PLN 100 of list price:

StepReductionRemaining (PLN)
list price100.00
wholesaler group discount12%88.00
individual discount on the invoice5% of the price after the group discount83.60
early payment discount, 7 days2%81.93
annual volume rebate3%79.47
free delivery on every orderapprox. PLN 1.50 per PLN 100 of sales77.97

A sales rep looking at the invoice sees a 5% discount. Finance sees 12% and 5%. Only the whole waterfall shows that less than PLN 78 is left from every PLN 100 of list price. If the purchase cost of this product is PLN 72, the customer margin is approx. 7.7% of what remains, not the 13.9% implied by the invoice price.

Off-policy discounts: four kinds

A discount policy says which discounts may be given, to whom, and who approves them. In practice, deviations from it take four recurring forms.

KindExampleWhere it comes from
above threshold without approvalthe sales rep may give up to 8%, the invoice shows 11%, and the CRM has no manager approvala verbal or "temporary" approval
inconsistent with the contractthe contract gives 6% on product group A, the ERP applies 6% to everythingan error when entering terms
applied twicegroup and individual discounts stack, although the policy says "the higher of the two"an ERP setting that contradicts the policy
out of datea spring promotional discount still applies in Decemberno end date in the customer's terms

Each of these can be caught by comparing the invoice with three sources: the policy, the contract and the approval recorded in the CRM. By hand this is done on a sample, once a quarter. The AI Worker does it for every invoice and every order.

Volume rebates: calculating without a spreadsheet

The volume rebate is the discount most often calculated in a spreadsheet. At quarter end someone exports sales, checks the thresholds in the contracts and calculates amounts for dozens of customers. Example thresholds from a distribution agreement:

Annual revenueRebateContract notes
up to PLN 500,0000%
above PLN 500,0002% of total revenuecondition: no receivables overdue by more than 30 days
above PLN 1,000,0003% of total revenueas above, revenue net of corrections and returns

The traps are in the notes. Is revenue counted before or after corrections? Is the rebate lost because of one invoice 31 days overdue? Do December returns reduce revenue when the credit note came in January? The AI Worker calculates the rebate as the contract is written and shows the calculation for each customer: revenue, exclusions, threshold, payment condition. It flags a doubtful clause for a decision instead of adopting whichever reading favors one side.

Discounts, VAT and corrections

Under the Polish VAT Act, a discount given at the time of sale is not part of the taxable amount (Article 29a(7)), so the invoice simply shows a lower price. A discount given after the sale, such as a volume rebate, reduces the taxable amount (Article 29a(10)), and the document is usually a corrective invoice. Article 106j(3) allows a single correction covering all deliveries in a period when the discount applies to all sales to the customer.

How a specific rebate is classified (a corrective invoice or a note, and which delivery it reduces) depends on the contract and is worth agreeing once with a tax adviser for the contract template. The AI Worker prepares the calculation and a draft document according to the agreed rule, and a person approves issuing the correction or note. Since 2026, a correction to a structured invoice goes through KSeF, Poland's national e-invoicing system, just like the original invoice, so the calculation must identify which invoices it concerns.

How discounts affect customer margin

The last step is a conversation about customers, not invoices. The statement shows for each customer the revenue at list prices, the sum of all reductions in the waterfall, the margin after reductions and the change from the previous period. It reveals customers whose discounts eat the margin, and sales reps who step outside the policy more often than others.

This statement fits well with the board report described in The Monday morning board report, and with price list updates after cost changes, described in Price lists and price increases. A price list increase that disappears into individual discounts does not change the margin.

At DYNAMINDS Labs this work is done by the Discount analyst. It uses invoices, orders and trade terms in the ERP, the discount policy with approval thresholds, contracts with customers and distributors, and discount approvals recorded in the CRM. Issuing a correction or rebate note, changing trade terms in the ERP and deciding on an off-policy discount wait for a person. How to calculate whether such control pays off is covered in How to calculate whether an AI Worker pays off.

Questions and answers

Can the AI Worker correct a discount in the ERP by itself?

No. It points to a discount that breaks the policy or the contract, with the invoice and the contract clause, and a person approves any change to trade terms in the ERP. Sometimes an off-policy discount was a deliberate decision nobody recorded, so it has to be clarified first and only then corrected.

How do you know a discount was approved?

From the approval recorded in the CRM or the approval workflow. If the approval was verbal, the check will show the discount as given without approval. After a few weeks of such checks, approvals start appearing in the system, because sales reps know that an unrecorded discount will come back as a question.

What about discounts agreed in conversations with key accounts?

They remain a decision for the sales rep and the manager. The check does not forbid such discounts; it shows them in one place together with their effect on margin. The board can then decide knowingly that a key account's discount is worth its cost.

Does discount control require changes to the ERP?

Usually not. To start, read access to invoices, orders and trade terms, the discount policy as a document and the customer contracts are enough. A pilot on last quarter's data shows how many discounts were outside the policy and how many rebates were calculated differently from the contract.

Start with one task. Describe it, and DYNAMINDS Labs will prepare a free diagnosis.

Meet DYNAMINDS Labs

Read more: AI Workers

All in AI Workers →