Troubleshooting & Reference ยท Article 7.10
"The status says Final invoice issued but the invoice has no line items"
A race condition between `Mark as completed` and the pre-rendered final invoice. If the pre-render failed silently before you clicked complete, the invoice record is created but the PDF is empty or wrong. Recovery: regenerate the final invoice.
The final-invoice flow has two stages: pre-render (background, the moment the deposit lands) and dispatch (foreground, when you click Mark as completed). The pre-render is where most failures hide โ if Gotenberg flakes during pre-render, the placeholder INV record exists but its PDF is broken.
Step by step
Check the Documents dropdown.
Look at INV-XXXX โ if missing or marked as failed, that's the root issue.
Click
Regenerate final invoicefrom Actions. The renderer re-runs with the proposal's current state (post-amendment if applicable).
Confirm the PDF.
Open INV-XXXX from Documents; line items should be populated.
Re-issue if needed.
If you'd already triggered the email with the broken PDF, click
Resend final invoice emailto send the corrected version.
Why this works this way
Pre-render flow (prepare_final_invoice Celery task):
1. Render the final invoice HTML (Jinja).
2. Send to Gotenberg โ PDF bytes.
3. Upload to R2.
4. Save URL to FinalInvoice.pdf_url.
If step 2 or 3 fails after retries, the FinalInvoice record exists with pdf_url = null. The proposal status stays at Deposit paid and a Retry final invoice button appears. Pre-fix (early 2026), the button didn't always appear โ the status advanced to In work and you couldn't tell the PDF was missing until you clicked Mark as completed. The current behaviour (May 2026 fix) blocks status advancement when pre-render fails, so the issue surfaces earlier.
Troubleshooting
Keep reading
Lifecycle
Status: In work โ deposit settled, project running, final invoice ready
You're between the deposit and the final payment. The final invoice is pre-rendered and ready to issue when you finish. Clozo doesn't track project progress here โ you do โ but it's listening for you to say `done`.
Proposals & Invoices
The 4 delta branches: ฮ+, ฮโ, ฮ=0, ฮ_REFUND
Every signed amendment falls into one of four branches based on (a) the sign of the cost change and (b) whether the proposal was already paid. Each branch fires a different document chain. This is the central conceptual map for the entire amendment system.
Troubleshooting & Reference
"The invoice link is broken or the PDF is missing"
PDFs occasionally fail to render (Gotenberg flake) or fail to upload to R2. Symptom: the document shows as "issued" but clicking the link returns 404 or the PDF is blank. Recovery: regenerate from the Documents dropdown.