WFDASH-WEBAPP/src/lib/pdf
SJCoetz 6033aba18d fix(stocktake-pdf): match /stock columns + add button on /stock page
The original Stocktake PDF columns (Name, SKU, Location, Unit,
Current qty, blank Actual, Supplier) didn't match what the
operator sees on /stock. They pointed at the wrong list — they
worked for a blank-column walk-through stocktake form, but the
user wants to print the /stock list as it appears on screen.

This rewrite makes the Stocktake PDF mirror the /stock table
column-for-column:
- SKU, Name, Supplier, Current, Min, Target, Location, Status
- Status derived via getStockStatus + STOCK_STATUS_STYLES so
  it matches the on-screen badge label
- Current qty now renders with the unit suffix (matching the
  on-screen cell)
- Target renders '—' when null/undefined/0, matching /stock

Also:
- Switched to landscape A4 to give 8 columns room (was
  portrait).
- Added a copy of the 'Download Stocktake PDF' button on the
  /stock page next to 'New stock item' — both /stock and
  /stock-orders now expose the same endpoint. Button uses the
  same plain <a target='_blank' rel='noopener'> pattern as
  the existing stock-orders buttons, with aria-hidden on the
  Download icon.
- Added a test on /stock for the new link (href, target,
  rel). 33/33 tests pass.

Co-authored-by: Orca <help@stably.ai>
2026-08-03 18:18:58 +02:00
..
delivery-note-document.tsx feat(invoicing): add complete delivery note workflow 2026-07-14 17:35:36 +02:00
format.test.ts feat: add quote templates, improved email, new statuses 2026-06-24 22:57:01 +02:00
format.ts feat: add quote templates, improved email, new statuses 2026-06-24 22:57:01 +02:00
purchase-order-document.tsx feat: collection-map updates, todays-stops, quote/approval rework, buyer-tasks, e2e 2026-08-03 09:33:45 +02:00
quote-document.tsx chore: add logos, opencode config and build assets 2026-07-27 08:21:20 +02:00
render.test.ts feat(pdf): list-pdf documents for stock orders + stocktake 2026-08-03 16:13:14 +02:00
render.tsx feat(pdf): list-pdf documents for stock orders + stocktake 2026-08-03 16:13:14 +02:00
stock-item-stocktake-document.tsx fix(stocktake-pdf): match /stock columns + add button on /stock page 2026-08-03 18:18:58 +02:00
stock-purchase-document.tsx feat(stock-purchases,driver-app): add stock purchase workflow and driver pickup support 2026-07-18 22:43:50 +02:00
stock-purchase-list-document.tsx fix(pdf): repeat table headers on every page in list reports 2026-08-03 16:23:12 +02:00