Invoices that can explain every amount
How Doktally turns time entries, fixed fees and retainers into invoice lines that can always be traced back, recalculated and corrected without losing the original numbers.
The problem
Every freelancer and small agency knows the moment: a client asks "where does this €8,400 come from?" and the answer lives in three places at once, a timesheet, a spreadsheet with rates and an email about a discount. Invoicing tools usually store only the final amount. Once the invoice is issued, the reasoning behind it is gone.
For a business that bills time, fixed fees and monthly retainers, that is not only awkward. It leads to double billing, forgotten hours and corrections that overwrite history.
How Doktally solves it
Every automatically generated invoice line keeps its source: which time entries, contract, fee or recurring charge produced it, for which period, at which rate.
105 h × €80/h = €8,400is not a number typed into a field. You can open the line and see the 105 hours.- An agreed fee and a manual adjustment are stored separately (Agreed fee €3,200 · adjusted −€200), so the discount is visible and the original calculation is never lost.
- Hours that are already on an invoice are reserved and cannot be billed twice.
- Before an invoice is issued, Doktally points out what deserves a second look, for example a client who already has an overdue invoice.

Each client gets these documents in their own language (item names, VAT wording, footer), whatever language you use the app in, and missing translations are flagged before issuing.
Issued invoices are never edited. A mistake is fixed with a credit note that references the original invoice and carries its own reason, in the client's language.

Under the hood
Doktally is split into Spring Boot services behind a gateway. The invoice service owns billing sources and reservations; documents are stored in MongoDB; Keycloak handles identity; background work runs over RabbitMQ.
flowchart LR
T[Time entries] --> B[Billing engine]
C[Contracts and fees] --> B
R[Recurring charges] --> B
B --> L[Invoice line + source]
L --> I[Invoice]
I --> CN[Credit note]
The key design choice: a billing source is a first-class record, not a comment on the invoice line. New billing models (retainers, recurring charges, billable expenses) plug into the same mechanism instead of getting their own invoicing code.
The result
Every amount on an invoice can be explained in one click, corrected without rewriting history and checked against the work that produced it. For a business owner that means fewer awkward client conversations and an accountant who trusts the numbers.
Technologies
Java, Spring Boot, MongoDB, Angular, Billing
- Published: 2026-11-03
- Project: Doktally — Invoicing, time billing and VAT for small businesses
- Case study