The Settlements module lets you combine tickets from multiple projects into a single settlement, drive it through a status workflow (draft → sent → paid), and manage attachments (invoices, reports, acceptance protocols). Once a settlement is sent, linked tickets are frozen — editing is locked, but status changes on the Kanban board still work.
A single settlement can span multiple projects. Link tickets from any of the related projects — perfect for freelancers and agencies.
Draft → Sent → Paid with automatic timestamps (sent_at, paid_at). Reverse transitions allowed — admins can unfreeze tickets when needed.
After sending a settlement, linked tickets are frozen — full editing (title, description, priority) is locked. Status changes via Kanban drag-drop still work.
Upload invoices, reports, acceptance protocols to MinIO with categories (invoice, report, acceptance_protocol, other) and state (draft/signed). 200MB limit, 10 files per settlement.
rozliczenia:read/write/delete permissions per project. Users without permission don't see the section on tickets (hidden in HTML and MCP) — not just disabled.
The /dashboard/rozliczenia page shows settlements across all projects you have access to. Filter by projects, status, and date.
New settlement (ROZ-N) with period, name, and selected projects. Requires rozliczenia:write in each project.
HTMX autocomplete search — find by number (MNX-12) or title. Only tickets from settlement's projects are shown.
Upload invoices, reports, or acceptance protocols. Choose category and state (draft/signed). Preview/download/delete.
Change status to 'Sent' — tickets become frozen (editing returns 403), but Kanban status updates still work.
After payment — click 'Mark as paid'. paid_at is set, sent_at preserved. Tickets stay frozen.
Admins can revert status (paid → sent → draft). Tickets automatically unfreeze when settlement returns to draft.
All settlement operations are exposed via MCP — the AI agent can create settlements, link tickets, upload attachments (base64), and change statuses. RBAC is enforced by each tool.
Available MCP tools
list_settlements
List project settlements with filters (status, period, page).
get_settlement
Settlement details: projects, tickets, attachments, status, timestamps.
create_settlement
Create a cross-project settlement (write permission validated in all projects).
update_settlement
Edit a draft settlement (name, period, projects, notes).
delete_settlement
Soft delete a draft settlement.
change_settlement_status
Draft ↔ sent ↔ paid workflow with transition validation and timestamps.
link_ticket_to_settlement
Link a ticket (draft only + cross-project validation).
unlink_ticket_from_settlement
Unlink a ticket from a settlement.
list_settlement_tickets
List linked tickets (keys + titles + statuses).
add_settlement_attachment
Upload a file as base64 → MinIO. Categories: invoice/report/acceptance_protocol/other.
get_settlement_attachment
Download attachment as base64 with mime_type and filename.
list_settlement_attachments
List attachment metadata (no bytes).
delete_settlement_attachment
Delete attachment (draft only).