No description
Quotes and purchase orders were silently losing their line items. Quote items field was a multi-relation to stock_items, but PocketBase stored only the last id as a plain string no matter how it was sent (JSON string via FormData, raw array, or repeated FormData entries). Every quote created through the UI had `items: ""` or `items: "<id>"`. Recreated the field as JSON so an array of stock_item ids round-trips (companion fields quantities/unitPrices already line up with it). PO snapshot_items had the same class of bug from the other direction: String(obj) coerced the snapshot array to "[object Object]", which PocketBase stored verbatim, rendering the PO as N rows of "Unknown / £0.00". The form now sends JSON-stringified arrays, and the reader only trusts a snapshot whose rows actually carry a name. Also fixes: - Quote item lines are hydrated from stock_items; the parallel quantities/unitPrices arrays are the source of truth, so quotes written before the schema fix still render and total correctly. - Quote form rejects stock rows where no item was actually picked from the dropdown, instead of saving an empty stockItemId. - PO PDF filename is now the plain order number (PO-20261015-001.pdf). Adds the quotes.items schema migration plus three dev scripts for creating a quote, re-applying the field fix and rendering a test PDF. |
||
|---|---|---|
| .cursor | ||
| .playwright-mcp | ||
| backup | ||
| docs | ||
| n8n | ||
| pocketbase | ||
| public | ||
| scripts | ||
| server | ||
| src | ||
| .env.example | ||
| .gitignore | ||
| .mcp.json | ||
| AI_RULES.md | ||
| app-overview.png | ||
| components.json | ||
| dashboard-updated.png | ||
| eslint.config.js | ||
| index.html | ||
| LOGGING_IMPLEMENTATION.md | ||
| login-mobile-final.png | ||
| login-mobile.png | ||
| login-page-final.png | ||
| login-page.png | ||
| nixpacks.json | ||
| package-lock.json | ||
| package.json | ||
| postcss.config.js | ||
| quote-dialog.png | ||
| quote-fixed.png | ||
| quote-form.png | ||
| quote-page.png | ||
| quote-page2.png | ||
| quote-screenshot.png | ||
| README.md | ||
| setup-users.js | ||
| tailwind.config.js | ||
| tailwind.config.ts | ||
| test-logging.js | ||
| tsconfig.app.json | ||
| tsconfig.json | ||
| tsconfig.node.json | ||
| vercel.json | ||
| vite.config.ts | ||