You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: sale_contract_item.rb
    path of file: ./repos/ekylibre/app/models
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

# = Informations
#
# == License
#
# Ekylib
    
  def forecast_duration
    duration = 0.0
    project_tasks.each do |t|
      if t.forecast_duration > 0.0
        if t.forecast_duration_unit == :hour
          duration += t.forecast_duration
        elsif t.forecast_duration_unit == :day
          duration += (t.forecast_duration * 7)
        end
      end