Bryce 011d515033 docs(sales-summaries): single report, rebuilt on a pristine restore
Deletes and restores the database to backup point 209608347, then runs the whole
pipeline on untouched production data with the corrected split: deactivate the
duplicate client per location, give every order its own payment record,
client-scope refunds, payouts and cash-drawer shifts, import live from Square,
and recompute ninety days at each stage.

  production today   1,280 days off, 85.34% clean, $75,228.78
  + deduplication    1,087 days off, 87.55% clean, $63,764.92
  + refunded tips      800 days off, 90.84% clean, $60,619.21
  + service charges    108 days off, 98.76% clean,  $1,995.36

1,172 client-days brought into balance, 0 knocked out. Neither arithmetic fix
altered a single figure on a day that already balanced. Excluding the ten
deactivated duplicates: 1,217 days and $69,995.61 down to 105 days and $852.38.

The split does what it was missing before: 189,167 payments re-keyed, 77,599
copied so each order owns one, and payments with two parent orders went 11,469
to 0 — holding at 0 after a live import across 48,362 orders. That closes the
component-cascade risk in remove-voided-orders.

Report rewritten for both audiences: what each fault meant for the books, then
the mechanism for engineers, with worked line-level examples, the verification
checks, the residual, and the open decisions. Includes the double-scoping bug
this work introduced and how measurement caught it.

23 tests, 55 assertions.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-15 13:49:44 -07:00
2024-02-08 11:41:03 -08:00
2019-01-26 09:02:28 -08:00
2026-06-04 22:59:51 -07:00
2024-05-02 20:37:13 -07:00
2026-08-14 18:19:41 -07:00
2024-11-17 22:32:43 -08:00
2026-05-19 09:21:28 -07:00
ok.
2026-02-08 08:43:53 -08:00
2022-09-26 16:12:39 -07:00
2026-04-25 19:41:40 -07:00
2023-10-12 21:55:37 -07:00
2023-07-27 09:50:22 -07:00
2018-09-03 13:12:20 -07:00
2019-01-26 09:02:28 -08:00
2022-12-08 08:51:34 -08:00
2019-01-26 09:02:28 -08:00
2019-04-24 21:29:38 -07:00
2024-10-18 23:21:49 -07:00
2026-07-25 21:13:44 -07:00
2023-03-24 10:57:53 -07:00
2023-08-31 23:43:19 -07:00
2026-05-19 09:21:28 -07:00
2024-02-08 20:36:04 -08:00
2021-10-08 16:18:31 -07:00
fix
2022-06-23 08:44:44 -07:00
2026-04-09 14:32:39 -07:00
2024-03-14 07:16:59 -07:00
Description
No description provided
22 MiB
Languages
Clojure 91%
CSS 4.2%
Sass 2.3%
HTML 1.2%
HCL 0.4%
Other 0.7%