From 1ed2642e202369d880b7c126414c3fc4064e1163 Mon Sep 17 00:00:00 2001 From: adamp Date: Mon, 9 Feb 2026 21:20:59 -0600 Subject: [PATCH] Add restock history tracking, payment tracking, and reports page - New stock_adjustments table logs every stock change (restock, order create/update/delete) with reason and reference - Orders now track payment_method and amount_paid with validation - New /api/reports endpoint with 5 aggregation queries and date filtering - Reports page with date range presets and sales, customer, revenue, status, and inventory sections - Payment fields added to OrderNew and OrderDetail pages with balance due - Girl Scouts trefoil logo added to header - Vite dev server exposed on network for mobile access Co-Authored-By: Claude Opus 4.6 --- client/src/App.jsx | 2 + client/src/assets/gs-trefoil.svg | 1 + client/src/components/Layout.jsx | 4 +- client/src/pages/OrderDetail.jsx | 40 +++++ client/src/pages/OrderNew.jsx | 30 ++++ client/src/pages/Reports.jsx | 288 +++++++++++++++++++++++++++++++ client/vite.config.js | 1 + server/db.js | 12 ++ server/index.js | 2 + server/routes/orders.js | 30 +++- server/routes/products.js | 24 +++ server/routes/reports.js | 95 ++++++++++ 12 files changed, 522 insertions(+), 7 deletions(-) create mode 100644 client/src/assets/gs-trefoil.svg create mode 100644 client/src/pages/Reports.jsx create mode 100644 server/routes/reports.js diff --git a/client/src/App.jsx b/client/src/App.jsx index 68191ec..c03c54a 100644 --- a/client/src/App.jsx +++ b/client/src/App.jsx @@ -10,6 +10,7 @@ import Orders from './pages/Orders'; import OrderNew from './pages/OrderNew'; import OrderDetail from './pages/OrderDetail'; import Restock from './pages/Restock'; +import Reports from './pages/Reports'; function AuthGate({ children }) { const [state, setState] = useState({ checked: false, authenticated: false }); @@ -53,6 +54,7 @@ export default function App() { } /> } /> } /> + } /> )} diff --git a/client/src/assets/gs-trefoil.svg b/client/src/assets/gs-trefoil.svg new file mode 100644 index 0000000..8c135d4 --- /dev/null +++ b/client/src/assets/gs-trefoil.svg @@ -0,0 +1 @@ + diff --git a/client/src/components/Layout.jsx b/client/src/components/Layout.jsx index 8d61d16..bc150fb 100644 --- a/client/src/components/Layout.jsx +++ b/client/src/components/Layout.jsx @@ -1,6 +1,7 @@ import { useState } from 'react'; import { Link, useLocation } from 'react-router-dom'; import { api } from '../api'; +import trefoilLogo from '../assets/gs-trefoil.svg'; const navItems = [ { path: '/', label: 'Dashboard' }, @@ -8,6 +9,7 @@ const navItems = [ { path: '/customers', label: 'Customers' }, { path: '/orders', label: 'Orders' }, { path: '/restock', label: 'Restock' }, + { path: '/reports', label: 'Reports' }, ]; export default function Layout({ children, onLogout }) { @@ -23,7 +25,7 @@ export default function Layout({ children, onLogout }) {
- Cookie Tracker + Girl ScoutsCookie Tracker