mega-plant/lib
Dave d368f709f7 fix(expenses): remove Maintenance — the app runs on live data, not the sheet
The R 100 000 "Maintenance" section never had a home. On the workbook's Cost
sheet it is cell I97 — an orphaned figure with no section header above it and
no breakdown under it, sitting inside the sheet's own grand total of
R 1 110 486,87. Round 3 gave it a section, a card, a page and a sidebar entry
(7194e78). It was never a cost: nothing was ever attached to it.

The client ruled on 2026-11-05 that the app works from LIVE data and the
workbook is only history. So Maintenance comes out completely:

  - the live PocketBase row (section "Maintenance", R 100 000) is deleted
  - the seed row is removed from data/source/overheads.json, so a re-seed
    cannot bring it back
  - the card entry, the /expenses/maintenance page and the sidebar link
    are removed
  - data/source/overheads-extra.json — a DEAD file nothing imported (zero
    references anywhere in the repo; the seed reads overheads.json
    explicitly and only globs invoice-*.json) holding the round-2
    Insurance/Tracking sections plus a mislabelled duplicate
    "{ section: Cash Floats, description: Maintenance, incl: 100000 }" —
    is trashed

Both pages now read the same money: /expenses and /overheads both show
R 580 485,37, over 6 categories and 25 lines. The vehicle/overhead split
under the headline is R 143 326,36 tied to a vehicle and R 437 159,01
company overheads.

The reconciliation against the workbook gains a third itemised delta, and it
is a SUBTRACTION this time, because the workbook's grand total still counts
the orphan cell:

  R 1 110 486,87  workbook grand total (Cost sheet row 98)
- R   415 523,94  machine instalments — they live on each asset
- R    19 800,00  the workbook's own Personnel total is R 19 800 too high
+ R     5 322,44  Santam — the app keeps it, the workbook's subtotal skips it
- R   100 000,00  Maintenance — an orphan cell, removed from the app
= R   580 485,37  the roll-up

scripts/verify-cost-reconciliation.mjs now carries KNOWN_MAINTENANCE_REMOVED
and still exits 0 with R 0.00 unexplained. The note on /overheads is
generated from the constants, never typed, so it cannot drift. The three
signs matter: Personnel comes OFF, Santam goes back ON, Maintenance comes OFF.

AGENTS.md records the live-data ruling and renames the section heading from
"the cards are built FROM the sheet" to "FROM THE ROWS", since the sheet is
history and the rows are the truth.

The Subscriptions VAT errors (Charl - CCS, Buildsmart Yearly update) are
untouched — still flagged, still failing the seed loudly, still the client's
to fix.

Verified: typecheck clean; 162 tests (156 pass, 0 fail, 6 skipped);
production build clean and /expenses/maintenance gone from the route list;
reconciliation exits 0 with R 0.00 unexplained; /expenses and /overheads
both read R 580 485,37 at 375x812 with no overflow and no dead links.
2026-11-05 07:50:15 +02:00
..
auth-policy.test.ts feat: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00
auth-policy.ts Cash float card, Office role + Slips tab, job card PDF, manual close/delete 2026-10-22 15:09:57 +02:00
auth-service.test.ts feat: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00
auth-service.ts Job cards oil path, Fuel tab diesel-only, Mechanic role, Plant Register QR column 2026-10-22 13:44:01 +02:00
auth.ts feat(clock): add standalone employee clock PWA 2026-10-21 06:39:15 +02:00
cash-float-server.ts Cash float card, Office role + Slips tab, job card PDF, manual close/delete 2026-10-22 15:09:57 +02:00
cash-float.test.ts Cash float card, Office role + Slips tab, job card PDF, manual close/delete 2026-10-22 15:09:57 +02:00
cash-float.ts Cash float card, Office role + Slips tab, job card PDF, manual close/delete 2026-10-22 15:09:57 +02:00
chart-profit.ts Income: hide stood-down machines, with an active/inactive filter 2026-10-03 18:40:32 +02:00
clock-access.test.ts Cash float card, Office role + Slips tab, job card PDF, manual close/delete 2026-10-22 15:09:57 +02:00
clock-access.ts Cash float card, Office role + Slips tab, job card PDF, manual close/delete 2026-10-22 15:09:57 +02:00
clock-api.ts Clock app: vehicle-QR diesel book-out with meter photo; user access levels 2026-10-22 12:25:15 +02:00
clock-badge.ts feat(clock): add standalone employee clock PWA 2026-10-21 06:39:15 +02:00
clock-display.ts feat(clock): add standalone employee clock PWA 2026-10-21 06:39:15 +02:00
clock-lock.test.ts feat(clock): add standalone employee clock PWA 2026-10-21 06:39:15 +02:00
clock-lock.ts feat(clock): add standalone employee clock PWA 2026-10-21 06:39:15 +02:00
clock-origin.ts feat(clock): add standalone employee clock PWA 2026-10-21 06:39:15 +02:00
clock-pwa.test.ts feat(clock): add standalone employee clock PWA 2026-10-21 06:39:15 +02:00
clock-pwa.ts feat(clock): add standalone employee clock PWA 2026-10-21 06:39:15 +02:00
clock-request.test.ts feat(clock): add standalone employee clock PWA 2026-10-21 06:39:15 +02:00
clock-request.ts feat(clock): add standalone employee clock PWA 2026-10-21 06:39:15 +02:00
clock-rules.ts Add Workforce pages, Plant Clock tab bar and oil & diesel book-out 2026-10-22 11:39:18 +02:00
clock-store.ts Add Workforce pages, Plant Clock tab bar and oil & diesel book-out 2026-10-22 11:39:18 +02:00
clock.test.ts Add Workforce pages, Plant Clock tab bar and oil & diesel book-out 2026-10-22 11:39:18 +02:00
clock.ts Add Workforce pages, Plant Clock tab bar and oil & diesel book-out 2026-10-22 11:39:18 +02:00
cost-code.ts Add Running Costs sub-pages: insurance, financing, purchases, oil, operators, mechanics 2026-10-09 01:06:27 +02:00
data.ts feat(plant): vehicle site history from Fuel Logs 2026-11-05 00:18:24 +02:00
expenses-sections.test.ts fix(expenses): remove Maintenance — the app runs on live data, not the sheet 2026-11-05 07:50:15 +02:00
expenses-sections.ts fix(expenses): remove Maintenance — the app runs on live data, not the sheet 2026-11-05 07:50:15 +02:00
financing.ts fix(running): charge TLB06 for the months it was live, and not for November 2026-11-05 01:56:26 +02:00
income-month.test.ts feat(income): posted income per site, and the LIVE month on the overview 2026-11-05 00:19:06 +02:00
income-month.ts feat(running): the year to date AND the live month on the running-cost pages 2026-11-05 01:42:23 +02:00
insurance-rate-policy.json Add Running Costs sub-pages: insurance, financing, purchases, oil, operators, mechanics 2026-10-09 01:06:27 +02:00
insurance-rate-policy.ts Add Running Costs sub-pages: insurance, financing, purchases, oil, operators, mechanics 2026-10-09 01:06:27 +02:00
insurance.ts Add Running Costs sub-pages: insurance, financing, purchases, oil, operators, mechanics 2026-10-09 01:06:27 +02:00
intake-retry.test.ts feat: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00
intake-retry.ts feat: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00
invoice-booking-policy.json Invoices: line-item extraction, booking to plant items, VAT-inclusive income 2026-10-01 15:59:30 +02:00
invoice-booking-route.test.ts feat(income): posted income per site, and the LIVE month on the overview 2026-11-05 00:19:06 +02:00
invoice-booking.ts Invoices: line-item extraction, booking to plant items, VAT-inclusive income 2026-10-01 15:59:30 +02:00
invoice-parser.test.ts Test: a site typed without its space is deliberately NOT folded 2026-10-08 19:06:30 +02:00
invoice-parser.ts Invoices: one line per charge, and fold an abbreviated site 2026-10-06 11:25:10 +02:00
invoice-party-policy.json Split the invoice register into Internal and External Invoices 2026-10-08 11:49:48 +02:00
invoice-party.test.ts Split the invoice register into Internal and External Invoices 2026-10-08 11:49:48 +02:00
invoice-party.ts Split the invoice register into Internal and External Invoices 2026-10-08 11:49:48 +02:00
invoice-register.test.ts feat(income): posted income per site, and the LIVE month on the overview 2026-11-05 00:19:06 +02:00
invoice-register.ts feat(income): posted income per site, and the LIVE month on the overview 2026-11-05 00:19:06 +02:00
invoice-revalidate.ts feat(income): posted income per site, and the LIVE month on the overview 2026-11-05 00:19:06 +02:00
invoice-routes.ts Split the invoice register into Internal and External Invoices 2026-10-08 11:49:48 +02:00
job-card-pdf.ts Cash float card, Office role + Slips tab, job card PDF, manual close/delete 2026-10-22 15:09:57 +02:00
job-cards.ts Add Job Cards (vehicle-QR start/finish) and retire Operators/Mechanics pages 2026-10-22 12:54:59 +02:00
mechanics.ts Add Running Costs sub-pages: insurance, financing, purchases, oil, operators, mechanics 2026-10-09 01:06:27 +02:00
oil-log.ts Add Workforce pages, Plant Clock tab bar and oil & diesel book-out 2026-10-22 11:39:18 +02:00
oil.ts Add Workforce pages, Plant Clock tab bar and oil & diesel book-out 2026-10-22 11:39:18 +02:00
pb.ts Round 4: regressions fixed + mobile standard 2026-09-12 12:05:43 +02:00
plant-location-policy.json feat: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00
plant-map.test.ts feat: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00
plant-map.ts feat(plant): vehicle site history from Fuel Logs 2026-11-05 00:18:24 +02:00
plant-site-history.test.ts feat(plant): vehicle site history from Fuel Logs 2026-11-05 00:18:24 +02:00
plant-site-history.ts feat(plant): vehicle site history from Fuel Logs 2026-11-05 00:18:24 +02:00
plant-site-import.test.ts feat(plant): vehicle site history from Fuel Logs 2026-11-05 00:18:24 +02:00
plant-site-import.ts feat(plant): vehicle site history from Fuel Logs 2026-11-05 00:18:24 +02:00
plant-site-policy.json feat(plant): vehicle site history from Fuel Logs 2026-11-05 00:18:24 +02:00
profit.test.ts Mega Plant dashboard — fix & harden (Parts 0-5) 2026-09-12 09:35:48 +02:00
profit.ts Mega Plant dashboard — fix & harden (Parts 0-5) 2026-09-12 09:35:48 +02:00
purchase-booking.ts Fold purchase orders into the Running Costs Overview, with incl/excl totals 2026-10-09 12:10:13 +02:00
purchase-invoice-amount.test.ts Purchase invoices: price an invoice that has no amount 2026-11-04 18:06:02 +02:00
purchase-invoice-amount.ts Purchase invoices: price an invoice that has no amount 2026-11-04 18:06:02 +02:00
purchase-invoice-status.ts Suppliers: replace the menu entry with the new page, flag over-invoiced POs, audited invoice amount corrections 2026-10-29 20:49:05 +02:00
purchase-parser.ts Purchase invoices, Suppliers 2 with payments, multi-page PO parsing 2026-10-29 20:29:08 +02:00
qr-pdf.ts Add Workforce pages, Plant Clock tab bar and oil & diesel book-out 2026-10-22 11:39:18 +02:00
qr.ts Add Running Costs sub-pages: insurance, financing, purchases, oil, operators, mechanics 2026-10-09 01:06:27 +02:00
require-full.ts Add Suppliers list; book purchase orders and petty-cash slips against it 2026-10-22 15:43:57 +02:00
rows.test.ts Invoices: line-item extraction, booking to plant items, VAT-inclusive income 2026-10-01 15:59:30 +02:00
rows.ts feat(running): the year to date AND the live month on the running-cost pages 2026-11-05 01:42:23 +02:00
running-costs.ts fix(running): charge TLB06 for the months it was live, and not for November 2026-11-05 01:56:26 +02:00
running-month.test.ts fix(running): charge TLB06 for the months it was live, and not for November 2026-11-05 01:56:26 +02:00
server-data.ts Add Running Costs sub-pages: insurance, financing, purchases, oil, operators, mechanics 2026-10-09 01:06:27 +02:00
shrink-image.ts Cash float card, Office role + Slips tab, job card PDF, manual close/delete 2026-10-22 15:09:57 +02:00
site-income.test.ts feat(income): posted income per site, and the LIVE month on the overview 2026-11-05 00:19:06 +02:00
site-income.ts feat(income): posted income per site, and the LIVE month on the overview 2026-11-05 00:19:06 +02:00
sites.test.ts Give external invoices a supplier name; keep them off the sites page 2026-10-08 12:04:42 +02:00
sites.ts Give external invoices a supplier name; keep them off the sites page 2026-10-08 12:04:42 +02:00
stock-out.ts Job cards oil path, Fuel tab diesel-only, Mechanic role, Plant Register QR column 2026-10-22 13:44:01 +02:00
supplier-server.ts Add Suppliers list; book purchase orders and petty-cash slips against it 2026-10-22 15:43:57 +02:00
supplier-spend-data.ts feat(expenses): build the cards from the sheet, and make the total real 2026-11-05 07:26:58 +02:00
supplier-spend.ts Suppliers: replace the menu entry with the new page, flag over-invoiced POs, audited invoice amount corrections 2026-10-29 20:49:05 +02:00
supplier.test.ts Add Suppliers list; book purchase orders and petty-cash slips against it 2026-10-22 15:43:57 +02:00
supplier.ts Add Suppliers list; book purchase orders and petty-cash slips against it 2026-10-22 15:43:57 +02:00
utils.ts Mega Plant dashboard — fix & harden (Parts 0-5) 2026-09-12 09:35:48 +02:00
workforce-store.ts Add Workforce pages, Plant Clock tab bar and oil & diesel book-out 2026-10-22 11:39:18 +02:00
workforce.test.ts Add Workforce pages, Plant Clock tab bar and oil & diesel book-out 2026-10-22 11:39:18 +02:00
workforce.ts Add Workforce pages, Plant Clock tab bar and oil & diesel book-out 2026-10-22 11:39:18 +02:00