Skip to content

652 — Recalculate the hourly rate from the matching billable rate on selected records

Description

Bulk "Recalculate rates" re-matches each selected record's hourly rate against the organization's billable-rate rules (recalculateBillableRatefindBestApplicableRate). With a user-scoped billable rate in place, every selected record (all owned by the owner) picks it up — its Hourly Rate goes from € 0.00 to a non-zero amount.

Preconditions

  • Signed in to a freshly seeded test organization.
  • Three time records seeded via the GraphQL API (no hourly rate), each on a different client/project/task, all owned by the owner.
  • A user-scoped billable rate (flat €/hour for the owner) is created via the API after seeding (so it is not yet applied).
  • Time Records page open in the Reports view.

Steps

  1. Confirm each record's Hourly Rate is "€ 0.00".
  2. Tick the selection checkbox on all three rows. Expected: the floating bar shows "3 selected".
  3. Click the recalculate-rates action; confirm the "Recalculate rates" modal opens.
  4. Click Recalculate. Expected: "Success" popup appears.
  5. Inspect the rows. Expected: every record's Hourly Rate is now a non-zero money amount (the matched billable rate).
  • Spec: playwright/tests/integration/timerecord.spec.ts (describe "Timerecord - Bulk edit")
  • Backend: TimeRecordService.recalculateTimeRecordsHourlyRate (skips billed/deleted via findRecalculableTimeRecordIds)