Catch supplier billing errors in ERPNext before you pay
Every Monday, check last week's supplier bills against what you ordered and what actually arrived, then get a Slack digest of every overcharge.
Every Monday at 8am, audit last week's supplier bills in ERPNext for billing errors before we pay them. This is the classic finance three-way match control: the invoice against the purchase order we raised, against the purchase receipt confirming what actually arrived. Keep the whole workflow read-only against ERPNext. Submitted documents cannot be edited or deleted without cancelling them first, so report discrepancies only and never modify, cancel, or approve a posted invoice.
Start with the ERPNext List Documents action on the Purchase Invoice DocType. Filter to docstatus = 1 so only real, posted bills are audited (0 is Draft, 1 is Submitted, 2 is Cancelled), and to a posting_date inside the last 7 days. Filters are JSON arrays of [field, operator, value] triples that are AND-combined, for example [["docstatus","=",1],["posting_date",">=","2026-08-07"]]. The fields parameter defaults to just ["name"], so request the columns explicitly: name, supplier, posting_date, grand_total, and currency. Page through the results if there are more than one page of them.
For each invoice returned, call Get Document on the Purchase Invoice by name, because the line items live in a child table that only comes back on the single document read. Each item row carries links back to the originating Purchase Order and Purchase Receipt. Call Get Document again on those linked Purchase Order and Purchase Receipt documents so you can read the rate we agreed to pay and the quantity we actually received. Cache documents you have already fetched, since several invoice lines often point at the same purchase order.
Compare every billed line against those two sources and flag three things: a billed rate higher than the purchase order rate, a billed quantity greater than the quantity received, and any invoice with no purchase order linked at all, which is off-contract spend. Matching invoice lines to the right purchase order lines is judgement work: match on item code first, then fall back to description and unit of measure when codes do not line up, and say so in the report when you are unsure which line a charge belongs to. Convert quantities to a common unit of measure before comparing, so a case billed against units ordered does not read as a false discrepancy. Ignore trivial rounding differences under 1 percent so the report stays signal-heavy.
Group the findings by supplier and rank the suppliers by total money at risk, which is the summed value of the overcharges and the over-billed quantities, plus the full value of any invoice with no purchase order behind it. Within each supplier, put the largest exposure first.
Post one digest to our finance channel using the Slack Bot Send a Message action. Open with the total money at risk, the number of invoices reviewed, and the worst supplier. Then list each supplier with their offending invoices, naming the invoice id, the supplier, and the specific mismatch on each offending line: show the billed figure next to the expected figure and the difference in money, and label which of the three problems it is. Keep it scannable for a finance lead who has to act on it in a couple of minutes. If every invoice checks out, post a short all-clear note saying how many invoices were reviewed and that no discrepancies were found, rather than staying silent.
What does this prompt do?
- Reviews every supplier bill your team posted in the last seven days
- Compares each billed line against the price you agreed to pay and the quantity you actually received
- Flags three problems: billing above the agreed price, billing for more than was delivered, and spend with no purchase order behind it
- Posts one Slack digest grouped by supplier and ranked by money at risk, with a short all clear note when everything checks out
What do I need to use this?
- An ERPNext account that can read your supplier bills, purchase orders, and goods receipts
- A Slack workspace with a channel for your finance team
- Purchase orders and receipts recorded in ERPNext, so bills have something to be checked against
How can I customize it?
- Change the day and time it runs, or widen the review window beyond the last seven days
- Adjust the tolerance so small differences stay out of the report (it starts at 1 percent)
- Send the digest to a different channel, or straight to your finance lead as a direct message
- Add your own rules, such as always flagging any single bill above a set amount
FAQs
What is a three-way match?
Will this change or cancel any of my bills in ERPNext?
What happens when a bill has no purchase order attached?
Will it message me even when nothing is wrong?
Will small differences flood the report?
Does this work with a self hosted ERPNext site?
Related templates
See how your brand's news coverage and sentiment stack up against four competitors, then let an assistant write the weekly report for you.
One screen showing every social post waiting on approval, sorted by deadline, so reviewers can approve or reject without leaving the page.
Every Monday, find the past champions and closed-won contacts who changed jobs, update Attio, and get the moves worth chasing in Slack.
Staff submit what happened, your social manager edits the copy, picks the accounts and puts it on the calendar without a single spreadsheet.
Open one board each morning, see which voice calls went badly, replay the exact moment the caller got frustrated, and file the fix.
A personal queue of every overdue Guru card, sorted by how late it is, with one-click verify, reassign, comment, and an agent that drafts the refresh for you.
Stop paying supplier bills nobody checked.
Run the three-way match every Monday morning and catch overcharges while you can still dispute them.