No description
Find a file
Dave 2682eeb360 fix(po): store the price from the form so POs stop printing £0.00
Every purchase order created from a stock item printed a £0.00 unit
price, even though a cost price was on the record and the form showed
the right number.

Cause: the PO snapshot took costPriceGBP from the stock item's stored
cost_price_gbp instead of from the form. The price the user sees (and
types) into the "Unit Price (£ GBP)" field landed in snapshot.costPrice,
which nothing renders, while the PO PDF renders snapshot.costPriceGBP
(pdf.ts: `£${item.costPriceGBP}`). So a price typed into the form was
discarded and the stock item's cached value was printed instead.

Because the stock item's cost_price_gbp was only written back to the
database AFTER the PO was created, the first PO of an item always showed
£0.00 and only the next one showed the price. Verified in production:
PO-20261023-002 stored costPrice 333.78 / costPriceGBP 0 and printed
£0.00, while the linked stock item's cost_price_gbp was 0 at the time
and was updated to 333.78 by the sync step three minutes later.

Fixes:
- PurchaseOrderForm: snapshot.costPriceGBP is now the price from the
  form; snapshot.costPrice is the stock item's ZAR landed cost.
- PurchaseOrderForm: selecting a stock item with no GBP cost price
  leaves the price field blank instead of showing £0.00, with a hint
  that the supplier's GBP price still has to be entered. Most stock
  items only carry a ZAR cost price, so £0.00 looked like a real price.
- EditPurchaseOrderDialog: preserve the ZAR cost price per row instead
  of zeroing it when a PO is edited.
2026-10-23 12:08:03 +02:00
.cursor feat(po): add MCP server, agent-friendly PO API, and PDF rendering 2026-09-07 11:12:13 +02:00
.playwright-mcp UI: style polish, charts, tables, forms, PDF fix 2026-05-16 00:07:52 +02:00
backup Fixed login 2025-09-25 00:15:35 +02:00
docs feat(po): add MCP server, agent-friendly PO API, and PDF rendering 2026-09-07 11:12:13 +02:00
n8n feat(automation): add PO-to-invoice pipeline 2026-09-06 23:40:33 +02:00
pocketbase feat(quotes): delete quotes from the app, add customer inline with full details 2026-10-21 05:09:11 +02:00
public feat(purchase-orders): add edit functionality and improve form validation 2026-01-14 09:01:49 +02:00
scripts fix(po): stop PocketBase auto-cancellation from killing PO creation 2026-10-22 07:56:30 +02:00
server feat(po): add MCP server, agent-friendly PO API, and PDF rendering 2026-09-07 11:12:13 +02:00
src fix(po): store the price from the form so POs stop printing £0.00 2026-10-23 12:08:03 +02:00
.env.example feat(automation): add PO-to-invoice pipeline 2026-09-06 23:40:33 +02:00
.gitignore chore: untrack .env and pb_data, update gitignore 2026-09-01 07:45:02 +02:00
.mcp.json feat(automation): add PO-to-invoice pipeline 2026-09-06 23:40:33 +02:00
AI_RULES.md Updated AI_RULES.md 2025-09-19 12:19:47 +02:00
app-overview.png UI: style polish, charts, tables, forms, PDF fix 2026-05-16 00:07:52 +02:00
components.json Init Dyad app 2025-09-09 00:12:47 +02:00
dashboard-updated.png UI: style polish, charts, tables, forms, PDF fix 2026-05-16 00:07:52 +02:00
eslint.config.js Init Dyad app 2025-09-09 00:12:47 +02:00
index.html Add icon generation script and new icons for PWA and favicons 2025-09-25 00:50:36 +02:00
LOGGING_IMPLEMENTATION.md Fixed login 2025-09-25 00:15:35 +02:00
login-mobile-final.png UI: style polish, charts, tables, forms, PDF fix 2026-05-16 00:07:52 +02:00
login-mobile.png UI: style polish, charts, tables, forms, PDF fix 2026-05-16 00:07:52 +02:00
login-page-final.png UI: style polish, charts, tables, forms, PDF fix 2026-05-16 00:07:52 +02:00
login-page.png UI: style polish, charts, tables, forms, PDF fix 2026-05-16 00:07:52 +02:00
nixpacks.json Update nixpacks.json 2025-12-29 14:15:05 +02:00
package-lock.json feat(po): add MCP server, agent-friendly PO API, and PDF rendering 2026-09-07 11:12:13 +02:00
package.json feat(po): add MCP server, agent-friendly PO API, and PDF rendering 2026-09-07 11:12:13 +02:00
postcss.config.js Init Dyad app 2025-09-09 00:12:47 +02:00
quote-dialog.png Add quotes feature and PO attachments 2026-05-15 07:11:07 +02:00
quote-fixed.png Add quotes feature and PO attachments 2026-05-15 07:11:07 +02:00
quote-form.png Add quotes feature and PO attachments 2026-05-15 07:11:07 +02:00
quote-page.png Add quotes feature and PO attachments 2026-05-15 07:11:07 +02:00
quote-page2.png Add quotes feature and PO attachments 2026-05-15 07:11:07 +02:00
quote-screenshot.png Add quotes feature and PO attachments 2026-05-15 07:11:07 +02:00
README.md Init Dyad app 2025-09-09 00:12:47 +02:00
setup-users.js fix(po): stop PocketBase auto-cancellation from killing PO creation 2026-10-22 07:56:30 +02:00
tailwind.config.js [dyad] Changed all blue UI elements to #ffc905 with black text - wrote 2 file(s) 2025-09-11 11:16:50 +02:00
tailwind.config.ts [dyad] Updated the dashboard with a new color palette - wrote 6 file(s) 2025-09-09 01:14:51 +02:00
test-logging.js Fixed login 2025-09-25 00:15:35 +02:00
tsconfig.app.json Init Dyad app 2025-09-09 00:12:47 +02:00
tsconfig.json Init Dyad app 2025-09-09 00:12:47 +02:00
tsconfig.node.json Init Dyad app 2025-09-09 00:12:47 +02:00
vercel.json Init Dyad app 2025-09-09 00:12:47 +02:00
vite.config.ts ci(vite): add allowedHosts to preview config 2026-01-13 10:28:14 +02:00

Welcome to your Dyad app