Repository navigation
Added
-
Legal entities: invoice number series and the printed number — For sellers whose customers expect their own sequence ("invoice 20", not a company-wide number), without gaps or repeats. The legal entity page has an Invoice numbering block in place of the number format and counter (what each token puts in the number, with an example): a default series (number format, Printed as, Next {SEQ}, Restart every year) and Series by client (Add series / Edit series, each row saying which invoices it takes): a series for a client ("Any legal entity") or, with the
client_entitiesmodule, for one of its legal entities (Bill to). An invoice takes the series of its Bill to, else of its client, else the default series (resolve_series); only active series are picked. Each series has its own counter (billing_entity_number_counters, per year of the issue date when it restarts every year;{YYYY}/{YY}are then the issue date's year and{MM}is not allowed). The form refuses a format another active series already makes (of this or another legal entity: numbers are unique across invoices), a restart without{YYYY}/{YY}, and a Next {SEQ} not above the last number given or on a number already taken (Use N); formats that can make the same numbers get a warning. Printed as is what the client sees: the series' printed format (tokens plus{NUMBER}, the whole number;{SEQ}prints "20" forACME-20), or set by hand for one invoice on step 1 and the draft.Invoice.display_number(printed number, else number) is printed on PDFs, in invoice and reminder emails, the payment receipt, client notifications, the client portal and the pay page; a PDF with the e-invoice inside (ZUGFeRD / Factur-X) prints both ("20 (ACME-20)"). E-invoices, XML, exports, the PDF file name and the API keepinvoice_number;to_dictaddsprinted_numberandnumber_series_id; search finds both. The invoice list, payments and time entry badges show "ACME-20 · No. 20". Repeated printed number for the client — the samecoalesce(printed_number, invoice_number)on another invoice (not cancelled) of the same legal entity and client (and Bill to, when both have one; the same year for a yearly series): a warning on the draft; issuing asks Issue anyway / Change number (Mark as issued, Send; Escape or a click outside closes the question and nothing happens), the API (send-email,send-peppol,send-sdi) answers409 duplicate_printed_number(send again withconfirm_duplicate_printed_number=<the printed number>), a bulk status change skips it and lists it as not issued, and in the interface the paths without a dialog (a payment on a draft, Peppol, SDI) refuse with "issue it with Mark as issued first"; through the API, Peppol and SDI accept the confirmation. A confirmed repeat is written to the invoice's audit trail. Cancel and reissue keeps the printed number and series, with the first free suffix of the original number (ACME-20-3, not-20-2-2); a reissue whose Bill to takes another series gets that series' number when issued. Migration224_add_invoice_number_series. -
Invoices: costs not logged yet, recurring costs that ask for their amount, receipts in the PDF — The draft's Project costs block lists Not logged yet: costs billed on the project's last three invoices (not cancelled) that have no cost of the same kind in the period (the same recurring cost, else the same category and description), with last time's amount, an amount field and + (logs the cost on the period's last day and bills it, once; Add bill attaches the supplier's bill), and Make it recurring (monthly, from the next period; refused when the project already has such a recurring cost). + Log a cost has Repeat: every month, ask for the amount: such a recurring cost (
recurring_project_costs.ask_amount) makes no cost on its own; a draft of a period it falls in by its frequency, counted from its start (recurring_project_costs.start_date), lists it in Not logged yet with the last amount as a hint, also when drafts are made out of order; logging the amount moves its next date forward, never back. A recurring cost that was switched off or ended is not listed. Attach receipts to the invoice PDF and Attach bills to the invoice PDF (invoices.attach_receipts,attach_bills): the invoice PDF — downloaded, previewed, emailed to the client, in the client portal and from the API — is followed by the files (a PDF's pages as they are, an image on its own page); Peppol sends XML without them. A file that is missing or cannot be read is named. Before you issue lists costs not logged yet and expenses or costs without a file to attach. An expense or project cost on an issued invoice keeps its amount, currency, date, project and billable flag and cannot be deleted, nor an expense rejected, in the forms, bulk actions and the API (409,expense_invoiced/cost_invoiced); cancelling the invoice frees it. Migration 222.
Changed
- Legal entities: the invoice number is assigned when the invoice is issued — With the Legal entities module on and an entity that numbers by series, a new draft is
DRAFT-<id>and gets the series' next free number when it leaves draft, on every path that changes the status (Mark as issued, Send, payments, Peppol, SDI, bulk actions, the API), in abefore_flushhook under a counter lock (INSERT … ON CONFLICT DO NOTHING, thenSELECT … FOR UPDATE; best effort on SQLite). A deleted draft leaves no gap. Step 1 and the draft show "Will be ACME-20 · assigned when issued"; Set number now sets a number by hand (its{SEQ}is taken when the invoice is issued; a number held by such a draft is skipped and named when another draft is issued) and Assign from the series when issued hands it back, one draft at a time or for selected drafts in the list. A draft with a number already (made before series) is issued with it. Sending a draft (email, Peppol, SDI) first issues it and commits its number, then sends; if sending fails the invoice stays issued with its number ("not sent"), and the client never gets aDRAFT-number: a draft of one of our legal entities notifies the client when it is issued, not when it is created (withDRAFT-, a number set by hand or an older number alike), with its printed number; a draft deleted before that notifies nobody, and a client already notified about the invoice (a draft from before this change) is not notified again. Change an invoice's status through the object, not a bulkUPDATE: the hook does not see bulk updates. Without the module, or for an entity with no series, numbers come as before (Settings, or the entity's number format, when the draft is created). If the module is switched off while drafts areDRAFT-…, they get the Settings number when issued. - Invoice templates print
invoice.display_number— Migration 224 replacesinvoice.invoice_numberwithinvoice.display_numberin the saved HTML templates (every version), the visual/JSON templates, the Settings template and design, and the email templates (invoice_templates), and the built-in templates use it. Without printed numbers it prints exactly the invoice number, so PDFs do not change; once invoices have printed numbers, templates print them. A template that uses the number as a bank payment reference can be set back toinvoice.invoice_numberby hand. The template editor listsinvoice.display_number, and "number" suggests it.
Fixed
- Invoices: default issue date —
Invoice(issue_date=None)and inserts that do not set it get today's date (UTC) from one helper,default_issue_date(); the column default had been computed once, when the module was imported.
Security
- Approval reject authorization (GHSA-7cx3-pj5m-7982 / #990) —
reject()for time-entry and invoice approvals now requires the same approver authorization asapprove(). Invoice approval detail views andPOST /api/v1/invoices/<id>/request-approvalalso enforce requester/approver/admin and invoice-access checks.
Build status
Desktop
- Windows: success
- Linux: success
- macOS: success
Mobile
- Android: success
- iOS: abandoned