feat: add order ack detail/PDF, BOL detail/PDF, coil activity usage & receipts
C-005: Order Acknowledgement Detail + PDF - Order detail page with full line items, releases, addresses, paint codes - PDF export via Puppeteer matching legacy format - Clickable order # links and PDF icons in orders table C-007: BOL Detail + PDF - BOL detail page with ship-from/to, line items, weights - PDF export matching legacy BOL format - PDF icon column in shipments table C-008: Coil Activity - Usage Report - Date range picker (max 31 days, default last 10 days) - Reusable UI: Popover, Calendar (react-day-picker v9), DateRangePicker - SQL from legacy portal_CoilActivityUsage.sql with OnHandQty dedup - 11-column sortable table with search and CSV export C-009: Coil Activity - Receipts Report - VGL customer exception (special SQL vs portal view) - 10-column sortable table with search and CSV export - Shared date range picker component Also: dashboard API route, shipments API route, HDC→HDM mapping, Puppeteer PDF infrastructure, improved error handling. Progress: 9/16 Phase 2 tasks complete. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
cd95bc4218
commit
53c35cc273
39 changed files with 3894 additions and 355 deletions
70
TASKS.md
70
TASKS.md
|
|
@ -128,7 +128,7 @@
|
|||
|
||||
## Phase 2: Core Features (Est. 80-110 hrs)
|
||||
|
||||
**Progress:** 2/16 tasks complete
|
||||
**Progress:** 9/16 tasks complete
|
||||
|
||||
### C-001: Dashboard
|
||||
- [x] Dashboard page at `/(portal)/dashboard/page.tsx`
|
||||
|
|
@ -181,43 +181,53 @@
|
|||
- **Deps:** F-006, F-009 | **Est:** 6 hrs | **Status:** ✅ Complete
|
||||
|
||||
### C-005: Order Acknowledgement Detail + PDF
|
||||
- [ ] `/(portal)/orders/[id]/page.tsx`
|
||||
- [ ] Service: `getAcknowledgement(customer, poNumber?, orderNum?)` using `SalesOrder.sql`
|
||||
- [ ] Detail view with all order line information
|
||||
- [ ] PDF export button (generate PDF server-side)
|
||||
- **Deps:** C-004 | **Est:** 6 hrs
|
||||
- [x] `/(portal)/orders/[orderNum]/page.tsx` — client-side fetch with loading skeleton
|
||||
- [x] Service: `getOrderAcknowledgement(orderNum, custId)` with Epicor SQL (OrderHed/OrderDtl/OrderRel/Customer/ShipTo/Terms/ShipVia/Plant/JobProd)
|
||||
- [x] Detail view matching legacy PDF layout (addresses, order info, line items, releases, paint codes, comments, totals)
|
||||
- [x] PDF export via Puppeteer (`/api/orders/[orderNum]/pdf`)
|
||||
- [x] Orders table: clickable Order # links + PDF download icons
|
||||
- [x] Cross-customer security verified (BAS cannot access ACM orders)
|
||||
- [x] UTC date handling fix for correct date display
|
||||
- [x] FOB plant name resolution (code → description via Erp.Plant)
|
||||
- **Deps:** C-004 | **Est:** 6 hrs | **Status:** ✅ Complete
|
||||
|
||||
### C-006: Shipment List
|
||||
- [ ] `/(portal)/shipments/page.tsx`
|
||||
- [ ] Service: `getTop100Shipments(custId, dbName)` via `portal_GetShipmentsV1`
|
||||
- [ ] ShipToLoc formatting (replace `, ` with line breaks)
|
||||
- [ ] Data table with shipment details
|
||||
- [ ] Click-through to BOL detail
|
||||
- **Deps:** F-006, F-009 | **Est:** 5 hrs
|
||||
- [x] `/(portal)/shipments/page.tsx` — client-side fetch via API route (RSC-safe for large datasets)
|
||||
- [x] Service: `getTop100Shipments(custId)` via `portal_GetShipmentsV1` stored procedure
|
||||
- [x] ShipToLoc formatting (replace `, ` with newlines)
|
||||
- [x] Data table with search, sort, CSV export (teal-700 header)
|
||||
- [x] Click-through to BOL detail (`/shipments/{bol_num}`)
|
||||
- [x] API route at `/api/shipments` with auth + company context
|
||||
- **Deps:** F-006, F-009 | **Est:** 5 hrs | **Status:** ✅ Complete
|
||||
|
||||
### C-007: BOL Detail + PDF
|
||||
- [ ] `/(portal)/shipments/[bol]/page.tsx`
|
||||
- [ ] Service: `getBOL(bolNum, custId)` using `getBOL.sql`
|
||||
- [ ] Detail view with line items
|
||||
- [ ] PDF export
|
||||
- **Deps:** C-006 | **Est:** 4 hrs
|
||||
- [x] `/(portal)/shipments/[bol]/page.tsx`
|
||||
- [x] Service: `getBOL(bolNum, custId)` using `getBOL.sql`
|
||||
- [x] Detail view with line items
|
||||
- [x] PDF export
|
||||
- **Deps:** C-006 | **Est:** 4 hrs | **Status:** ✅ Complete
|
||||
|
||||
### C-008: Coil Activity - Usage Report
|
||||
- [ ] `/(portal)/coil-activity/usage/page.tsx`
|
||||
- [ ] Date range picker (with validation)
|
||||
- [ ] Service: `getCoilActivityUsage(custId, startDate, endDate)` using `portal_CoilActivityUsage.sql`
|
||||
- [ ] Deduplication logic: only show OnHandQty for most recent DateUsed per LotNum
|
||||
- [ ] Zero weights → null display
|
||||
- [ ] Data table with full column set
|
||||
- **Deps:** F-006, F-009 | **Est:** 6 hrs
|
||||
- [x] `/(portal)/coil-activity/usage/page.tsx`
|
||||
- [x] Date range picker (with validation — max 31 days, default last 10 days)
|
||||
- [x] Reusable UI components: Popover, Calendar (react-day-picker v9), DateRangePicker
|
||||
- [x] Service: `getCoilUsage(custId, startDate, endDate)` using legacy `portal_CoilActivityUsage.sql`
|
||||
- [x] Deduplication logic: only show OnHandQty for most recent DateUsed per LotNum
|
||||
- [x] Zero weights → null display
|
||||
- [x] Data table with all 11 columns: Date Used, Vorteq Part#, Cust Part#, Part Description, Lot#, Mfg Lot#, Weight, Plant Name, Job#, Cust PO#, Qty LB
|
||||
- [x] Search, sort, CSV export
|
||||
- [x] HDC→HDM customer ID mapping
|
||||
- **Deps:** F-006, F-009 | **Est:** 6 hrs | **Status:** ✅ Complete
|
||||
|
||||
### C-009: Coil Activity - Receipts Report
|
||||
- [ ] `/(portal)/coil-activity/receipts/page.tsx`
|
||||
- [ ] Date range picker
|
||||
- [ ] Service: `getCoilActivityReceipts(custId, startDate, endDate)`
|
||||
- [ ] VGL customer exception (use special SQL)
|
||||
- [ ] Data table with receipt columns
|
||||
- **Deps:** F-006, F-009 | **Est:** 4 hrs
|
||||
- [x] `/(portal)/coil-activity/receipts/page.tsx`
|
||||
- [x] Date range picker (shared component from C-008)
|
||||
- [x] Service: `getCoilReceipts(custId, startDate, endDate)` with VGL exception
|
||||
- [x] VGL customer exception: uses `VGLCoilReceiptsData.sql`; all others use `dbo.portal_CoilActivityReceipts` view
|
||||
- [x] Data table with all 10 columns: Date Rec, Vorteq Part#, Cust Part#, Part Description, Lot#, Mfg Lot#, Plant Name, Packing Slip, Supplier Name, Mill Order #
|
||||
- [x] Search, sort, CSV export
|
||||
- [x] HDC→HDM customer ID mapping
|
||||
- **Deps:** F-006, F-009 | **Est:** 4 hrs | **Status:** ✅ Complete
|
||||
|
||||
### C-010: Coil-by-Coil Report
|
||||
- [ ] `/(portal)/coil-activity/coil-by-coil/page.tsx`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue