mega-plant/app/api
David 58c972c4c9 Invoices: a duplicate is a notice, not a broken invoice
Re-offering a PDF that is already in the register did the safe thing — nothing
was written, no income double-counted — but reported it as a failure, which
was wrong twice over. No toast fired, so if the dialog were not in front of
you the click looked unacknowledged; and it filed an entry in the retry inbox,
where a duplicate is a trap: re-offering it can never succeed unless the
original is deleted first, so it sat in a list of things to fix that could not
be fixed.

Duplicates now get their own status. Nothing is written, no inbox entry is
created, the dialog closes and a notice toast names the copy already held —
site, line count and total — so it is obvious which one it matched. Amber
rather than teal, because nothing was imported and a success-coloured toast
would misread.

Verified by re-uffering PHI 169: invoices 10->10, lines 31->31, inbox 7->7,
failed 0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-10-02 14:59:08 +02:00
..
assets/[id] Plant Register: inline editing, active toggle and cascade-delete impact 2026-10-01 15:59:51 +02:00
health Round 4: regressions fixed + mobile standard 2026-09-12 12:05:43 +02:00
invoice-lines/[id]/book Invoices: line-item extraction, booking to plant items, VAT-inclusive income 2026-10-01 15:59:30 +02:00
invoices Invoices: a duplicate is a notice, not a broken invoice 2026-10-02 14:59:08 +02:00