Delete Document
Delete a document the company issued (droit document:d). Definitive.
Two conditions, and they are not negotiable. The document must be the last of its numbering sequence — its (journal, type) — because deleting any other would leave a hole in a numbering the law requires continuous; the whole deletion runs under the same named lock a creation takes, so a creation running alongside cannot slip a number in between. And it must have gone nowhere: not sent by mail or over Peppol, not handed to the accounting — the same guard that governs a correction, for the same reason. A document that left is issued, and the way back is a credit note.
Refused with 409 document_in_use when something would be silently damaged: a bank
reconciliation, an invoiced timesheet line or a payment intent attached to it. The
database would not object — its two foreign keys erase or blank those rows without a word.
What goes with it: its public identity, and its timeline events. A received document is
not deletable (409), it is not ours.