mega-plant/components
Dave 696c157e2e Purchase invoices: price an invoice that has no amount
An invoice saved with no amount landed as amount_incl = 0 (PocketBase
stores a number field as zero, not null), so the PO read "R 0,00 invoiced"
and the money never booked. There were two ways to give it an amount and
neither worked: the Upload-invoice modal let a blank amount save silently,
while the double-click correction form refused to save without a value AND
a written reason, and sat behind Edit mode.

- lib/purchase-invoice-amount.ts holds the rules, shared by the screen and
  the API so they cannot disagree. R0 is not an amount: a blank amount and
  a figure of zero are both refused, so an invoice can never land as zero.
- The API now separates PRICING an invoice that never had an amount (no
  reason owed, still logged) from CORRECTING one that was booked (Full user
  + a reason, as before).
- Double-clicking an amount on a PO opens the ordinary invoice modal on
  that invoice, with the amount field waiting. The inline correction form is
  gone — one window, one rule. There is no pencil button: a booked figure
  must take a deliberate second gesture, so a single stray tap never opens
  a form that can rewrite money.
- The PO-lines table freezes its Description column with an opaque
  background and fades its right edge, so it passes the mobile checklist.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-11-04 18:06:02 +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: add user access and improve plant dashboard 2026-10-06 04:02:08 +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: add user access and improve plant dashboard 2026-10-06 04:02:08 +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
GlobalSearch.tsx feat: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00
IncomeView.tsx Income: the tiles and the machine list were sharing the title's flex row 2026-10-06 11:05:37 +02:00
InsuranceView.tsx Add Running Costs sub-pages: insurance, financing, purchases, oil, operators, mechanics 2026-10-09 01:06:27 +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 Give external invoices a supplier name; keep them off the sites page 2026-10-08 12:04:42 +02:00
InvoiceRegisterPage.tsx Give external invoices a supplier name; keep them off the sites page 2026-10-08 12:04:42 +02:00
InvoiceTable.tsx Invoices: a machine chosen in the dropdown was never actually booked 2026-10-03 15:43:46 +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: add user access and improve plant dashboard 2026-10-06 04:02:08 +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: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00
PlantMapLoader.tsx Map: dark tiles from Esri, because CARTO retired keyless access 2026-10-03 09:20:24 +02:00
PlantRegisterTable.tsx Job cards oil path, Fuel tab diesel-only, Mechanic role, Plant Register QR column 2026-10-22 13:44:01 +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 Stop the Running Costs grid at the current month 2026-10-09 12:35:52 +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
SitesView.tsx Sites: a card list that reads like the income screen 2026-10-03 09:20:20 +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