invoices: cancel with stamped PDF, superuser-only hiding

An invoice issued by mistake could only be left pending or marked paid.
Add cancel (with an optional reason) and reinstate. Cancelling renders a
third PDF variant with a diagonal CANCELLED stamp and the date/reason,
and it becomes the current one, so the client's link and download show
the invoice as void. Cancelled wins over paid in the status, and marking
a cancelled invoice paid is refused.

Superusers can also hide an invoice: it disappears from the admin list,
dashboard and invoice pages for every other user, while the client's
public link keeps working.

Assisted-by: Claude:opus-5
This commit is contained in:
Sergei Poljanski 2026-10-10 08:35:01 +04:00
commit eeac07ed34
Signed by: asxpi
GPG key ID: 4F8851660FA4121B
10 changed files with 231 additions and 13 deletions

View file

@ -420,6 +420,26 @@ fieldset.plain { border: 0; margin: 0; padding: 0; min-width: 0; }
border-color: var(--pending-border);
background: var(--pending-bg);
}
.badge-cancelled {
color: var(--danger);
border-color: var(--danger-border);
background: var(--danger-bg);
}
.badge-hidden {
color: var(--text-dim);
border-color: var(--border-strong);
background: var(--surface);
}
.invoice-actions {
display: flex;
flex-wrap: wrap;
gap: 8px 12px;
align-items: center;
margin-top: 14px;
}
.invoice-actions .link-button { margin: 0; }
.cancel-form { display: flex; gap: 8px; flex: 1 1 320px; }
.link-button.danger:hover { color: var(--danger); border-color: var(--danger-border); }
.badge-paid {
color: var(--paid);
border-color: var(--paid-border);