@php $record = $getRecord(); $entregas = $record->notasFiscais()->where('tipo_movimento', 'ENT')->count(); $coletas = $record->notasFiscais()->where('tipo_movimento', 'COL')->count(); $transferencias = $record->notasFiscais()->where('tipo_movimento', 'MNF')->count(); $notas = $record->notasFiscais()->count(); $concluidas = $record->notasFiscais()->where('status_entrega', 'entregue')->count(); $percentual = $notas > 0 ? round(($concluidas / $notas) * 100) : 0; @endphp