Systems and records
A discount approval AI dataset is only as good as its denied requests
By SourceX Editorial · Reviewed by Noah Loul ·
8 sections
Short answer
A discount approval AI dataset becomes decision evidence when each row keeps the request as asked, the limit and policy in force that day, the alternatives on the table, the decision and what that concession produced. Approved discounts alone teach a model the limit table. ERPNext's source code shows why: an over-limit submission is blocked with a message, and nothing about the attempt is stored.
Provenance trail
Discount approval AI dataset
Key takeaways
- An approved-discount export passes through three filters: requests inside a rep's own limit, blocked or denied requests, and counteroffers that overwrite the quote.
- In ERPNext at commit 821ca1d, an over-limit submission stops with a message naming who can approve, the code saves no record of the attempt, and the limit rule keeps no version history by default.
- Freeze three snapshots per concession: who could approve how much on which basis, the constraints in force, including days to quarter end, and the alternatives offered.
- Code each decision with one of eight labels, from within authority to withdrawn, and keep the decision's outcome separate from the deal result.
- Denied requests that still closed test whether concessions were needed; name them in the acceptance test.
What makes a discount approval history a decision dataset?
A decision dataset records the choice, not just the price that survived it. Each row is one concession request, holding the request as asked, the authority and limits that applied that day, the alternatives on the table, the decision taken and what that decision produced. A price list keeps only the last of those.
The unit matters more than the volume. A single deal can carry several concessions, each with its own requester, approver and constraint. A row per deal collapses them, and a row per approved quote silently drops the ones that failed. A revenue operations team that wants a model to recommend approve, counter or deny needs examples of all three, along with the evidence the approver saw when deciding.
Two earlier SourceX pages handle neighboring questions: how an agent should behave when a customer asks for more than it may grant, in the sales discount authority dataset, and how to license approval records without exposing a price book. This page asks what the history has to contain before either is possible: the requests that were refused, countered or never needed sign-off.
Why does an approved-discount export teach a price list?
Because three filters remove most of the decision before anyone runs the export. Requests inside a rep's own limit never enter an approval queue, requests above the limit that are blocked or denied often leave no row, and counteroffers overwrite the quote they replaced. What remains is a distribution cut off at each authority threshold, and a model trained on it learns where the thresholds sit.
Open-source software makes the second filter easy to see. We read the approval code in ERPNext at commit 821ca1d, dated October 27, 2026. An Authorization Rule names a value above which only a given approving role or user may submit a Quotation, Sales Order, Sales Invoice, Delivery Note or another listed transaction, tested on one of five bases: grand total, average discount, or the discount for one customer, item or item group. When someone without that role submits, the code shows a message that the limit is exceeded, lists who can approve and stops the submission. It writes nothing else; the file contains no call that saves or logs the attempt.
The approval that follows leaves no trace of being an exception. When a user holding the approving role submits the same document, it goes through like any other submission, with no flag saying a limit was crossed. Neither the rule nor the Quotation doctype sets Frappe's track_changes property, and the framework's save_version routine returns without saving a version when that property is off, so last quarter's limit cannot be read back from the rule's own history. An administrator can turn tracking on, and ERPNext does keep quotation revisions and alternative lines, which become useful once alternatives are recorded.
Other systems keep more of the trail. Salesforce documents a ProcessInstanceHistory object that shows all steps and pending approval requests in an approval process, and its Submit for Approval action reports a request's status as Approved, Pending, Rejected or Removed. Even there, a discount a rep never submitted, because the customer heard no on a call, is simply absent.
Here is what ERPNext's default source keeps for a discount that crosses a limit, and what a dataset needs instead:
| Element | What ERPNext keeps by default | Consequence for a dataset | What to capture instead |
|---|---|---|---|
| The approval limit | A rule with value, basis and approving role or user; no version history | The limit in force on a past date is unreadable | Dated snapshots of every rule |
| An over-limit submission by someone without authority | A message on screen; nothing stored | Blocked and denied requests vanish | The request and the block as a logged event |
| Submission by an authorized approver | An ordinary submission with no exception flag | Approved exceptions look routine | Approver role, tier and basis on the record |
| Why the discount was asked for | No dedicated Quotation field | No reason labels to learn from | A coded reason plus free text, dated |
| Earlier offers and alternatives | Revision links between quotations and alternative item lines | Some alternatives survive if kept | The full revision chain, not only the latest |
| A quotation the customer refused | Lost reasons and competitors | Outcome evidence exists | The date each was set, linked to the request |
Which three snapshots must every concession freeze?
Authority, constraints and alternatives, each as it stood on the decision date. Without authority, a model cannot tell a bold approval from a routine one; without constraints, it cannot tell a necessary concession from a habit; without alternatives, it learns that price is the only lever.
Authority is more than a name. It is the limit, the measure the limit uses and the role that held it. The measure changes outcomes: ERPNext can test a limit against the average discount across a quotation or against each line's discount, and a quote with one deep line among several list-price lines can pass an average test that a per-line test would stop. Store the basis with the value.
Constraints include the floor price or margin guardrail, payment and term rules, any most-favored-customer commitment and the calendar. The calendar is not a detail. In a study of a major enterprise software vendor published in the Journal of Labor Economics in 2014, Ian Larkin found that salespeople timed deals to profit from the vendor's accelerating pay plan and accepted much lower prices in quarters when closing earned them more. He estimated that this mispricing cost the vendor 6 to 8 percent of revenue. Days to quarter end belong in every concession row.
Alternatives are the levers that could have been traded instead: a longer term, prepayment, a smaller scope, a different product or a payment schedule. ERPNext shows a system can hold some of them, since a Quotation can be recorded as a revision of an earlier one and quotation lines can be marked as alternatives to another line. Keep the chain, mark which option the approver chose, and record options discussed but never quoted as dated free text.
Eight labels for a concession decision
Label the decision before the deal. The eight codes below cover what a reviewer can see in approval and quote history, and each needs evidence that must exist before the code is applied. The last column names the mistake that most often produces the wrong code during extraction.
Keep the decision's own outcome in separate fields: whether the customer signed at the approved terms, realized margin against the floor and the price at the next renewal. The deal result goes in a field of its own.
| Label | When it applies | Evidence that must exist | Common extraction error |
|---|---|---|---|
| Within authority | The requester's own limit covered the concession | Limit snapshot showing the value inside it | Dropped because no approval record exists |
| Approved as asked | The approver granted the full request | Requested value equals approved value | Coded as a counter after a later quote edit |
| Approved with a give-get | Granted in exchange for term, volume or payment changes | Linked change to term, volume or payment | Recorded as a plain approval |
| Countered | The approver offered less or a different concession | Earlier and later quote versions | Only the final version exported |
| Escalated | Sent above the first approver | A second approval step with its tier | Flattened into one approval |
| Denied, alternative offered | Refused, with another lever proposed | The denial plus the alternative quote or note | The alternative mistaken for the original ask |
| Denied | Refused outright | A denial event with its date | Never stored |
| Withdrawn or expired | The rep or customer dropped it, or the quote lapsed | A withdrawal or expiry date | Counted as a denial |
The evidence map: what to keep for one concession, and what to leave out
Keep everything the decision depended on and nothing that identifies a person who does not matter to it. Roles carry the authority logic; names do not, and a model has no use for a buyer's email address.
At a glance
The evidence map: what to keep for one concession, and what to leave out
Use the map below as the field list for an extraction or a data request:
- Request: the concession asked for, its measure (percent off list, term, payment), a coded reason with free text, the request date and the requester's role and tenure band.
- Authority: the limit, the basis it was tested on, the approving role and the policy version with its effective dates.
- Constraints: floor price or margin guardrail, payment and term rules, a most-favored-customer flag and days to quarter end.
- Alternatives: linked quote revisions, alternative lines and options offered but never quoted, each dated.
- Decision: one of the eight labels, the decider's role and tier, the decision date and any comments.
- Decision outcome: signed at the approved terms or not, margin against the floor, renewal price change and disputes raised.
- Deal context: segment, size band, whether a competitor was present, the deal result and its close date.
- Leave out: contact names, emails and phone numbers, rep and approver names (keep roles) and the customer's identity (keep segment and size band).
Was the concession needed? Reading the four approval-outcome cells
Not necessarily, and the deal result alone cannot settle it. A won deal with an approved discount may have closed without it: a budget was released, a rival dropped out, the quarter ended. The rows that test the question are the ones most exports lose, denied requests that closed anyway and approved concessions that still lost.
Human approvals are evidence of judgment, not proof of good pricing. In auto lending, Phillips, Şimşek and van Ryzin estimated in Management Science in 2015 that local sales staff adjusted prices in a way that improved profits by approximately 11% on average, and that a well-optimized centralized pricing system could have raised profits up to 20% over those actually realized. A dataset that treats every approval as the right answer teaches a model the field's habits, good and bad alike.
So require a minimum share of denied and countered rows in the acceptance test, set with the buyer before extraction starts. A concession set with no denials cannot answer the question it was bought to answer.
Read the four cells this way:
- Approved and won: the common row, and the weakest evidence on its own.
- Approved and lost: the concession did not decide the outcome; check whether price was even the stated objection.
- Denied and won: evidence the concession was not needed at that level, and usually the most valuable row in the set.
- Denied and lost: check whether the denial is the recorded cause, using competitor and objection notes dated before the loss.
Acceptance tests to send with a concession-data request
Ask for concessions as decisions, and say how you will check them. A request that names the eight labels, the three snapshots and a floor for denied and countered rows lets a supplier say quickly whether its systems ever recorded them.
At a glance
Acceptance tests to send with a concession-data request
SourceX does not keep sales datasets on a shelf. It sources them from U.S. companies after a buyer sets out what is needed, covering scope, volume, language, format, timing and licensing terms, through the request form. Whether any one company's approval history holds denials depends on its software and habits; ERPNext's defaults show that some will not, so no history should be assumed complete before a sample is checked.
Tests worth writing into the request:
- Denials present: at least the agreed share of rows coded denied or countered, confirmed on a sample before full delivery.
- Authority snapshots: every row links to a limit, basis and policy version in force on its decision date.
- Alternatives linked: every countered row carries the earlier quote version it replaced.
- Decision outcomes observed: signed terms for every row and renewal price where the window allows.
- Identity removed: no names or contact details, with roles, segments and size bands kept.
- Labels reproducible: two reviewers agree on a sample before the full set is labeled, and the agreement rate is reported.
Methods note: reading ERPNext's approval code
Source: a sparse clone of github.com/frappe/erpnext at commit 821ca1d87e81751216f1f6fd5ed89935b1677f98 (October 27, 2026), with authorization_rule.json, authorization_control.py, quotation.json, quotation_item.json and the controllers for Quotation, Sales Order, Sales Invoice, Delivery Note and Purchase Order, read as text by the script erpnext_discount_trace.py, kept with this draft for reviewers. The script runs nothing from the repository. Frappe's save_version routine was read in github.com/frappe/frappe at commit cbaa793.
Rules as applied: rule options are the non-empty options of the transaction and based_on fields; a doctype counts as versioned only when its JSON sets track_changes to 1; the control file counts as writing a record if it contains an insert, new_doc, get_doc with a dict, set_value, log_error or add_comment call (none was found; its only outputs are one msgprint and one throw); a transaction counts as enforced when its on_submit method calls validate_approving_authority (all five do); a reason or approver field is a Quotation fieldname containing reason, justif, approv or exception (only order_lost_reason, lost_reasons and the section that holds them match).
Not measured: any company's real approval history, customized installations, how often administrators enable tracking, and Salesforce behavior, which is described from its documentation rather than tested. The eight labels and the evidence map are editorial frameworks drawn up for this article; no results from them are reported.
Frequently asked questions
What is a discount approval AI dataset?
It is a set of concession requests recorded as decisions: what was asked, who could approve it under which limit, what alternatives existed, what was decided and what the concession produced. It is used to train or test models that recommend approving, countering or denying a discount. A list of approved prices alone does not qualify.
Why include denied discount requests in AI training data?
Without denials, a model only sees requests that passed, so it learns the approval thresholds rather than the judgment behind them. Denied requests that still closed are the clearest evidence that a concession was not needed. A set without denials cannot test whether a model would refuse correctly.
Does ERPNext record rejected discount approvals?
Not by default, based on its source code at commit 821ca1d. When a user without the approving role submits a document above an Authorization Rule limit, ERPNext shows who can approve and stops the submission without saving a record of the attempt. Approvals by an authorized user look like ordinary submissions.
Can an AI model approve discounts on its own?
Only after it has been tested on denials and counters, not just approvals. Research on auto lending found that field price discretion improved profits by about 11% on average while a well-optimized central system could have done better, so copying past approvals reproduces habits as well as good judgment. Most teams start with recommendations a human approves.
How is this different from a discount authority evaluation set?
An authority evaluation set tests how an agent behaves when a customer asks for more than it may grant: stop, route and wait. A discount approval decision dataset is the history that teaches or grades the approval judgment itself, so it needs the refusals, counters and outcomes that most approval exports leave out.
Sources
- ERPNext's Authorization Rule sets limits on five bases with an approving role or user, and its Authorization Control shows a message and stops an unauthorized submission without saving a record of it. Source
- ERPNext's Quotation enforces the approval check on submit, links revisions to earlier quotations, marks alternative lines and stores lost reasons and competitors, with no dedicated discount-reason field. Source
- Frappe's save_version returns without saving a version when a doctype's track_changes property is off. Source
- Salesforce's ProcessInstanceHistory object shows all steps and pending approval requests for an approval process. Source
- Salesforce's Submit for Approval action reports an instance status of Approved, Pending, Rejected or Removed. Source
- Larkin (Journal of Labor Economics, 2014) found enterprise software salespeople timed deals to a nonlinear pay plan and accepted lower prices, costing the vendor 6 to 8 percent of revenue. Source
- Phillips, Şimşek and van Ryzin (Management Science, 2015) estimated field price discretion improved profits about 11% on average, and optimized central pricing up to 20% over realized. Source
Tell us what data you need
Share scope, volume, format, timing and licensing needs. Datasets are sourced on request.