Commit Graph
31 Commits
Author SHA1 Message Date
petriandClaude Sonnet 5.5 bca1eed166 Record used material on tasks and suggest workflow steps' default materials
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-26 16:28:16 +02:00
petriandClaude Sonnet 5.5 30132deb0e Add stock items, groups and movements at a moving average cost
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-26 16:18:59 +02:00
petriandClaude Sonnet 5.5 3faa4cfbc6 Open only the info popover when a calendar bar is tapped
On touch screens a tap on a task bar both showed its info popover and
opened the schedule dialog. A tap now only opens the popover, which stays
open until something else is tapped, and the popover's own "Open schedule"
button opens the dialog. Mouse clicks and Enter still open the dialog
directly. The popover is no longer a tooltip since it holds a button, and
the bar's aria-describedby points only at the details.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-26 09:35:53 +02:00
petriandClaude Sonnet 5.5 bc3dbf16a4 Show a monthly fee job's billed periods on a page of its own
The new billing::job-months page lists the months that created billing
materials have billed for a monthly fee job, with links to the materials
and the total, and the months still to bill up to the current month,
counted the same way as a new material counts them. The job page links
to it next to the payment basis for those who manage billing.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-25 15:56:15 +02:00
petriandClaude Sonnet 5.5 eb9346d31c Fill the task calendar's working days in order instead of evenly
A task's estimate now takes each working day of its planned period up to
the assignee's free capacity before the next day gets anything, so 9 h
is booked as 7.5 h + 1.5 h rather than 4.5 h + 4.5 h. What does not fit
in the period still moves past its end and makes the task end later.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-25 12:10:43 +02:00
petriandClaude Sonnet 5.5 ede7043765 Show the task's due date in the calendar's schedule dialog
The dialog shows the due date as a read-only field; it is changed on the
task's edit page.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-25 11:07:43 +02:00
petriandClaude Sonnet 5.5 912b4ae1b5 Colour overloaded days and late tasks in the task calendar
Days over the daily capacity are amber and late task bars red, next to
the existing icon and text.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-25 11:00:36 +02:00
petriandClaude Sonnet 5.5 7c605014c7 Set the calendar's daily capacity in the company details
The task calendar's daily maximum moves from the hidden setting
jobs.daily_capacity_hours to shared.daily_capacity_hours, edited by the
admin on the company details page. An empty field means 7.5 hours.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-25 11:00:35 +02:00
petriandClaude Sonnet 5.5 487a7d34ba Replace the demo home page with a dashboard
Everyone sees their open tasks on an agenda, their open jobs, this
week's hours and quick links. Admin and management also get a lazily
loaded management panel: things to do, the month so far against the
previous month, jobs and late work, and everyone's workload.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-25 09:20:02 +02:00
petriandClaude Sonnet 5.5 64f1e7c54a Add Reports module with the hours by person report
Management's reports (spec 13) get their own module that reads the other
modules through ports. The first report sums hours by person in a period,
narrowed by service unit or customer, with breakdowns, a chart and CSV.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-25 08:39:19 +02:00
petriandClaude Sonnet 5.5 f906f9a43f Add notifications: header bell, task start run and assignment notices
A new Notifications module shows a bell beside the profile menu with the
number of unseen notifications and a panel of the last 7 days; opening
it marks them seen, and each notification links to its job or task.

- A daily run at 14.00 (notifications:task-starts) tells the assignee
  and members of tasks that start by the next working day, skipping
  holidays and days off, done tasks and archived jobs.
- Jobs publishes PeopleAddedToTask and PeopleAddedToJob when someone
  else makes a user a task's assignee or member or gives them a role on
  a job; those users are notified at once. UpdateTask and ScheduleTask
  now take the acting user.
- A notification link to #task-<id> opens that task card on the job page.

Also: simplifying job fields per service unit (K31) moves to the end of
phase 4, and the workflow template browser test waits for Livewire's
progress bar before its last accessibility check.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-25 08:28:01 +02:00
petriandClaude Sonnet 5.5 ae8172898d Add images to tasks
Everyone who may comment on a task sends images to it, e.g. photos
taken with a phone. The server stores an upright, at most 2560 px JPEG
without EXIF data (no location) and a 400 px thumbnail on the private
disk, served only to those who see the job. Uploaders change captions
(also the alt text) and remove their own images; admin and management
may remove anyone's (jobs.remove-any-task-image). Removing a task also
removes its image files.

Livewire's temporary upload limit is raised to PHP's 40 MB so that the
page's own 12 MB limit gives a translated message.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-25 07:46:53 +02:00
petriandClaude Sonnet 5.5 4fb8ea1c5f Add comments to tasks
Everyone who may change a task's status (attached subcontractors too)
comments on it on the job page. Authors edit and remove their own
comments; admin and management may remove anyone's
(jobs.remove-any-task-comment). Edited comments show when they were
edited, and task cards show the number of comments.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-25 07:31:53 +02:00
petriandClaude Opus 5.5 c2265256c3 Set weekends apart in the dark calendar and make invoice cards white
Days off in the task calendar used the dark page colour, so they did not
show in the dark theme: they are zinc-950 now. Invoice cards on the
billing material page get a white background (zinc-900 in dark mode) so
they stand out from the grey page.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 06:28:39 +02:00
petriandClaude Opus 5.5 9a9935098c Make job page task cards and change history collapsible
Task cards on the job page start collapsed and show the title, assignee,
due date and status; each opens on its own, so several can be open at
once, and "Expand all" / "Collapse all" open or close them together with
a status message. A card opens when focus moves into it. The change
history is a disclosure panel with the number of changes, closed by
default.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 06:12:15 +02:00
petriandClaude Opus 5.5 6936d0950b Keep the header dark and give the light theme a grey content background
The header and its menu popovers always use the dark theme colours, the
light theme body is zinc-100 and Kanban columns zinc-200 so they still
stand out. The theme toggle icon follows the page theme through a new
page-dark variant, and TallStackUI hint and selection group description
texts are one shade darker to keep 4.5:1 contrast on the grey background.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-25 06:01:50 +02:00
petriandClaude Opus 5.5 18598cc08e Give tasks one assignee and members, and schedule template tasks to due dates
- A task now has one optional assignee (tasks.assignee_user_id), whose
  calendar row it is on and whose days its estimate books, and members
  (task_members) who see it among their own jobs and in the weekly sheet
  but get no bookings. A migration moves existing assignees over: the one
  with most booked time becomes the assignee, the others members.
- Adding tasks from a workflow template asks for each step's assignee and,
  by default, schedules tasks with a due date to end on it, booking the
  estimate backwards from the due date (not before today); what does not
  fit runs past the due date and is reported as late.
- The task calendar leaves quick sale tasks out of the unscheduled list,
  shows a bar's job details in a popover on hover and focus, and shows the
  day load on its own grid line.
- The template table stacks its cells on narrow screens to reflow at 320 px.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 19:01:11 +02:00
petriandClaude Opus 5.5 b4f2f1cfaa Add the task calendar, holidays, workflow templates and customer removal
Task calendar (/jobs/calendar) replaces per-unit task Kanban columns
(K34): a two-week Gantt of tasks per person. Bars move, resize and
change person by dragging or through a keyboard dialog. Each task's
estimate is booked evenly over working days into task_bookings, and
what exceeds the daily maximum (jobs.daily_capacity_hours, 8 h) moves
to the next working day. Tasks get planned_from/planned_to on the form.

Holidays (/settings/holidays): Finnish public holidays calculated per
year, which the admin can take out of use, plus company days off.

Also includes the earlier uncommitted work: workflow templates with
adding tasks from a template, and removing customers no module refers to.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 18:13:11 +02:00
petriandClaude Opus 5.5 dfe4941f02 Add checklists to tasks on the job page
Tasks get an ordered checklist (spec 8.2, phase 3): items are checked
done with who and when recorded, also by subcontractors attached to the
job; others add, rename, reorder and remove items. Items go with their
task. The spec gets a phase 3 chapter (18.1), and open questions move
to chapter 19.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 16:38:08 +02:00
petriandClaude Opus 5.5 5f9423a3c3 Add monthly fee billing lines to the billing material
Jobs billed by a fixed monthly fee get a monthly fee field, kept behind
the quotes permission like the quoted amount. A billing material now has
a billing month: a new draft adds every monthly fee job with something
to bill, each on an invoice of its own, and bills one line for every
unbilled month from the job's start up to the billing month (or its end
or completion), so skipped months are caught up and no month is billed
twice. Their expenses are billed alongside, their hours are covered by
the fee and marked billed, and the job keeps running.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 13:23:46 +02:00
petriandClaude Opus 5.5 97bd23bed5 Add the billing material with drafts, combined invoices and billed marks
Management builds the monthly billing material (laskuaineisto) as a
draft: done jobs are added as invoices of their own, combined when the
customer, billing unit and reference allow it, and their billable hours
are set per work type. Creating the material checks the jobs again,
marks the approved hours and billable expenses billed, forms invoice
lines with price and VAT snapshots and moves the jobs to "Lasku luotu".
Fixed price jobs bill their quoted amount once. Billed hours keep their
approval and billed expenses can no longer change. The Fennoa export
and monthly fee lines come later.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 13:08:24 +02:00
petriandClaude Opus 5.5 6de5d9bef1 Add quick sales with cash days, credits and PDF receipts
Quick sales (pikamyynti) of active consumer products at the counter, in a
new Sales module:

- Product buttons add one to the sale's list per press; quantities can be
  lowered, raised or removed. Payment by cash or card, optional customer.
- Product durations are booked as the seller's hours on the yearly
  "Pikamyynnit" job (internal customer, not billed) through Jobs'
  ProvideQuickSaleTask and TimeTracking's AddTaskHours. The sale stands
  even when the hours cannot be booked, and the seller is told.
- Sales are never deleted: a credit records the lines negated on today's
  cash day, once per sale, by the seller or management.
- Closing a cash day stores its balance by payment method and VAT rate and
  stops sales on it; only management reopens a day.
- A printable A5 PDF receipt (barryvdh/laravel-dompdf) with the company's
  details, business ID, VAT number, lines and VAT breakdown.

Company details are kept in the settings and edited by the admin only on
the new Yritystiedot page. BusinessId moves from Customers to Shared so
both use the same check.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 12:33:46 +02:00
petriandClaude Opus 5.5 c149c56388 Add the quoted amount and completion time to customer jobs
- Jobs get a budget / quoted amount (cents, VAT 0). Only users who may
  see quotes see and edit it on the job form and page, and only they see
  its changes in the history. Others' saves keep the stored amount: the
  server decides whether the amount is set, not the browser.
- Jobs record when they were done: set when a job first reaches a status
  that locks its hours, kept through the billing statuses, cleared when
  management opens the lock. The billing export will use it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 11:46:36 +02:00
petriandClaude Opus 5.5 d5cbf9d6eb Add approval of hours and lock opening for management
- Time entries store who approved them and when. Approved hours are
  locked: cells, task page edits and removals are refused.
- "Hyväksy viikko" in the weekly view approves the user's own week;
  subcontractors' hours are approved by management.
- Management gets an approval page (unapproved weeks by person, recently
  approved weeks) and can open anyone's week read-only to approve it or
  cancel its approval, which only management may do.
- Only management may move a done job back to an earlier status, which
  opens the lock on its hours and expenses; the history marks it.
- The Clock contract gets now() for approval times.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 08:24:34 +02:00
petriandClaude Opus 5.5 54d98d9d2f Add expenses on customer jobs
- New Expenses module: purchases (materials, other) with a description
  and cost, and mileage priced with the price list's mileage rate.
- Who paid and whether the expense is billed are separate: an employee's
  own payments are reimbursed elsewhere. A billed expense has a markup
  and a billed amount, cost plus markup unless given.
- A job's expenses page lists, adds, edits and removes them; amounts of
  others' expenses need the expenses permission, own ones always show.
  Done jobs lock their expenses.
- The Kulut menu shows the user's own expenses by month. Management
  records subcontractors' expenses, which they see but cannot change.
- The price list gets a default markup for new purchases.
- Number fields that update a calculation now use wire:model.live.blur:
  in Livewire 4 plain .blur no longer sends the value to the server,
  which also fixes the product form's VAT calculation.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 08:11:27 +02:00
petriandClaude Opus 5.5 fcad0ea939 Make Kanban columns visible in dark mode and stack card titles
Columns had the same dark background as the page, so they now use a
darker background with a border. Card titles show the job number on
the first line next to the drag handle and the name below it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 06:06:44 +02:00
petriandClaude Opus 5.5 3922c744a7 Add time tracking on tasks with a weekly sheet
Phase 1, item 8 (last of phase 1). New TimeTracking module:
- One entry per user, task and day (0.25-24 h in quarters, with a note);
  the job and work type are copied from the task. A user's day cannot
  exceed 24 h, and hours on a done, invoiced, billed or archived job
  cannot be added or changed.
- Weekly sheet /time: tasks as rows (own open tasks, tasks with hours
  that week, tasks added by search), days as columns, row, day and week
  totals, week navigation. A cell saves on change and an empty cell
  removes the entry; on phones one day at a time. Saves and errors are
  announced, errors are tied to their cell.
- Task booking page /time/tasks/{task}: date, hours and note, added to
  the day's entry; own entries with edit and remove.
- Anyone but subcontractors may book on any unlocked task;
  subcontractors only on jobs they are attached to.

Jobs module:
- JobStatus::locksTime(), BookableTask and task queries for booking.
- A task with time entries cannot be removed (TaskUsage contract,
  provided by TimeTracking); the job page links tasks to booking.
- The "involved in a job" rule is shared in JobInvolvement.

Spec and CLAUDE.md updated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-24 05:52:45 +02:00
petriandClaude Opus 5.5 02a62eb16e Add tasks to customer jobs
Phase 1, item 7, in the Jobs module (tasks are part of a job, and my jobs
needs their assignees):
- Tasks with name, work type, assignees, status (waiting, in progress,
  in review, done), due date, estimated hours and description.
- Tasks can be added once the job is a quote request or later, not to
  an archived job. The work type must belong to the job's service units
  or the shared ones and be in use; assignees must be active. What a
  task already has stays allowed after being taken out of use.
- Job page: a Tehtävät section with a status select per task (announced,
  focus kept), edit links and delete with a confirmation dialog. Task
  form with work types grouped by unit and service.
- Access: adding, changing and removing for everyone but subcontractors;
  subcontractors may change task statuses on jobs they are attached to.
- Task assignees now count in my jobs (list, Kanban, job access).
- Spec and CLAUDE.md updated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-23 19:26:31 +02:00
petriandClaude Opus 5.5 7f3b6dff78 Add customer job Kanban board
Phase 1, item 6:
- New page /jobs/board: one column per Kanban status (archived left
  out), one card per job with number, name, customer, priority and due
  date. Filters for my jobs (default), priority and service unit;
  subcontractors see only their own cards and cannot move them.
- Cards move by dragging (Livewire wire:sort across column groups) or
  with each card's status select, which works with the keyboard. Moves
  go through ChangeJobStatus, so they are recorded in the job history;
  the result is announced and focus returns to the moved card.
- Billing statuses only for management and the job's biller: the
  jobs.set-billing-status gate now takes the biller's user id.
- Column links with counts at the top; columns wrap with the screen
  width, so there is no sideways scrolling.
- CustomerJobQueries::board() and the biller on job summaries.
- Menu link and a link from the job list; spec and CLAUDE.md updated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-23 19:15:54 +02:00
petriandClaude Opus 5.5 b3d8e66477 Add quick job intake for phones
Phase 1, item 5:
- New page /jobs/quick (Pikavastaanotto): customer (search or quick
  add), name, short description, service unit, responsible person and
  starting status (Alustava or Prospekti) in one column. The job is
  created with CreateCustomerJob, so numbering, reference checks and
  history are the same as on the full form.
- After saving, the form clears for the next job (responsible person
  and status stay), and a status message with the job number and links
  to the job and its edit page takes focus.
- The customer search of the job form moves to a PicksCustomer trait and
  an <x-jobs.customer-picker> component shared by both pages.
- Menu link and a list button for users who may open jobs; nav items
  accept several route patterns.
- PHPStan ignores unused-trait only for Livewire Concerns, which are
  used from excluded single-file components.
- Spec and CLAUDE.md updated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-23 19:07:25 +02:00
petriandClaude Opus 5.5 70e107f6e2 Add customer jobs with numbering, members, tags, links and history
Phase 1, item 4. New Jobs module:
- Customer jobs with the spec's fields except money (phase 2): yearly
  running numbers (2026-0001) from a locked counter row, service units,
  schedule, kind, status, priority, payment basis, estimated hours,
  PO reference, instructions, members (responsible, contact person,
  customer contact, biller, billing unit, other members), tags shared
  across jobs, and links.
- Every change is recorded field by field and shown on the job page with
  names and Finnish dates.
- References to other modules are checked through their query
  contracts: contact and billing unit must be the customer's own;
  service units and users must be in use unless already on the job.
- Job list with search, filters and "my jobs" on by default; job form
  with an accessible customer search and quick add; job page.
- Access: subcontractors see only jobs they are members of, read only;
  billing statuses for management and the job's biller; archiving for
  management.

Related changes:
- Customers: one internal customer (created by a migration) for internal
  work; contacts and billing units used by a job cannot be removed.
- Users and Catalog: batch name lookups and active user options with
  roles for other modules.
- <x-checkbox-group> component; spec and CLAUDE.md updated.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-23 18:57:18 +02:00