Files
wekan/docs/DeveloperDocs
Lauri Ojansivu 604b3dbe84 Budget and billing: rates, budget against cost and forecast, and invoices of the hours spent.
A new page in the user menu, Budget and billing (/billing), for the boards
the user is an admin of (docs/Features/Billing/Billing.md):

- Hourly rates per board, in an ISO currency: a member's own, or the board
  default. A card's hours are charged at its assignees' rates, shared
  equally, else its members', else the board default; hours with no rate are
  reported as unpriced, never billed at zero silently.
- A budget of money, hours or both, for an optional period, against Spent
  (time spent at the rates), Still to do (open cards' estimate less spent),
  Forecast (red when over the budget), Left of budget, Invoiced and Paid.
- Invoices of the billable hours not invoiced yet, per card and person, at
  the rates of that moment. A card is billable unless Billable is unticked in
  its Time popup. As WeKan keeps spent time as a card total, what is still to
  invoice is that total less the card's hours on invoices that are not void.
  Numbers run per year (INV-2027-0001) under a unique index; status is
  draft, sent, paid or void, paid and void being final, and voiding frees the
  hours. An invoice prints alone, and downloads as CSV with formula-looking
  cells written as text.

Money is kept as integer cents. Only a board's active admins - not members,
not an admin who sees only their assigned cards - and site administrators
see or change it; everything goes through server methods
(server/billing.js), nothing is published, the collections take no client
writes, and a deleted board's budget and rates go with it. Admin Panel /
Features / Budget and billing turns it off. The card field billable is
copied by WeKan export/import.

tests/billing.test.cjs runs the money as arithmetic; tests/billingAccess.test.cjs
runs the real methods as each kind of user;
tests/playwright/specs/billing-invoice.e2e.js drives the page. The new strings
are translated into every language (low confidence for the smallest, e.g.
Volapük, Wolaytta, Nahuatl, Tigre, Klingon, Venda); in several locales the
eleven still-English enrollment/registration/auth strings were translated
too, which completes Southern Sotho.

Thanks to xet7 !
2026-11-21 20:28:26 +02:00
..