<commit_before>module ApplicationHelper
  def status_helper (status)
  	case status
  		when Invoice.temporary
  			label_class = 'inverse'
  			text = 'temporanea'
  		when Invoice.active
  			label_class = 'info'
  			text = 'emessa'
  		when 3
  			label_class = 'warning'
  			text = 'warning'
  		when 4
  			label_class = 'info'
  			text = 'info'
  		when 5
  			label_class = 'inverse'
  			text = 'inverse'
  	end
  	
  	raw("<span class=\"label label-#{label_class}\">#{text}</span>")
  end

  def due_date_helper (invoice)
    label_class = ''
    text = nil
    if !invoice.due_date.nil? and invoice.due_date <= DateTime.now && !invoice.is_payed
      label_class = 'important'
      text = 'scaduta'
    end
    raw("<span class=\"label label-#{label_class}\">#{text}</span>")
  end

  def job_order_status_helper (job_order)
    if job_order.percent > 99
      return "progress-danger" 
    end
    if job_order.percent > 85
      return "progress-warning"
    end
  end

  def job_order_cost_status_helper(job)
    begin
      delta = job.total_estimated_cost - job.total_consumed_cost
      delta_perc = (delta / job.total_estimated_cost * 100).ceil
      
      label_class = 'info'
      if delta_perc.abs > 80.0
        label_class = 'warning'
      end

      if delta_perc.abs > 100
        label_class = 'important'
      end

      return raw("<span class=\"label label-#{label_class}\">#{delta_perc.abs}</span>")
    rescue
      return raw("<span class=\"label\">Na</span>")
    end
  end

end<commit_msg>show euros<commit_after>module ApplicationHelper
  def status_helper (status)
  	case status
  		when Invoice.temporary
  			label_class = 'inverse'
  			text = 'temporanea'
  		when Invoice.active
  			label_class = 'info'
  			text = 'emessa'
  		when 3
  			label_class = 'warning'
  			text = 'warning'
  		when 4
  			label_class = 'info'
  			text = 'info'
  		when 5
  			label_class = 'inverse'
  			text = 'inverse'
  	end
  	
  	raw("<span class=\"label label-#{label_class}\">#{text}</span>")
  end

  def due_date_helper (invoice)
    label_class = ''
    text = nil
    if !invoice.due_date.nil? and invoice.due_date <= DateTime.now && !invoice.is_payed
      label_class = 'important'
      text = 'scaduta'
    end
    raw("<span class=\"label label-#{label_class}\">#{text}</span>")
  end

  def job_order_status_helper (job_order)
    if job_order.percent > 99
      return "progress-danger" 
    end
    if job_order.percent > 85
      return "progress-warning"
    end
  end

  def job_order_cost_status_helper(job)
    begin
      delta = job.total_estimated_cost - job.total_consumed_cost
      delta_perc = (delta / job.total_estimated_cost * 100).ceil
      
      label_class = 'info'
      if delta_perc.abs > 80.0
        label_class = 'warning'
      end

      if delta_perc.abs > 100
        label_class = 'important'
      end

      return raw("<span class=\"label label-#{label_class}\">#{delta.abs}</span>")
    rescue
      return raw("<span class=\"label\">Na</span>")
    end
  end

end
{'fraction_non_alphanumeric': 0.11664482306684142, 'fraction_numerical': 0.010484927916120577, 'mean_word_length': 2.5172811059907834, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5543048', 'n_tokens_mistral': 1136, 'n_tokens_neox': 1082, 'n_words': 228}