Correção Dash board e implantação Relaório de ADM
This commit is contained in:
@@ -61,11 +61,20 @@
|
||||
</div>
|
||||
</details>
|
||||
<% end %>
|
||||
|
||||
<%# Imprimir relatório financeiro do período/operação atuais %>
|
||||
<%= link_to '🖨️ Relatório',
|
||||
dashboard_relatorio_financeiro_path(
|
||||
inicio: @periodo_inicio.strftime('%Y-%m-%d'),
|
||||
fim: @periodo_fim.strftime('%Y-%m-%d'),
|
||||
operacoes: @operacao_filtro),
|
||||
data: { turbo: false },
|
||||
class: 'pl-4 pr-4 py-2.5 bg-orange-500 hover:bg-orange-600 text-black font-bold rounded-xl text-sm whitespace-nowrap' %>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<%# CARDS GRANDES — KPIs %>
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-4 gap-4">
|
||||
<div class="grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-5 gap-4">
|
||||
|
||||
<%# Card 1: Valor estimado %>
|
||||
<div class="sm:col-span-2 xl:col-span-1 bg-[#f97316] rounded-2xl p-6 relative overflow-hidden">
|
||||
@@ -76,17 +85,28 @@
|
||||
<%= moeda(@valor_estimado) %>
|
||||
</p>
|
||||
<p class="text-orange-200 text-sm">
|
||||
<%= @entregas_pagas %> entregas pagas
|
||||
<%= @entregas_pagas %> entregas concluídas
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%# Card destacado: total consolidado e pago (consolidações finalizadas do período) %>
|
||||
<div class="sm:col-span-2 xl:col-span-1 bg-[#1a1a1a] rounded-2xl border border-green-500/30 p-6">
|
||||
<p class="text-gray-400 text-sm font-medium mb-2">💼 Consolidado / Pago</p>
|
||||
<p class="text-3xl font-black text-white mb-1"><%= moeda(@fin_custo_total) %></p>
|
||||
<p class="text-gray-400 text-xs mb-2">consolidado no período</p>
|
||||
<div class="flex items-center gap-2 text-sm border-t border-white/5 pt-2">
|
||||
<span class="text-green-400 font-semibold"><%= moeda(@fin_pago) %></span>
|
||||
<span class="text-gray-400">pago</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<%# Card 2: Total de entregas %>
|
||||
<div class="bg-[#1a1a1a] rounded-2xl border border-white/5 p-6">
|
||||
<p class="text-gray-400 text-sm font-medium mb-2">📦 Total Entregas</p>
|
||||
<p class="text-4xl font-black text-white mb-1"><%= @total_entregas %></p>
|
||||
<div class="flex items-center gap-2 text-sm">
|
||||
<span class="text-green-400"><%= @entregas_pagas %> pagas</span>
|
||||
<span class="text-green-400"><%= @entregas_pagas %> entregues</span>
|
||||
<span class="text-gray-400">·</span>
|
||||
<span class="text-yellow-500"><%= @entregas_pendentes %> pendentes</span>
|
||||
</div>
|
||||
@@ -187,7 +207,7 @@
|
||||
<% else %>
|
||||
<div class="text-center py-8 text-gray-400">
|
||||
<div class="text-3xl mb-2">🚚</div>
|
||||
<p class="text-sm">Nenhuma entrega paga neste período</p>
|
||||
<p class="text-sm">Nenhuma entrega concluída neste período</p>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -577,7 +597,7 @@
|
||||
Chart.getChart(ctx)?.destroy();
|
||||
const labels = <%= raw @fin_por_tipo.map { |h| h[:label] }.to_json %>;
|
||||
const valores = <%= raw @fin_por_tipo.map { |h| h[:valor] }.to_json %>;
|
||||
const cores = ['#f97316', '#9a3412', '#fed7aa', '#374151'];
|
||||
const cores = ['#f97316', '#9a3412', '#fed7aa', '#374151', '#9333ea'];
|
||||
new Chart(ctx, {
|
||||
type: 'doughnut',
|
||||
data: { labels: labels, datasets: [{ data: valores, backgroundColor: cores, borderColor: '#1a1a1a', borderWidth: 3 }] },
|
||||
|
||||
Reference in New Issue
Block a user