[BB-8214] Add support for toggling inclusion of actuals in sustainability calculations

Story

"As a sustainability manager, I want to be able to include/exclude actuals from individual accounts in/from sustainability calculations so that I can review their impact on sustainability quickly and easily."

Full description

In the context of tracking and reviewing sustainability at cell and company level it is useful (and sometimes necessary) to understand how the amount of time logged against a given account (or set of accounts) over a certain period of time impacted the sustainability ratio for that period.

At the moment, this requires performing some calculations manually which is time-consuming and potentially error-prone.

To address this, we should add functionality for toggling inclusion of actuals in sustainability calculations via SprintCraft's UI.

In particular, we should add a new column titled Include? (or similar) to the Budget dashboard that shows a checkbox next to the Period Spent value for each account.

  • Each checkbox should be checked by default. In other words, numbers shown on the Sustainability dashboard should initially take into account actuals from all accounts listed on the Budget dashboard. This matches current behavior.
  • When unchecking a given checkbox:
    1. Numbers shown on the Sustainability dashboard should be updated such that they exclude the corresponding actual:
      • Total hours -= actual
      • Billable hours -= actual if actual belongs to a billable account
      • Non-billable hours -= actual if actual belongs to a non-billable account
      • % non-billable = Non-billable hours / Total hours (recalculate after updating Total hours and Non-billable hours as shown above)
      • Remaining non-billable hours = ((Billable hours * <sustainability target>) / (1 - <sustainability target>)) - Non-billable hours (recalculate after updating Billable hours and Non-billable hours as shown above)
    2. The corresponding row on the Budget dashboard should be greyed out.
  • When checking a previously-unchecked checkbox, the steps above should be reversed:
    1. Numbers shown on the Sustainability dashboard should be updated such that they include the corresponding actual:
      • Total hours += actual
      • Billable hours += actual if actual belongs to a billable account
      • Non-billable hours += actual if actual belongs to a non-billable account
      • % non-billable = Non-billable hours / Total hours (recalculate after updating Total hours and Non-billable hours as shown above)
      • Remaining non-billable hours = ((Billable hours * <sustainability target>) / (1 - <sustainability target>)) - Non-billable hours (recalculate after updating Billable hours and Non-billable hours as shown above)
    2. The corresponding row on the Budget dashboard should no longer be greyed out.

Examples of relevant calculations

Completion criteria

  • Implement functionality for toggling inclusion of account actuals as described above.
  • Create PRs as necessary.
  • Deploy changes.

Documentation updates & improvements criteria

Edited by Tim Krones