mega-plant/components
David d055c344de feat(running): drive the charts and the profit from the running-cost register
The machine charts plotted the workbook's monthly_income.fixed_expenses, which
is NOT the app's running cost. So the charts and the /running Overview
disagreed about the same machine in the same month — CT01 by R 40 640, DT01 by
R 121 115. The workbook's figure also carries depreciation/ownership and an
operator allocation, which are capital recovery and overhead rather than
running cost.

Every cost value now comes from the running-cost register: fixed = insurance
+ financing, running = purchases. Profit is income - fixed - running, and it
is ONE formula on every surface, so /charts, /income and the dashboard quote
the same figure for the same machine.

  R 8 456 243  fleet income, Jan-Oct
- R 4 705 292  fixed   (insurance + financing, from the register)
- R   306 387  running (purchases, from the register)
= R 3 444 564  profit   (was R 2 510 908 on the workbook's fixed)

The legacy repairs sheet comes out completely. It was the old workbook's
"Plant Monthly Running Cost" — read by no page, maintained by nobody — and a
repair is bought on a purchase order, so its money is already in Purchases.
The collection is still seeded, so the history is not lost, but it is no
longer in any total, any chart or any profit.

Also:
  - the profit badge wears the CHART's own green, and profit is green and
    loss red on every surface. It was hard-coded to the teal brand colour,
    so the label and the line it labelled were two different colours.
  - September and October now state a profit instead of a dash: the dash
    existed because the workbook had not posted those months' fixed costs,
    and the register has the premium and the instalment for every month.
  - the containers and the water trailers show profit equal to their income,
    because the running-cost model carries no cost for them.

Overheads roll-up — an audit found three things out of order, and the roll-up
total itself reconciles exactly (R 580 485,37, unexplained R 0,00):

  - the dashboard's Overhead mix legend named only five of the six sections,
    so the figures it listed added up to R 565 489 against a headline of
    R 580 485, and the donut drew a slice nobody could name.
  - the /overheads note claimed machine instalments were excluded, while the
    Bastion Finance block on the same page carried R 115 575,94 of them and
    R 11 204,76 of insurance for the same machines. The note now says so,
    with the figures read off the rows at render time.
  - two Subscriptions rows had VAT that did not balance — the sheet had the
    TOTAL in the VAT cell (115%), and annual excl/VAT against a monthly
    total. Both are corrected on the client's instruction; the roll-up total
    does not move, only the VAT breakdown does, and the seed's VAT gate now
    passes instead of exiting non-zero.

Verified: 161 tests pass (4 new ones pin the register join), the production
build is clean, the reconciliation script passes, and the charts, the profit
label and the overhead legend were checked on screen.
2026-11-05 21:24:30 +02:00
..
auth Cash float card, Office role + Slips tab, job card PDF, manual close/delete 2026-10-22 15:09:57 +02:00
workforce Add Job Cards (vehicle-QR start/finish) and retire Operators/Mechanics pages 2026-10-22 12:54:59 +02:00
AccountMenu.tsx feat: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00
BadgeCamera.tsx Clock app: search + scanner on one screen; employee on fuel; drop codeless vehicles 2026-10-22 13:55:13 +02:00
BookedOutTable.tsx Clock app: vehicle-QR diesel book-out with meter photo; user access levels 2026-10-22 12:25:15 +02:00
BuildStamp.tsx feat: show the build commit as a faint corner mark 2026-10-30 01:27:22 +02:00
CashFloatCard.tsx Add Suppliers list; book purchase orders and petty-cash slips against it 2026-10-22 15:43:57 +02:00
ChartsGrid.tsx feat(running): drive the charts and the profit from the running-cost register 2026-11-05 21:24:30 +02:00
ClockAppHeader.tsx feat(clock): add standalone employee clock PWA 2026-10-21 06:39:15 +02:00
ClockBottomNav.tsx Cash float card, Office role + Slips tab, job card PDF, manual close/delete 2026-10-22 15:09:57 +02:00
ClockInstallPrompt.tsx feat(clock): add standalone employee clock PWA 2026-10-21 06:39:15 +02:00
DashboardCharts.tsx feat(running): drive the charts and the profit from the running-cost register 2026-11-05 21:24:30 +02:00
ExpenseSectionPage.tsx feat: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00
FinancingView.tsx Add Running Costs sub-pages: insurance, financing, purchases, oil, operators, mechanics 2026-10-09 01:06:27 +02:00
FuelSiteImport.tsx feat(plant): vehicle site history from Fuel Logs 2026-11-05 00:18:24 +02:00
GlobalSearch.tsx feat: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00
IncomeOverview.tsx feat(income): posted income per site, and the LIVE month on the overview 2026-11-05 00:19:06 +02:00
IncomeView.tsx feat(running): drive the charts and the profit from the running-cost register 2026-11-05 21:24:30 +02:00
InsuranceView.tsx feat(running): the year to date AND the live month on the running-cost pages 2026-11-05 01:42:23 +02:00
InvoiceIntake.tsx Give external invoices a supplier name; keep them off the sites page 2026-10-08 12:04:42 +02:00
InvoiceList.tsx feat(income): posted income per site, and the LIVE month on the overview 2026-11-05 00:19:06 +02:00
InvoiceMonthFilter.tsx feat(income): posted income per site, and the LIVE month on the overview 2026-11-05 00:19:06 +02:00
InvoiceRegisterPage.tsx feat(income): posted income per site, and the LIVE month on the overview 2026-11-05 00:19:06 +02:00
InvoiceTable.tsx feat(income): posted income per site, and the LIVE month on the overview 2026-11-05 00:19:06 +02:00
InvoiceUploader.tsx Invoices: line-item extraction, booking to plant items, VAT-inclusive income 2026-10-01 15:59:30 +02:00
JobCardsTable.tsx Cash float card, Office role + Slips tab, job card PDF, manual close/delete 2026-10-22 15:09:57 +02:00
JobScanner.tsx Clock app: search + scanner on one screen; employee on fuel; drop codeless vehicles 2026-10-22 13:55:13 +02:00
MachineCombobox.tsx Invoices: a machine chosen in the dropdown was never actually booked 2026-10-03 15:43:46 +02:00
MachineLineChart.tsx feat(running): drive the charts and the profit from the running-cost register 2026-11-05 21:24:30 +02:00
OilsBoard.tsx Clock app: vehicle-QR diesel book-out with meter photo; user access levels 2026-10-22 12:25:15 +02:00
OilsStock.tsx Add Workforce pages, Plant Clock tab bar and oil & diesel book-out 2026-10-22 11:39:18 +02:00
PlantClock.tsx Clock app: vehicle-QR diesel book-out with meter photo; user access levels 2026-10-22 12:25:15 +02:00
PlantMap.tsx feat(plant): vehicle site history from Fuel Logs 2026-11-05 00:18:24 +02:00
PlantMapLoader.tsx Map: dark tiles from Esri, because CARTO retired keyless access 2026-10-03 09:20:24 +02:00
PlantRegisterTable.tsx feat(plant): vehicle site history from Fuel Logs 2026-11-05 00:18:24 +02:00
PurchaseIntake.tsx Purchase invoices: price an invoice that has no amount 2026-11-04 18:06:02 +02:00
QrCode.tsx Add Running Costs sub-pages: insurance, financing, purchases, oil, operators, mechanics 2026-10-09 01:06:27 +02:00
QrTextCell.tsx Job cards oil path, Fuel tab diesel-only, Mechanic role, Plant Register QR column 2026-10-22 13:44:01 +02:00
RunningView.tsx feat(running): drive the charts and the profit from the running-cost register 2026-11-05 21:24:30 +02:00
ScrollFade.tsx Fix: the mobile table was mislabelled and clipping its own totals 2026-10-02 15:34:19 +02:00
SearchPicker.tsx Add Job Cards (vehicle-QR start/finish) and retire Operators/Mechanics pages 2026-10-22 12:54:59 +02:00
Sidebar.tsx feat(clock): add standalone employee clock PWA 2026-10-21 06:39:15 +02:00
SiteBookingSelect.tsx Invoices: fix the tablet layout and make booking an unbooked line obvious 2026-10-03 09:59:05 +02:00
SiteContainerEditor.tsx Sites: auto-allocate container lines to the container the site hires 2026-10-02 18:32:12 +02:00
SiteCoordinateEditor.tsx Sites: give every site coordinates 2026-10-02 16:33:43 +02:00
SiteIncomeView.tsx feat(income): posted income per site, and the LIVE month on the overview 2026-11-05 00:19:06 +02:00
SitesOverview.tsx feat(income): posted income per site, and the LIVE month on the overview 2026-11-05 00:19:06 +02:00
SitesView.tsx feat(income): posted income per site, and the LIVE month on the overview 2026-11-05 00:19:06 +02:00
SlipCapture.tsx Add Suppliers list; book purchase orders and petty-cash slips against it 2026-10-22 15:43:57 +02:00
Sparkline.tsx Invoices: keep the PDF on the invoice, and search the invoice's own words 2026-10-02 19:09:16 +02:00
StockOut.tsx Cash float card, Office role + Slips tab, job card PDF, manual close/delete 2026-10-22 15:09:57 +02:00
SupplierCell.tsx Give external invoices a supplier name; keep them off the sites page 2026-10-08 12:04:42 +02:00
Suppliers2View.tsx Suppliers: dark-mode contrast for monthly figures and coloured text; heading drawn in the view (React key warning) 2026-10-29 21:16:54 +02:00
SuppliersView.tsx Add Suppliers list; book purchase orders and petty-cash slips against it 2026-10-22 15:43:57 +02:00
ThemeProvider.tsx Mega Plant dashboard — fix & harden (Parts 0-5) 2026-09-12 09:35:48 +02:00
ThemeToggle.tsx feat: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00
Toast.tsx Fix: toast and machine dropdown were rendering behind the page chrome 2026-10-02 18:42:29 +02:00
VehicleSiteHistory.tsx feat(plant): vehicle site history from Fuel Logs 2026-11-05 00:18:24 +02:00