mega-plant/scripts
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
..
audit-auth-mobile.mjs feat(clock): add standalone employee clock PWA 2026-10-21 06:39:15 +02:00
backfill-suppliers.mjs Add Suppliers list; book purchase orders and petty-cash slips against it 2026-10-22 15:43:57 +02:00
book-invoice.mjs Re-link invoice lines whose target asset a seed replaced 2026-10-09 00:52:52 +02:00
extract.mjs Round 2 (Parts B-D): asset register restructure, type field, sequential codes, flat sortable table, cost_lines, removed synthetic code, fail loudly 2026-09-12 10:24:26 +02:00
import-plant-sites.ts feat(plant): vehicle site history from Fuel Logs 2026-11-05 00:18:24 +02:00
seed.mjs feat(plant): vehicle site history from Fuel Logs 2026-11-05 00:18:24 +02:00
setup-asset-qr.mjs Job cards oil path, Fuel tab diesel-only, Mechanic role, Plant Register QR column 2026-10-22 13:44:01 +02:00
setup-auth.mjs Clock app: vehicle-QR diesel book-out with meter photo; user access levels 2026-10-22 12:25:15 +02:00
setup-cash-float-collection.mjs Cash float card, Office role + Slips tab, job card PDF, manual close/delete 2026-10-22 15:09:57 +02:00
setup-clock.mjs Add Workforce pages, Plant Clock tab bar and oil & diesel book-out 2026-10-22 11:39:18 +02:00
setup-financing-collections.mjs Add Running Costs sub-pages: insurance, financing, purchases, oil, operators, mechanics 2026-10-09 01:06:27 +02:00
setup-insurance-collections.mjs Add Running Costs sub-pages: insurance, financing, purchases, oil, operators, mechanics 2026-10-09 01:06:27 +02:00
setup-invoice-collections.mjs Sites: auto-allocate container lines to the container the site hires 2026-10-02 18:32:12 +02:00
setup-invoice-edits-collection.mjs 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
setup-job-cards-collection.mjs Cash float card, Office role + Slips tab, job card PDF, manual close/delete 2026-10-22 15:09:57 +02:00
setup-mechanics-collections.mjs Add Running Costs sub-pages: insurance, financing, purchases, oil, operators, mechanics 2026-10-09 01:06:27 +02:00
setup-oil-collections.mjs Clock app: vehicle-QR diesel book-out with meter photo; user access levels 2026-10-22 12:25:15 +02:00
setup-operators-collections.mjs Add Workforce pages, Plant Clock tab bar and oil & diesel book-out 2026-10-22 11:39:18 +02:00
setup-plant-site-history.mjs feat(plant): vehicle site history from Fuel Logs 2026-11-05 00:18:24 +02:00
setup-purchase-collections.mjs Add Running Costs sub-pages: insurance, financing, purchases, oil, operators, mechanics 2026-10-09 01:06:27 +02:00
setup-purchase-invoices-collection.mjs Purchase invoices, Suppliers 2 with payments, multi-page PO parsing 2026-10-29 20:29:08 +02:00
setup-site-assignment.mjs Sites: auto-allocate container lines to the container the site hires 2026-10-02 18:32:12 +02:00
setup-supplier-payments-collection.mjs Purchase invoices, Suppliers 2 with payments, multi-page PO parsing 2026-10-29 20:29:08 +02:00
setup-suppliers-collection.mjs Add Suppliers list; book purchase orders and petty-cash slips against it 2026-10-22 15:43:57 +02:00
verify-auth-routes.mjs Add Workforce pages, Plant Clock tab bar and oil & diesel book-out 2026-10-22 11:39:18 +02:00
verify-clock-pwa.mjs feat(clock): add standalone employee clock PWA 2026-10-21 06:39:15 +02:00
verify-clock.mjs Add Workforce pages, Plant Clock tab bar and oil & diesel book-out 2026-10-22 11:39:18 +02:00
verify-cost-reconciliation.mjs fix(expenses): remove Maintenance — the app runs on live data, not the sheet 2026-11-05 07:50:15 +02:00