@extends('layouts.app') @section('title', 'Consulta NSU - ERP-PLUS') @section('page_title', 'Consulta por NSU') @section('page_subtitle', 'Sincronize documentos fiscais e mantenha o cursor NSU controlado por empresa.') @section('page_actions') Voltar @endsection @push('styles') @endpush @section('content') {{-- Sync form: visivel para todos os operadores vinculados à empresa --}} @can('sync-documents')

Sincronizar empresa

A consulta usa o certificado A1 ativo da empresa selecionada.
@if ($companies->isEmpty())
Nenhuma empresa vinculada ao seu usuario. @can('manage-companies') Cadastrar empresa @endcan
@else
@csrf
@error('company_id')
{{ $message }}
@enderror
@can('manage-companies') Cadastrar empresa @endcan
@endif
@endcan {{-- Link to company NSU control --}}
O cursor NSU de cada empresa e atualizado automaticamente apos cada consulta a SEFAZ. Acompanhe o status em Empresas →
{{-- Documents grid --}}

Notas encontradas

{{ $recentDocuments->total() }} nota(s) @if ($hasFilters) com filtros aplicados @endif
XML completo: {{ $fullDocumentsCount }} Resumo: {{ $summaryDocumentsCount }}
{{-- Filter bar --}}
@if ($hasFilters) Limpar @endif
@forelse ($recentDocuments as $document) @php $hasCiencia = $document->manifestations ->where('event_code', \App\Models\NfeManifestation::EVENT_CIENCIA_OPERACAO) ->whereIn('response_status_code', ['135', '136', '573']) ->isNotEmpty(); $key = $document->access_key; $keyShort = strlen($key) === 44 ? substr($key, 0, 10).'...'.substr($key, -10) : $key; @endphp @empty @endforelse
Chave de acesso Emissao Fornecedor Destinatario Valor XML Ciencia Acoes
{{ $keyShort }}
{{ $document->company->name }} · NSU {{ $document->nsu ?? '-' }}
{{ $document->issued_at?->format('d/m/Y') ?? '-' }}
{{ Str::limit($document->issuer_name ?? '-', 30) }}
@if ($document->issuer_cnpj)
{{ $document->issuer_cnpj }}
@endif
{{ $document->recipient_cnpj ?? '-' }} {{ $document->total_amount ? 'R$ '.number_format((float) $document->total_amount, 2, ',', '.') : '-' }} @if ($document->xml_content) Completo @elseif ($document->raw_summary_xml) Resumo @else Sem XML @endif @if ($hasCiencia) Ciencia @else Pendente @endif
@can('manifest-documents') @if (! $hasCiencia)
@csrf
@endif @endcan @if ($document->xml_content) XML @elseif ($hasCiencia) @can('sync-documents')
@csrf
@endcan @endif @if ($document->raw_summary_xml) Resumo @endif
@if ($hasFilters) Nenhum documento encontrado com os filtros aplicados. Limpar filtros @else Nenhum documento sincronizado ainda. @endif
@if ($recentDocuments->hasPages())
@if ($recentDocuments->onFirstPage()) Anterior @else Anterior @endif Pagina {{ $recentDocuments->currentPage() }} de {{ $recentDocuments->lastPage() }} — {{ $recentDocuments->total() }} registro(s) @if ($recentDocuments->hasMorePages()) Proxima @else Proxima @endif
@endif
@endsection