WFDASH-WEBAPP/docs
Dave d73fb6f0ab feat(collection-ai): read invoice discounts and set the discounted cost
HYCO (I009753) prints full prices on the lines and "Discount 25.00%" in
the totals; Swagelok (622831) has a "Disc %" column on each line. The AI
compared our cost (already the discounted price) with the printed price,
so the Price tick went red on both.

- The read now captures a line's discount_percent and a whole-document
  doc_discount_percent (prompt rule 5b) and stores net_unit_price on each
  line (both discounts stacked).
- The Price tick compares the cost with the price after discount; the
  tooltip and the document-lines panel spell it out
  ("R15.10 less 25% invoice discount = R11.33").
- Owner's call: when a "sure" tax-invoice line has a discount and our
  cost isn't the discounted price, the AI sets the cost to it (customer
  lines through updateOrderItemCost, which adds a cost note; stock lines
  through updateStockPurchaseItem) and records why in ai_check.cost_changed,
  shown in purple under the line. No discount, a delivery note or a
  "likely" match: the cost is never touched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 13:18:21 +02:00
..
agents docs(hermes): bump tool count + add 'three quote-creation tools' callout 2026-08-27 07:50:17 +02:00
api-reference feat(quotes): add person_hint for customer resolution in forwarded emails 2026-08-27 11:11:44 +02:00
audit docs(quote-assistant): runbook accuracy, MCP tool listed in API docs 2026-10-16 23:42:44 +02:00
bugs docs(bugs): add post-mortem for MCP initialize handshake bug 2026-08-05 01:53:02 +02:00
example-quotes feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
pocketbase feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
sops refactor(sops): streamline SOP documents for roles, consolidating content into quickstart guides for easier reference 2026-09-03 17:57:49 +02:00
superpowers docs(collection-ai): runbook tick table, audit scope; spec content_hash index is non-unique 2026-10-17 10:21:25 +02:00
theme-preview feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
0136daf3-3ebd-4bca-876e-316271a40303.jsonl feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
AGENT_INSTRUCTIONS.md docs(mcp): document stock_items.set_pricing and create pricing fields 2026-10-01 01:02:44 +02:00
api-mcp-layer.md docs(quote-assistant): runbook accuracy, MCP tool listed in API docs 2026-10-16 23:42:44 +02:00
collection-ai-checks.md feat(collection-ai): read invoice discounts and set the discounted cost 2026-10-19 13:18:21 +02:00
core-recheck-matrix.md feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
counter-pwa.md feat(counter): add standalone counter order PWA 2026-08-13 09:27:20 +02:00
deliveries-n8n-workflow.md feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
dev-guide.md feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
django-nextjs-parity-backlog.md feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
driver-app-data-source.md feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
migration-audit.md feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
n8n-ai-insights-prompt.md feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
n8n-mcp-setup.md feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
n8n-watchdog-agent-instructions.md fix(quotes-intake): clamp email_body to PB's 5000-char cap 2026-09-08 10:28:20 +02:00
order-items-schema-standard.md feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
order-workflow-rules.md feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
orders-first-rollout.md feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
pricelist-extraction.md feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
qa-review.md feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
qa-review.verify.md feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
quote-assistant.md docs(quote-assistant): runbook accuracy, MCP tool listed in API docs 2026-10-16 23:42:44 +02:00
quotes-email-monitor.md feat(quotes): resolve customer from person_hint when rep forwards email 2026-08-27 10:45:51 +02:00
quotes-outbound-attachments-deploy.md feat(quotes): split attachments into internal vs outbound with operator upload UI 2026-09-09 13:43:56 +02:00
rep-performance-data-source.md feat(audit): implement audit trail for delivery notes and orders 2026-09-30 01:48:44 +02:00
SHIPPED.md feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00
tv-dashboard.md feat(tv-dashboard): enhance TV dashboard with driver stops and performance metrics 2026-08-19 10:16:49 +02:00
wfdash-v5-deployment.md feat(item-history): add getItemHistory service with 5 PB queries 2026-07-29 14:51:58 +02:00