On a Monday morning a short message came in from our accountant. The same invoice, it said, has 2 numbers. Attached was a photo of a screen where the number shown in the list and the number printed on the PDF did not match.
How a number is built was settled long ago. The branch code, the year, then a running count. The count goes back to 1 when the year turns. On paper it is one line of rule, and in the specification it was one line.
Inside the software, though, that one line was written in 2 places. One where a document is saved. The other where the list and the CSV export are assembled. The first kept the number it had put together; the second rebuilt it from its parts every time it was asked.
Last month we added a 2-character marker in the middle of the number to separate the kinds of documents. I changed only the place that saves. The list went on running under the rule as it stood before.
Nothing errors. Both numbers are well-formed. One follows the new rule and one follows the old one, and both are shown with the same confidence. It was the accountant who noticed, 6 days later.
43 documents were affected. The amounts themselves were right; only the numbers had drifted. But an invoice whose number has drifted cannot be reconciled. Accounting lines things up by number before it ever looks at the amount.
Once I started on it I found something worse. The rule that returns the count to 1 also lived in 2 places. The saving path reset it at the year boundary; the nightly job that fills gaps in the series did not. It was luck that the job had not yet run this year.
There were 2 ways to fix it. Correct both places, or turn the 2 places into 1. The first takes 30 minutes, the second takes 2 days. The first time around, 30 minutes is what you want to choose. This time we took the 2 days. Numbers are now made in one place, and the list only reads what that place made.
It is the kind of failure I cannot write a single excuse for. I knew the same rule sat in 2 places, because I am the one who put it there. I knew, and I was in a hurry at the time. I no longer remember what the hurry was about.
When I sent the account of it to the engineer on the KAZENA side, the answer came back that there is one more place with the same shape: the receipt numbers. We have no symptom there yet, but there is no reason to wait for one. This week that one gets collapsed into a single place as well.
For as long as a rule lives in 2 places, a person has to remember which of them is real. People do not remember. I forgot in 3 weeks. The software does not forget, and in exchange it keeps carrying out the old one faithfully.
There is a sheet of paper on the office wall now that asks: where is this value made? It is not the kind of paper I want more of, but as a keepsake from the week we re-reconciled 43 documents, I intend to leave it up for a while.