Engineering · Reporting

Void and voided are not the same word

Three reports in our system filtered out cancelled sales by comparing against the word "void". The status is stored as "voided". The comparison matched nothing, silently, and one report tripled the revenue it claimed a promotion had earned.


Having found one place that mishandled a cancelled sale, we went looking for the others. There were three, and all of them failed in the same way: they knew perfectly well that cancelled sales should be excluded, said so, and compared the status against the wrong word.

The status our till writes is voided. The three comparisons asked whether it equalled void. A database does not object to that. It answers no, every time, and the filter quietly passes everything through.

Three reports, three different kinds of wrong

The charity report adds up the round-ups guests donated at the counter and tells a venue what it owes the charity. With cancelled sales included, it overstated an obligation somebody was going to hand over in real money.

The deals report measures whether a promotion earned anything. This one is the sharpest, because meal deals get rung up and cancelled more than anything else on a menu — a mis-tapped combo is the classic void. Including them roughly tripled the revenue the report attributed to the promotion, which is the exact number a venue uses to decide whether to run it again.

The third is not a report. It is the message that asks a guest how their food was. It excluded refunded and cancelled orders — except it spelt one of them short, so guests were being asked to rate an order that had been cancelled before it was cooked.

Why a spelling mistake survives

A misspelt column name is caught instantly: the database refuses the statement and something breaks loudly. A misspelt value is not caught by anything. It is a legal question with a truthful answer, and the answer is no.

This is the single most common way a filter fails in any system, and it is worth knowing about even if you never write a line of code — because it explains why a report can be confidently, consistently, invisibly wrong while every other part of the system is fine.

The fix is not spelling it correctly

We could have corrected three words and moved on. Instead the list of statuses that count as reversed now lives in one place, with a helper that writes the comparison for you, and the three reports call it. Spelling it wrong is now a thing you cannot do by hand, because you are not writing it by hand.

If you are choosing a supplier, a version of this question is worth asking: when your system decides a sale does not count, how many places make that decision? The answer you want is one.


Try it on tonight’s service.

Nothing to install, no card. Not better by the weekend? Close the tab.