module PointsalesHelper
	def setup_pointsale(pointsale)
		(pointsale.users.blank? ? pointsale.users.new : pointsale.users)
		pointsale
	end

  def pointsale_status(pointsale)
    case pointsale.status
    when "active" then
      content_tag(:i, "", class: "fa fa-check font-green")
    when "inactive" then
      content_tag(:i, "", class: "fa fa-times font-red")
    end
  end

  def product_count(count)
    if count > 0
      content_tag(:i, "", class: "fa fa-check font-green")
    else
      content_tag(:i, "", class: "fa fa-times font-red")
    end
  end
end
