Mirrors the customer-PO PDF regenerate flow on /orders/[id] for stock purchases. Adds a regenerate modal that captures a free-text reason (defaults to 'Initial generation' for v1, blank for v2+) and posts to /api/v1/stock-purchases/[id]/pdf, appending to purchase.documents_history with the new version + reason. The Generate PDF button replaces the existing static action when no version exists yet. Refetches via fetchAll so the documents card picks up the new entry. 215 lines of new test coverage on page.test.tsx. |
||
|---|---|---|
| .. | ||
| (app) | ||
| (auth) | ||
| (counter) | ||
| (mobile) | ||
| (print) | ||
| (rep)/rep | ||
| (tv) | ||
| api | ||
| favicon.ico | ||
| globals.css | ||
| layout.tsx | ||
| offline.tsx | ||
| page.tsx | ||