Patch notes — billing follow-ups: time tracking + SMTP (2026-06-15)
Follow-ons to the billing subsystem:
staff time tracking, a per-person timesheet, editable time, auto case references, and a
dedicated billing SMTP. Two drops on main (Ethica.no 0f06ba2, 7f7eeca), Docker
smoke 153/0.
Time tracking for everyone (0f06ba2) ✅
- Staff log time: any staff/admin (not just billing) can log time on a ticket or
project — the Log-time box shows on every company-linked one, with an “Xh logged”
running total. Non-billing staff don’t see rates (no product/rate picker); their entries
take the default rate.
/admin/time/logis allowed for staff; products/invoices stay billing-only. - Per-person Time view (
/admin/billing/time, billing-only): everyone’s logged time for a week or month (default month) with ◀ Previous / Next ▶ and a Week/Month toggle; a by-person billable + non-billable summary and every entry — so non-billable time is visible. - Edit / delete unbilled time inline on the company Billing tab and the Time view (billed entries are locked). Each entry shows who logged it, the case/project ref, date, and a billable/non-billable badge.
- Auto case reference: time billed onto an invoice prefixes its line with
Ticket #N/Project #Nso the invoice refers back to the work. - My hours on the profile (
/account): staff/admin see their own hours this week + month and recent entries.
Dedicated billing SMTP (7f7eeca) ✅
Invoices now send over their own mail server, separate from the contact + newsletter
mailers. Settings → Billing → Billing SMTP: From, host, port, security
(starttls/ssl/none), username, encrypted password, and a Send test. Blank host → falls
back to the contact mailer; neither configured → the invoice is still issued + PDF frozen,
just not emailed. Full how-to: ../../ethica-no/billing/email.md.
On editing the invoice email
The invoice email is the Subject + Body on the Billing tab (plain text + {number},
{due_date}, {total} placeholders); the invoice rides as a PDF attachment. There is no
separate HTML template today — see the email guide.
Verification
Docker smoke 153/0 — incl. staff-can-log gate, My hours, Time view + week + prev nav, author shown, edit persisted, auto case-ref, and the billing SMTP (section renders, save, host persisted).