CASE 01
Payroll & Ledger Engine
Running the back office used to take a week of manual work across separate tools for payroll, invoicing, and chasing payments. Now one engine pulls the hours, runs payroll, drafts every invoice, chases what is overdue, and closes the books, all exact to the cent.
- Role
- Design, build, automate
- Year
- 2026
- Stack
- Web app · Database · Payments + accounting
- Status
- Live in production
01 The problem
Running a back office by hand is a stack of separate jobs. Pull everyone’s hours, compute the pay, pay the team, invoice every client, chase the ones who are late, then close the books. Each step lives in a different tool or a different person’s memory, each one is a chance to be wrong, and a single slip in a paycheck or an invoice costs trust and money. It took the better part of a week, every period, and it trusted a human to never miss a cent across hundreds of lines. Someone always had to check the numbers again by hand, because the cost of one mistake was too high to skip the second pass.
02 The system
One engine that runs the whole back office. It runs on its own each pay period, twice a month, with nobody starting it. It pulls and totals the team’s hours from their time-tracking, builds the pay period, and checks the figures before any of it posts. If something looks wrong, the run stops itself and says why, rather than pushing a bad number forward. It recomputes every amount in exact cents across two currencies and three pay structures, runs loan deductions across their lifecycle, and produces the payslips and a one-click batch payout for the whole team. It drafts every client invoice automatically, chases overdue clients with escalating reminders, and shows live receivables aging. It closes the books each month, profit and loss with year-to-date and month-over-month, in both currencies. It also tracks each person’s contract, loan, work anniversary for reviews and raises, and birthday. One system, from the first hour logged to the closed month.
03 How it holds up
Money is never a floating point number. Every amount is held as integer cents behind a typed boundary, so a rounding error cannot enter the math, and the tests prove it down to the half cent. Two independent checks stand between a wrong number and the books: the run reviews the period before it posts and halts itself if the figures look off, and the database refuses to close a period that does not balance. You get a note when the hours are in and when payroll is ready, and an alert the moment anything stops. Reverse a finalized pay run and every loan deduction reverses with it, so the books never drift. The month-end narrative is written under a strict guard, so every number in the prose comes from the real figures, not a guess. 496 tests pass in about two seconds, across 106 migrations, live in production.
04 The result
What took the better part of a week now runs in minutes, and the figures are exact, not approximately right. Payroll, payouts, invoicing, collections, the monthly close, and the people side all run from one system that checks its own math. The team stops stitching tools together, stops hunting for numbers, and stops checking the books by hand, because the engine already did.
· How it works
- 01
Hours in
It pulls and totals the team's hours from their time-tracking, builds the pay period on its own, and checks the figures before any of it posts. If a number looks wrong, the run stops itself and flags why.
- 02
Run payroll
Every amount recomputes in exact cents, across two currencies and three pay types, with loan deductions handled on their own.
- 03
Pay and invoice
One click exports a batch payout for the whole team. Every client invoice is generated, and a tailored email for each is written and queued as a draft for you to review and send.
- 04
Chase and age
Overdue clients get escalating reminders drafted for approval, and live receivables aging shows who owes what, by client, in 30, 60, and 90 day buckets.
- 05
Close the books
One click closes the month: profit and loss with year-to-date and month-over-month, aging, payroll, and balances in both currencies.
· Results
- Tests
- 496
- Money
- Exact to the cent
- Status
- Live in production
1. Money is held as integer cents behind a typed boundary, so a rounding error cannot enter the math. The tests prove the classic float trap, that a tenth plus two tenths comes to exactly thirty cents.
2. The database enforces the accounting rules itself and will not let a pay period close until it balances. Reverse a finalized period and every loan deduction reverses with it, so the books never drift.
3. It also tracks each person's loan to payoff, flags their 1- and 2-year anniversaries for a review, keeps their contract and birthday on file, and turns the data into payroll, profit, expense, per-client, and tax reports in one click. 496 tests, 106 migrations, live in production.