Implantação da função de controle de consolidaçoes pagas e pendentes

This commit is contained in:
2026-06-17 15:49:24 -03:00
parent 292ac31c66
commit e9def7e21a
17 changed files with 526 additions and 12 deletions

View File

@@ -36,6 +36,20 @@ module ApplicationHelper
end
end
# Badge de status de pagamento de uma consolidação (derivado dos motoristas)
def badge_pagamento(status)
cfg = case status.to_s
when 'pago' then { cor: 'bg-green-600 text-white', icone: '💰', label: 'Pago' }
when 'parcial' then { cor: 'bg-yellow-500 text-black', icone: '⏳', label: 'Parcial' }
when 'pendente' then { cor: 'bg-gray-700 text-gray-300', icone: '🕗', label: 'Pendente' }
else { cor: 'bg-gray-800 text-gray-400', icone: '❓', label: status.to_s.humanize }
end
tag.span class: "inline-flex items-center gap-1 px-2.5 py-1 rounded-full text-xs font-bold #{cfg[:cor]}" do
"#{cfg[:icone]} #{cfg[:label]}"
end
end
# Badge de papel do usuário (admin/gerente/operador/motorista)
def badge_role(role)
cfg = case role.to_s