Adição de mais um preço 'Termo especial'
This commit is contained in:
@@ -171,14 +171,20 @@
|
||||
</thead>
|
||||
<tbody class="divide-y divide-[#2a2a2a]">
|
||||
<% @apontamentos.each do |(motorista, _tracking), pilares| %>
|
||||
<% eh_termo = pilares.first.termo? %>
|
||||
<% eh_termo = pilares.first.termo? || pilares.first.termo_especial? %>
|
||||
<% entrega = eh_termo ? nil : pilares.first.entrega_original %>
|
||||
<% nf_exibida = entrega&.numero_nf || pilares.first.nf_manual %>
|
||||
<% obs_manual = pilares.first.obs_manual %>
|
||||
<% total = pilares.sum { |p| p.desconto? ? -p.valor_aplicado : p.valor_aplicado } %>
|
||||
<tr>
|
||||
<td class="px-4 py-3">
|
||||
<p class="text-white font-bold"><%= eh_termo ? '📄 Entrega de termo' : "NF #{nf_exibida.presence || '—'}" %></p>
|
||||
<p class="text-white font-bold"><%= if pilares.first.termo?
|
||||
'📄 Entrega de termo'
|
||||
elsif pilares.first.termo_especial?
|
||||
'📋 Entrega de termo especial'
|
||||
else
|
||||
"NF #{nf_exibida.presence || '—'}"
|
||||
end %></p>
|
||||
<p class="text-gray-400 text-xs">
|
||||
<%= motorista %><% if entrega&.vehicle.present? %> · <%= entrega.vehicle %><% end %>
|
||||
<% if entrega.nil? && obs_manual.present? %> · <%= obs_manual %><% end %>
|
||||
@@ -187,7 +193,7 @@
|
||||
<td class="px-4 py-3">
|
||||
<div class="flex flex-wrap gap-1">
|
||||
<% pilares.each do |p| %>
|
||||
<span class="<%= p.tipo_cor[:bg] %> <%= p.tipo_cor[:text] %> px-2 py-1 rounded text-xs font-bold"><%= p.tipo_cor[:label] %><% if p.termo? && p.quantidade > 1 %> ×<%= p.quantidade %><% end %></span>
|
||||
<span class="<%= p.tipo_cor[:bg] %> <%= p.tipo_cor[:text] %> px-2 py-1 rounded text-xs font-bold"><%= p.tipo_cor[:label] %><% if (p.termo? || p.termo_especial?) && p.quantidade > 1 %> ×<%= p.quantidade %><% end %></span>
|
||||
<% end %>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
Reference in New Issue
Block a user