Bryce 359508ea9f feat(ledger): add a Prime Cost Report alongside the other ledger reports
Prime cost is what a restaurant is actually run on: what it sold against
what it paid people to sell it. Neither figure means much alone and the
ratio only reads as a trend, so this shows eight weeks rather than one
range — the same shape as the PCR Detail sheet of the Bi-Weekly workbook
it replaces.

The two halves come from deliberately different places. Payroll is read
from the ledger, because that is where payroll lands once it has been
coded to an account; taken from anywhere else it would not tie back to
the P&L sitting beside it. Sales are read from the daily sales summaries,
which are the reconciled books rather than the raw till feed.

That split is why it lives with the ledger reports despite only half of
it being ledger data. It has to agree with the P&L, so the payroll bands
come from `auto-ap.ledger.reports/groupings` rather than a second list
restated here — an earlier draft did restate them and silently dropped
the 60000-60999 general payroll band on the floor.

Details worth knowing:

- Sales are net: credits add, debits subtract, so discounts and returns
  reduce sales without special casing. Only the 40000 revenue block
  counts, so tax and tip (liabilities held for someone else) and the
  tender lines (the money side of the same transaction) are excluded.
- Payroll is debits less credits, so a correction posted as a credit
  reduces the week rather than counting as more labour.
- Week windows tile with an exclusive end, so no day is counted twice at
  a boundary.
- Sales categories are driven by what is in the data, so a restaurant
  that starts selling something new appears without editing this file.
- A week with no sales yields no ratio rather than dividing by zero.

Gated on the existing :profit-and-loss read permission, since it exposes
the same figures.

7 tests, 27 assertions.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 23:27:18 -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%