  def self.applied_paid_hlds(user_id, start_date, end_date)

    SqlHelper.validate_token([user_id, start_date, end_date])

    sql = "SELECT COUNT(*) FROM timecards WHERE user_id = #{user_id} AND date >= '#{start_date}' AND date <= '#{end_date}'"

    sum = 0.0
    self.workcodes.each do |key, params|
      paidhld_rate = params[WKCODE_PARAM_PAIDHLD]
      if paidhld_rate > 0.0
        num = Timecard.count_by_sql(sql + " AND workcode='#{key}'")
        sum += num * paidhld_rate
      end
    end

    return sum
  end