From fc3afae06c85e5efe051ffacce08ad49483e88de Mon Sep 17 00:00:00 2001 From: Thomas Fini Hansen Date: Mon, 12 Aug 2024 11:31:26 +0200 Subject: [PATCH] Renamed `billable_rounded_hours` --- CHANGELOG.md | 5 +++++ src/responses/user_time_summary.cr | 11 +++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c8ed3f..7a96fec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ### Added - Rounded versions of hours per day and same normalized. +### Changed +- Renamed `billable_rounded_hours` to `rounded_billable_hours`. + `billable_rounded_hours` kept around for compatibility for the + moment being. + ## [1.1.5] - 2024-07-29 ### Fixed diff --git a/src/responses/user_time_summary.cr b/src/responses/user_time_summary.cr index bda12ee..fca0eba 100644 --- a/src/responses/user_time_summary.cr +++ b/src/responses/user_time_summary.cr @@ -69,7 +69,7 @@ module Responses @extra.billability.of_total_hours = @extra.billable_hours / @hours * 100 @extra.billability.hours_pr_day = @extra.billable_hours / work_days - @extra.billability.rounded_hours_pr_day = @extra.billable_rounded_hours / work_days + @extra.billability.rounded_hours_pr_day = @extra.rounded_billable_hours / work_days # Admin stuff. @admin.billability.goal = @@ -88,7 +88,7 @@ module Responses if actual_work_days.positive? # Actual amount of billable hours per day. @extra.billability.hours_pr_day_normalized = @extra.billable_hours / actual_work_days - @extra.billability.rounded_hours_pr_day_normalized = @extra.billable_rounded_hours / actual_work_days + @extra.billability.rounded_hours_pr_day_normalized = @extra.rounded_billable_hours / actual_work_days end round @@ -141,7 +141,7 @@ module Responses if task.billable_by_default && project.is_billable && task.name != "Off Hours - Driftsupport (ReOps)" @extra.billable_hours += entry.hours - @extra.billable_rounded_hours += entry.rounded_hours + @extra.rounded_billable_hours += entry.rounded_hours end end end @@ -166,6 +166,8 @@ module Responses include Optional property billable_hours = 0_f64 + property rounded_billable_hours = 0_f64 + # Brainfart, kept for compatibility for the moment being. property billable_rounded_hours = 0_f64 property billability = Billability.new property holiday = 0_f64 @@ -181,7 +183,8 @@ module Responses def round @billable_hours = @billable_hours.round(2) - @billable_rounded_hours = @billable_rounded_hours.round(2) + @rounded_billable_hours = @rounded_billable_hours.round(2) + @billable_rounded_hours = @rounded_billable_hours @billability.round @holiday = @holiday.round(2) @time_off.round