Skip to content

Commit

Permalink
fix bug of negative expected hours
Browse files Browse the repository at this point in the history
  • Loading branch information
kaiomagalhaes committed Nov 17, 2023
1 parent c9bfde9 commit f2e4d69
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/utils/analytics/finances/finances_calculator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ def requirements
end

def expected_hours(assignment)
TimeEntries::ExpectedHours.new(assignment, @start_date, @end_date).data - paid_time_off_hours(assignment)
[TimeEntries::ExpectedHours.new(assignment, @start_date, @end_date).data - paid_time_off_hours(assignment),
0].max
end

def paid_time_off_hours(assignment)
Expand Down

0 comments on commit f2e4d69

Please sign in to comment.