# Feature COSTS-1 - Remaining work should be calculated based on work and logged time

Project: Stream Time & Costs
Status: new
URL: https://community.openproject.org/work_packages/COSTS-1

## Planning

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Target versions | Wish List |
| Votes | 82 |
| List |  |
| Roadmap |  |
| Relevance |  |

## OPEN POINTS / FEEDBACK

_No work packages_

## Features and Chunks

_No work packages_

## Bugs and other work packages

_No work packages_

## Technical Details

| Attribute | Value |
| --- | --- |
| Module |  |
| Feature Flag |  |
| Requires doc change | No |
| Enterprise plan |  |

## Details

| Attribute | Value |
| --- | --- |
| Pull preview |  |
| Mockups |  |
| Accessibility | No |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers |  |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Estimates and progress

| Attribute | Value |
| --- | --- |
| PD (min) |  |
| PD (max) |  |
| Work |  |
| Labor costs |  |

## Description

**As** an OpenProject user  
**I want** remaining hours to be calculated based on the difference of estimated time and logged time (on the work package)  
**so that** I have an automatic way to calculate the remaining time.

**Acceptance criteria**

- [x] When *Work* is set for a work package, *Remaining work* should be set accordingly. 
- [ ] When time is logged on the work package, the *Remaining work* should be reduced accordingly (*Remaining work* = *Work* - *Logged time*).
- [ ] When *Work* is edited, the *Remaining work* should be adjusted accordingly.
- [ ] When a user logs time on a work package the user can decide to reduce the *Remaining work* accordingly.
- [ ] All values need to be shown in one modal view (similar to the duration in the date picker)
  - [ ] Work
  - [ ] Spent time
  - [ ] % Complete
  - [ ] Remaining work
- [ ] Spent time can be higher than estimated time. Example
  - [ ] Logged time: 50 h
  - [ ] Work: 40 h
  - [ ] Remaining work: 0 h
- [ ] Remaining work can not be higher than Work
- [ ] This feature should be configured in the project settings if this automation is happening

\-------------------------------------------------------------------------------------------------

Also requested in another ticket <mention class="mention" data-id="78010" data-type="work_package" data-text="#OP-19827" data-display-id="OP-19827">\#OP-19827</mention> whose content I am copying here:

**As** a project manager or team lead  
**I want** OpenProject to automatically calculate the remaining work of a work package by subtracting the logged spent time from the estimated time  
**so that** I can immediately see how many estimated hours are still available or whether the original estimate has already been exceeded.

**Acceptance criteria**

  - A calculated value such as **Calculated remaining work** is available for work packages.

  - The value is calculated as:

<!-- end list -->

``` text
Estimated time − Spent time
```

  - The value updates automatically when:
    
      - the estimated time changes;
    
      - a new time entry is logged;
    
      - an existing time entry is changed or deleted.

  - The value can be displayed as a column in the work package table.

  - The value can be displayed in the work package details.

  - If the spent time exceeds the estimated time, the overrun is clearly visible, for example as a negative remaining value.

  - If no estimated time is set, no calculated remaining work is displayed.

  - The feature should not overwrite manually maintained remaining work unless automatic calculation is explicitly enabled.

  - For parent work packages, the calculation should be consistent with the existing aggregation logic.

  - The value should be available for filtering and sorting, if technically possible.

The feature could be implemented as an optional calculated field or as an optional calculation mode for remaining work.

Basic calculation:

``` text
Calculated remaining work = Estimated time − Spent time
```

The calculation should be triggered when estimated time or time entries are created, changed, or deleted.

The feature should be configurable, because some teams use remaining work as a manual forecast rather than as a simple calculation.

Possible configuration levels:

``` text
Instance level
Project level
Work package type level
```

If negative remaining work values are not supported, an additional overrun indicator could be considered instead.

**Permissions and visibility considerations**

The calculated value should follow the existing visibility and permission rules for work packages, estimated time, spent time, and remaining work.

It should not be visible if the user is not allowed to see the underlying time or effort information.

It should also not be visible or active when the feature is disabled.

**Translation considerations**

Only new or potentially ambiguous terms need translation.

Relevant terms:

``` text
Calculated remaining work
Automatically calculated remaining work
Overrun
Estimate exceeded
```

Possible German wording:

``` text
Berechneter Restaufwand
Automatisch berechneter Restaufwand
Überschreitung
Schätzung überschritten
```

**Out of scope**

  - Full resource planning.

  - Employee capacity, vacation, or overtime calculation.

  - Budget or billing logic.

  - Automatic updates of estimated time.

  - Changes to time tracking permissions.

  - Alerts or notifications when the estimate is exceeded.

  - A new progress calculation mode.

Possible future extension, but not part of this request:

``` text
Progress = Spent time ÷ Estimated time × 100
```

*Set the* **To be informed/consulted teams** *field to include all teams necessary to be informed of the changes.*
