mega-plant/app/api/invoices
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
..
[id] Give external invoices a supplier name; keep them off the sites page 2026-10-08 12:04:42 +02:00
intake Attach the uploaded PDF to the invoice it creates 2026-10-08 21:45:42 +02:00
upload Split the invoice register into Internal and External Invoices 2026-10-08 11:49:48 +02:00