Previously a PO's free-text line items only became reusable catalogue products (/inventory/items) on full payment (markPaid → syncProductCatalog). An approved- but-unpaid PO's items weren't selectable for further POs yet. - extract syncProductCatalog into lib/product-catalog.ts (shared). - call it from approvePo so approved items are immediately catalogued (create product by name if unknown, link the line item, upsert last/per-vendor price); payment still re-syncs to refresh prices. Idempotent. - test: approving a PO with a free-text line creates + links the product and records the per-vendor price. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| admin | ||
| approvals | ||
| crewing | ||
| dashboard | ||
| history | ||
| inventory | ||
| my-orders | ||
| payments | ||
| po | ||
| profile | ||
| layout.tsx | ||