The container lines (MPLANT04/MPLANT05) have no matching plant item, so they
sat unbooked forever with no way to account for them. They can now be booked
to a SITE instead.
`sites` is a new PocketBase collection derived from the invoices — each
distinct invoice site becomes a site, created as invoices are imported. They
are never hand-typed, and never deleted: a site can carry notes and hold line
bookings, so removing one would orphan that history.
/sites lists every site with its revenue ex VAT, its VAT, the total billed,
how many invoices and machines it carries, and how many lines are still
outstanding. Each row links to a detail page listing the site's invoices and
every line item with its ex-VAT/VAT/total split. Nav: Dashboard is now a
group with Overview and Sites.
Booking a line to a site posts NO income — there is no machine to carry it —
it only marks the line accounted for, so it stops showing as unbooked. Exactly
one of booked_asset / booked_site is ever set, and a line with neither is what
surfaces as unbooked everywhere.
One container per site, as specified: once a machine-less line has taken a
site, that site is withheld from the next one's picker and shown disabled
("already has one") rather than hidden. Free sites sort to the top. The rule is
enforced server-side too, so it does not depend on the UI being the only way in —
re-posting a taken site is refused with 409. Verified: booking The Hills, then
trying again, then taking West Park, and the remaining line sees 8 free and 2
taken. Clearing a booking frees its site.
The site picker only appears on lines that need it — no machine, or one already
booked to a site — so fully-booked rows keep a single control.
Also fixed the Sidebar's group-active check, which derived its prefix from the
first child. For a group whose first child is "/" that yields "/" and matched
every route, so Dashboard would have been highlighted on every page.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
47 lines
1.3 KiB
JSON
47 lines
1.3 KiB
JSON
{
|
|
"name": "mega-plant",
|
|
"version": "0.1.0",
|
|
"private": true,
|
|
"scripts": {
|
|
"dev": "next dev --webpack -H 0.0.0.0 -p 6007",
|
|
"build": "next build --webpack",
|
|
"start": "next start -H 0.0.0.0 -p 6007",
|
|
"lint": "next lint",
|
|
"typecheck": "tsc --noEmit",
|
|
"seed": "node scripts/seed.mjs"
|
|
},
|
|
"dependencies": {
|
|
"@ducanh2912/next-pwa": "^10.2.9",
|
|
"@radix-ui/react-dialog": "^1.1.4",
|
|
"@radix-ui/react-dropdown-menu": "^2.1.4",
|
|
"@radix-ui/react-label": "^2.1.1",
|
|
"@radix-ui/react-select": "^2.1.4",
|
|
"@radix-ui/react-slot": "^1.1.1",
|
|
"@radix-ui/react-tabs": "^1.1.2",
|
|
"@radix-ui/react-tooltip": "^1.1.6",
|
|
"@types/leaflet": "^1.9.22",
|
|
"class-variance-authority": "^0.7.1",
|
|
"clsx": "^2.1.1",
|
|
"leaflet": "^1.9.4",
|
|
"lucide-react": "^0.469.0",
|
|
"next": "^16",
|
|
"pdfjs-dist": "^4.10.38",
|
|
"pocketbase": "^0.27.3",
|
|
"react": "^19.0.0",
|
|
"react-dom": "^19.0.0",
|
|
"react-leaflet": "^5.0.0",
|
|
"recharts": "^2.15.0",
|
|
"tailwind-merge": "^2.6.0",
|
|
"xlsx": "^0.18.5"
|
|
},
|
|
"devDependencies": {
|
|
"@tailwindcss/postcss": "^4.0.0",
|
|
"@types/node": "^22.10.0",
|
|
"@types/react": "^19.0.0",
|
|
"@types/react-dom": "^19.0.0",
|
|
"postcss": "^8.4.49",
|
|
"tailwindcss": "^4.0.0",
|
|
"tsx": "^4.19.2",
|
|
"typescript": "^5.7.2"
|
|
}
|
|
}
|