From 1807dc1821c0cc79e7db11363b2e0d8f975edf0cce99274cc28f28c43df17e3f Mon Sep 17 00:00:00 2001 From: victor Date: Wed, 24 Jun 2026 15:18:58 -0300 Subject: [PATCH] =?UTF-8?q?Ultima=20corre=C3=A7=C3=A3o=20antes=20de=20colo?= =?UTF-8?q?car=20em=20produ=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/motorista/dashboard_controller.rb | 4 +++- app/views/motorista/dashboard/index.html.erb | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/controllers/motorista/dashboard_controller.rb b/app/controllers/motorista/dashboard_controller.rb index 5a155e5..5389fa8 100644 --- a/app/controllers/motorista/dashboard_controller.rb +++ b/app/controllers/motorista/dashboard_controller.rb @@ -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 diff --git a/app/views/motorista/dashboard/index.html.erb b/app/views/motorista/dashboard/index.html.erb index 831a4fe..14e3c1f 100644 --- a/app/views/motorista/dashboard/index.html.erb +++ b/app/views/motorista/dashboard/index.html.erb @@ -34,6 +34,7 @@ <%# Card 1 — Valor Estimado (LARANJA) %>

💰 Valor estimado deste mês

+

📅 <%= l @estimado_inicio, format: :short %> a <%= l @estimado_fim, format: :short %>

<%= moeda(@valor_estimado) %>

<%= @entregas_mes %> entregas feitas e confirmadas