A payment-terminal distributor calculates its employees' sales commissions in Podio. Every paid order creates a commission record, and every later change to that order adds a new version. Over time, that version history becomes the answer to the question everybody eventually asks: who earned what, and why?
The problem
The product range had grown — new terminal types, leasing contracts, new payment providers. The original structure only knew three fixed buckets for amounts and rates, so every new product had to be squeezed into one of them.
On top of that, several generations of the calculation had run over the years. Older records were stored in one format, newer ones in another, and some carried both side by side. Automation re-runs had also left duplicate versions behind, which made the history look busier than the business really was.
What we changed
- One structure per product. Each product now has its own amount and its own rate, stored as both percentage and euro value. The parts that write commissions and the reports that read them were changed together, so there is one logic instead of three copies of it.
- Commissions keep the prices of their day. A commission is priced with the rates that applied when it was created. Later rate changes don't silently rewrite old commissions, and products added afterwards are valued under that original pricing.
- Real changes vs. noise. Genuine order changes stay in the history. Duplicate re-runs, intermediate states during a single editing session and date-only updates are removed.
Migrating the existing data
Before touching anything, we scanned the whole workspace: roughly 900 commission records with about 1,400 versions, written by several generations of the calculation. For every version, the canonical per-product form was derived from whatever fields that version actually contained — not from assumptions about when it was written.
The writes themselves followed a strict routine:
- Calculate the full result as a dry run.
- Test on a handful of records first, then move on in batches.
- Only write if the result matches the dry run exactly, and back up every previous value.
- Read every record back after writing and compare.
The result
- All 994 commission records verified after the final recalculation.
- No old-format versions left in the workspace.
- The history now only shows versions that represent real business changes.
- New commissions are protected automatically: the calculation layer keeps creation-time pricing, so the problem cannot quietly come back.
What we took away
In a commission system, the history is the product. A migration like this is less about moving data and more about deciding — record by record — which changes were real business decisions and which were just system noise, and proving that before anything is written.
