657 — Grid time-budget usage recomputes when source changes ALL to BILLABLE¶
Description¶
PT-5832: a project's Time Budget source (ALL vs BILLABLE) determines how the
projects-grid "Time budget" cell computes consumed time. ALL counts every
tracked hour (elapsed duration); BILLABLE counts only the billable portion
(elapsed × billableTime) of billable records. The Price Budget cell is
asserted alongside (source REVENUE = hourly_rate × billable hours) to confirm
it consumes correctly and stays independent of the time-budget source. This
scenario seeds one billable 4h record at 50% billable, rate 30/h, against a
100h time budget and 100 € price budget, then verifies the time usage switches
from 4h (ALL) to 2h (BILLABLE) when the source is changed in Details, while the
price usage stays at 60 €.
Preconditions¶
- Authenticated user on a fresh org; owner user id resolved.
- Project seeded via API: 100h time budget (default source ALL); 100 € price budget tracking REVENUE.
- One time record seeded via API: 4h elapsed (09:00–13:00), billable, billableTime 0.5, hourlyRate 30.
Steps¶
- Open Projects Overview grid. — Expected: time-budget cell
4.00 h / 100.00 h(ALL = full elapsed); price-budget cell60.00 € / 100.00 €(REVENUE = 30 × 2h billable). - Open project → Details, confirm source is "All time", select "Billable time", Save. — Expected: "Updated" snackbar.
- Return to the projects grid. — Expected: time-budget cell
2.00 h / 100.00 h(BILLABLE = 4h × 0.5); price-budget cell unchanged at60.00 € / 100.00 €. - Flip the source back to "All time", Save, return to the grid. — Expected: time-budget cell returns to
8.00 h / 100.00 h(rules out a sticky/one-way change).
Related¶
- Spec: playwright/tests/integration/project.spec.ts (describe "Budget scope selectors")
- Ticket: PT-5832