Ultima correção antes de colocar em produção

This commit is contained in:
2026-06-24 15:18:58 -03:00
parent 8572e6a842
commit 1807dc1821
2 changed files with 4 additions and 1 deletions

View File

@@ -8,9 +8,11 @@ module Motorista
nome = current_user.nome
# Card 1 — Valor ESTIMADO (mês atual): entregas pagas × preco_entrega
@estimado_inicio = Date.current.beginning_of_month
@estimado_fim = Date.current
entregas_mes = Entrega.pagas.da_conta_gade
.do_motorista(nome)
.no_periodo(Date.current.beginning_of_month, Date.current)
.no_periodo(@estimado_inicio, @estimado_fim)
.count
@valor_estimado = entregas_mes * Configuracao.preco_entrega
@entregas_mes = entregas_mes

View File

@@ -34,6 +34,7 @@
<%# Card 1 — Valor Estimado (LARANJA) %>
<div class="bg-orange-500 rounded-2xl p-6">
<p class="text-black/80 font-bold uppercase tracking-wide">💰 Valor estimado deste mês</p>
<p class="text-black/70 text-sm mt-1">📅 <%= l @estimado_inicio, format: :short %> a <%= l @estimado_fim, format: :short %></p>
<p class="text-black font-black text-4xl sm:text-5xl mt-2 leading-tight whitespace-nowrap"><%= moeda(@valor_estimado) %></p>
<p class="text-black/80 text-base mt-2">
<%= @entregas_mes %> entregas feitas e confirmadas