TL;DR
Reference build, not a delivered engagement: three-way matching checks the invoice against the purchase order, never against the price you agreed.
Pricing & Discount Optimizer — the agreement-leakage audit
Reference model. Illustrated on typical mid-market operations, not a specific customer.
- Dynamics manages — Purchase agreements
[GA], trade agreements[GA], and invoice matching[GA]with configurable price tolerances - Cognilium optimizes — Which negotiated price should have priced each purchase order line — and which ones silently did not
- Proven category — Three vendors sell this exact audit on Oracle Marketplace: GoSaaS ProcureGuard: Contract Compliance Agent — "line-by-line audit of PO price vs master agreement price to recover negotiated savings lost to maverick spend" — plus KPMG PO Item Price History Agent and Alithya 26A Sourcing Assistant, which "finds POs with no agreement behind them". Nobody sells it on AppSource. Source: our own catalogue scan,
oracle-netsuite-ai.md, 2026-07-22 - The operation — A four-plant Tier 1 automotive supplier running three legal entities
- Systems today — Dynamics 365 Finance & Operations · three-way matching enabled · purchase agreements in active use · spend analysis in Excel
- The trigger — A margin review that cannot explain why negotiated savings never reach the P&L
The problem, in the buyer's words
"We negotiated a price and then paid a different one for two years."
Nobody was defrauded. Nobody skipped a control. Three-way matching was on, tolerances were tuned, and every invoice matched its purchase order to the penny.
The money left through a gap between two things the ERP manages correctly and never compares.
Why Dynamics only manages it — the last mile
Two published facts, and together they are the whole problem.
One — every price control benchmarks against the purchase order. Invoice matching [GA] is "the process of matching vendor invoice, purchase order, and product receipt information". Two-way and three-way matching both "match the price information on the invoice to the price information on the purchase order". The agreement is not one of the three documents.
Two — overriding an agreed price detaches the line instead of blocking it. Purchase agreements [GA] has a policy named Price and discount is fixed. It reads: "If the price is changed on the order line, the link to the commitment is broken. If the link is broken, the order line doesn't contribute to the fulfillment of the commitment."
So the wrong price becomes the reference, and the evidence that a different price was agreed removes itself. Dynamics records both facts faithfully. It never asks whether one should have priced the other.
That is the last mile. The ERP manages the agreement and the order. The margin lives in whether they match.
What the Optimizer does, and the architecture
Pricing & Discount Optimizer decides which price and which discount earn the most margin, re-plans them as demand and cost move, and writes the answer back into the agreements and price lists Dynamics already executes — behind an approval step. The agreement-leakage audit is its buy-side entry point: before optimizing a price, establish which agreed prices are already being ignored.
- Read — Purchase agreement headers, lines and commitments; PO lines with their agreement link (or its absence); vendor and item masters; the validity windows — all through data entities
[GA] - Compute — Deterministic reconciliation, not a model: for every PO line, did an effective agreement cover this vendor, item and date — and did the line's price match it?
- Explain — One paragraph per exception, generated on the exception only, naming the agreement, the expected price and the gap
- Propose — A ranked exception list into Dataverse, with an approval queue in Power Apps
- Write — Nothing, in version one. Deliberately read-only
On your governed stack — Power Platform, Dataverse and Azure, inside the tenant and the security model your IT team already approved.
The method — and where you must not trust it
The arithmetic is deterministic and that is the point. Whether a price matches an agreement is not a prediction. Anything that could be wrong is a data question, not a model question — and here is where the audit is weakest:
- The agreement was never entered, only emailed — The audit cannot see it. It reports coverage, so the blind spot is visible rather than silent
- Legitimate overrides — a genuine spot buy during a shortage — Every exception is reviewable and dismissible with a reason. A dismissed exception is a decision, not a defect
- Category-value commitments, where unit price is not fixed by design — Excluded from price reconciliation, and reported separately. Only product-quantity commitments fix a unit price
- Multi-currency lines — Reconciled in the agreement's currency, never through a posting-date rate
And the boundary that matters most: the audit proposes, a buyer decides. No model changes a price. A price is a commitment to a supplier, and the first time an automated correction is wrong you want a rejected proposal, not a re-priced order book.
A worked example — modelled, with the assumptions on the page
Challenge these inputs. They are ours, not yours.
- Legal entities — Value: 3 · Basis: the modelled operation
- Active purchase agreements across them — Value: 180 · Basis: modelled
- Agreements carrying at least one detached line — Value: 27 · Basis: modelled, roughly one in seven
- One representative agreement — Value: 240,000 units committed at £4.10 · Basis: modelled
- Volume on detached lines — Value: 54,000 units at £4.38 · Basis: modelled — a re-key during a shortage
The arithmetic, reproducible from the table above:
- Price gap: £4.38 − £4.10 = £0.28 per unit
- One agreement: 54,000 × £0.28 = £15,120
- The pattern across 27 affected agreements: 27 × £15,120 = £408,240
That last figure is projected arithmetic on our assumptions, not a recovery anyone has achieved. Change "one in seven" to "one in thirty" and it becomes £90,720. The number that matters is the one your own data produces, which is why the next section exists.
And note what the ERP was showing throughout: the representative agreement reads 186,000 of 240,000 fulfilled. It looks like under-buying. All 240,000 were bought.
How we would prove it on your own data
Before any software, one query you can run yourself. For each effective purchase agreement, list PO lines to the same vendor and item, inside the validity window, carrying no agreement link. Price the difference. Microsoft even gives you the drill-down: the Related information action on an agreement line reaches the PO and invoice lines contributing to fulfillment — the ones that stopped contributing are the question.
If that query returns nothing, you do not have this problem and we will say so.
If it returns something, the reference build above turns a one-off query into a standing control, and we would scope it on a private call against your own agreement structure.
The call to action
You have three legal entities, an unknown number of detached agreement lines, and a matching policy that cannot see any of them.
A working demo exists; we build these on request. We have no delivered pricing engagements — this is a reference build, not a report on somebody's business.
Book a 15-minute call and we will walk the audit and the arithmetic with you, on your own agreement structure if you bring it. No deck.
Sources
Share this article
Mudassir Marwat
Founder & CEO, Cognilium AI
Mudassir Marwat
Founder & CEO, Cognilium AI
Mudassir Marwat's argument is that ERP systems record decisions they never optimise.
