@php $valorNota = $orcamento->valor_nota ? number_format($orcamento->valor_nota / 100, 2, ',', '.') : '0,00'; $qtde = $orcamento->qtde; $peso = $orcamento->peso; if (strlen((string) $peso) <= 2) { $pesoFormatado = $peso . ',00'; } else { $pesoFormatado = number_format($peso / 100, 2, ',', '.'); } $email = isset($orcamento->email) ? trim($orcamento->email) : ''; $telefone = isset($orcamento->tel) ? trim($orcamento->tel) : ''; $telefoneFormatado = ''; if ($telefone !== '' && strlen($telefone) === 14) { if (preg_match('/^(\+?\d{2})(\d{2})(\d{5})(\d{4})$/', $telefone, $matches)) { $telefoneFormatado = sprintf('%s (%s) %s-%s', $matches[1], $matches[2], $matches[3], $matches[4]); } } else { $telefoneFormatado = $telefone; } $dataEnvio = \Carbon\Carbon::parse($orcamento->data_envio)->format('d/m/Y H:i:s'); @endphp

Status: {{ $orcamento->status }}


Município de origem: {{ $orcamento->cidade_origem }}

Município de destino: {{ $orcamento->cidade_destino }}

Tipo de transporte: {{ $orcamento->tipo }}

@if ($valorNota != '0,00' || $orcamento->tipo === 'Transporte Aéreo' || $orcamento->tipo === 'Transporte de Carga em Geral' || $orcamento->tipo === 'Transporte de Carga Refrigerada' || $orcamento->tipo === 'Transporte de Moto') @if ($orcamento->tipo != 'Transporte de Material Sem Nota')

Valor da nota: R$ {{ $valorNota }}

@endif @endif @if ($qtde != '0' && $orcamento->tipo != 'Transporte de Material Sem Nota')

Quantidade: {{ $qtde }}

@endif @if ($peso != '0' && $orcamento->tipo !== 'Transporte de Carro' && $orcamento->tipo != 'Transporte de Material Sem Nota')

Peso: {{ $pesoFormatado }}

@endif @if ($orcamento->tipo === 'Armazenamento de Cargas')

Volume: {{ $orcamento->volume }}

Periodo: {{ $orcamento->periodo }}

@endif @if ($orcamento->tipo === 'Transporte de Carro' || $orcamento->tipo === 'Transporte de Máquina' || $orcamento->tipo === 'Transporte de Moto') @if($orcamento->modelo != '')

Modelo: {{ $orcamento->modelo }}

@endif @endif

Nome: {{ $orcamento->nome_completo }}

@if($email !== '')

Email: {{ $email }}

@endif @if($telefoneFormatado !== '')

Telefone:

@endif
@php // Normaliza texto vindo do banco (remove HTML, previne XSS e mantém quebras) $descricao = $orcamento->desc ?? ''; $descricao = preg_replace('//i', "\n", $descricao); $descricao = strip_tags($descricao); $descricao = nl2br(e($descricao)); @endphp

Descrição: {!! $descricao !!}


IP: {{ $orcamento->ip }}

Navegador: {{ $orcamento->navegador }}

Dispositivo: {{ $orcamento->dispositivo }}

Operacional: {{ $orcamento->operacional }}

Localização: {{ $orcamento->localizacao }}


Data de envio: {{ $dataEnvio }}

@if(!empty($orcamento->formulario_cotacao)) @php $formularioLabel = match ($orcamento->formulario_cotacao) { 'principal' => 'Página principal', 'rota' => 'Por rota (origem/destino)', 'cargas-especiais' => 'Cargas especiais', 'cidades' => 'Por cidade', default => ucfirst(str_replace(['-', '_'], ' ', $orcamento->formulario_cotacao)), }; @endphp

Formulário: {{ $formularioLabel }}

@endif

Transportadoras que receberam a cotação:

@if ($transportadorasPorPlano->isNotEmpty()) @foreach ($transportadorasPorPlano as $plano => $transportadoras)

{{ $plano }} :

@foreach ($transportadoras as $transportadora)

{{ $transportadora->nome_fantasia }}

@endforeach @endforeach @endif

Total de Transportadoras: {{ $totalTransportadoras }}