No description
Find a file
Dave 696c157e2e Purchase invoices: price an invoice that has no amount
An invoice saved with no amount landed as amount_incl = 0 (PocketBase
stores a number field as zero, not null), so the PO read "R 0,00 invoiced"
and the money never booked. There were two ways to give it an amount and
neither worked: the Upload-invoice modal let a blank amount save silently,
while the double-click correction form refused to save without a value AND
a written reason, and sat behind Edit mode.

- lib/purchase-invoice-amount.ts holds the rules, shared by the screen and
  the API so they cannot disagree. R0 is not an amount: a blank amount and
  a figure of zero are both refused, so an invoice can never land as zero.
- The API now separates PRICING an invoice that never had an amount (no
  reason owed, still logged) from CORRECTING one that was booked (Full user
  + a reason, as before).
- Double-clicking an amount on a PO opens the ordinary invoice modal on
  that invoice, with the amount field waiting. The inline correction form is
  gone — one window, one rule. There is no pencil button: a booked figure
  must take a deliberate second gesture, so a single stray tap never opens
  a form that can rewrite money.
- The PO-lines table freezes its Description column with an opaque
  background and fades its right edge, so it passes the mobile checklist.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-11-04 18:06:02 +02:00
.mavis/canvas-assets Mega Plant dashboard — fix & harden (Parts 0-5) 2026-09-12 09:35:48 +02:00
app Purchase invoices: price an invoice that has no amount 2026-11-04 18:06:02 +02:00
components Purchase invoices: price an invoice that has no amount 2026-11-04 18:06:02 +02:00
data/source Clock app: search + scanner on one screen; employee on fuel; drop codeless vehicles 2026-10-22 13:55:13 +02:00
docs Cash float card, Office role + Slips tab, job card PDF, manual close/delete 2026-10-22 15:09:57 +02:00
lib Purchase invoices: price an invoice that has no amount 2026-11-04 18:06:02 +02:00
public Add Workforce pages, Plant Clock tab bar and oil & diesel book-out 2026-10-22 11:39:18 +02:00
scripts Suppliers: replace the menu entry with the new page, flag over-invoiced POs, audited invoice amount corrections 2026-10-29 20:49:05 +02:00
worker feat: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00
.dockerignore Round 4: regressions fixed + mobile standard 2026-09-12 12:05:43 +02:00
.env.example Mega Plant dashboard — fix & harden (Parts 0-5) 2026-09-12 09:35:48 +02:00
.gitignore feat: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00
AGENTS.md Purchase invoices: price an invoice that has no amount 2026-11-04 18:06:02 +02:00
COOLIFY.md Round 4: regressions fixed + mobile standard 2026-09-12 12:05:43 +02:00
Dockerfile feat: show the build commit as a faint corner mark 2026-10-30 01:27:22 +02:00
HANDOFF-PROMPT-2.md Round 2 (Parts B-D): asset register restructure, type field, sequential codes, flat sortable table, cost_lines, removed synthetic code, fail loudly 2026-09-12 10:24:26 +02:00
HANDOFF-PROMPT-3.md Round 3 (Parts A-B): charts fixes + expenses/overheads cleanup 2026-09-12 11:24:18 +02:00
HANDOFF-PROMPT-4.md Round 4: regressions fixed + mobile standard 2026-09-12 12:05:43 +02:00
HANDOFF-PROMPT.md Auto-create synthetic assets for unmatched machines in seed; update open-questions report 2026-09-12 09:40:18 +02:00
next.config.ts feat: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00
package-lock.json feat(clock): add standalone employee clock PWA 2026-10-21 06:39:15 +02:00
package.json feat(clock): add standalone employee clock PWA 2026-10-21 06:39:15 +02:00
postcss.config.mjs Mega Plant dashboard — fix & harden (Parts 0-5) 2026-09-12 09:35:48 +02:00
proxy.ts Cash float card, Office role + Slips tab, job card PDF, manual close/delete 2026-10-22 15:09:57 +02:00
tsconfig.json Mega Plant dashboard — fix & harden (Parts 0-5) 2026-09-12 09:35:48 +02:00