mega-plant/app/api
David b5f6c0e16b Attach the uploaded PDF to the invoice it creates
Importing a PDF built the invoice from that file's figures but stored the file
only on the intake row, never on `invoices.source_pdf`. Every invoice therefore
opened on a "drop the PDF here to attach it" prompt — asking for the very file
the person had just uploaded to create it, and leaving every figure on the page
without its source one click away.

The intake now writes the document onto the invoice as part of the import, so
"Open invoice PDF" is there from the moment the invoice exists. The manual
uploader stays as a Replace.

Verified end to end: the document endpoint returns 200, application/pdf, 49,085
bytes starting %PDF-, and the drop prompt is gone from the expanded detail.
2026-10-08 21:45:42 +02:00
..
assets/[id] Sites: auto-allocate container lines to the container the site hires 2026-10-02 18:32:12 +02:00
auth/logout feat: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00
health Round 4: regressions fixed + mobile standard 2026-09-12 12:05:43 +02:00
invoice-lines/[id] Split the invoice register into Internal and External Invoices 2026-10-08 11:49:48 +02:00
invoices Attach the uploaded PDF to the invoice it creates 2026-10-08 21:45:42 +02:00
sites/[id] feat: add user access and improve plant dashboard 2026-10-06 04:02:08 +02:00