Skip to content

Commit

Permalink
Renamed billable_rounded_hours
Browse files Browse the repository at this point in the history
  • Loading branch information
xendk committed Aug 12, 2024
1 parent 560e007 commit fc3afae
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 7 additions & 4 deletions src/responses/user_time_summary.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit fc3afae

Please sign in to comment.