Project

General

Profile

Patch #40798 » 0003-Optimize-Version-behind_schedule-by-avoiding-the-cal.patch

Go MAEDA, 2024-06-13 10:54

View differences:

app/models/version.rb
269 269
  end
270 270

  
271 271
  def behind_schedule?
272
    if completed_percent == 100
273
      return false
274
    elsif due_date && start_date
275
      done_date = start_date + ((due_date - start_date+1)* completed_percent/100).floor
276
      return done_date <= User.current.today
277
    else
278
      false # No issues so it's not late
279
    end
272
    # Due date is blank, no issues, or 100% completed, so it's not late
273
    return false if due_date.nil? || start_date.nil? || completed_percent == 100
274

  
275
    done_date = start_date + ((due_date - start_date + 1) * completed_percent / 100).floor
276
    done_date <= User.current.today
280 277
  end
281 278

  
282 279
  # Returns the completion percentage of this version based on the amount of open/closed issues
(3-3/3)