@extends('layouts.app') @section('title', 'Detalhes - ' . $company->name . ' - ERP-PLUS') @section('page_title', $company->name) @section('page_subtitle', 'CNPJ ' . preg_replace('/(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})/', '$1.$2.$3/$4-$5', $company->cnpj)) @section('page_actions') Voltar @can('manage-companies') Editar @endcan @endsection @push('styles') @endpush @section('content')

Informacoes da empresa

{{ $company->name }}
{{ $company->trade_name ?: '-' }}
{{ preg_replace('/(\d{2})(\d{3})(\d{3})(\d{4})(\d{2})/', '$1.$2.$3/$4-$5', $company->cnpj) }}
{{ $company->state_registration ?: '-' }}
{{ $company->uf }}
{{ (int) $company->sefaz_environment === 1 ? 'Producao' : 'Homologacao' }}
{{ $company->nsuCursor?->ult_nsu ?? '0' }}
{{ $company->nsuCursor?->max_nsu ?? '-' }}
{{ $company->nsuCursor?->last_query_at?->format('d/m/Y H:i') ?: '-' }}

Armazenamento

Documentos XML
@php $mb = $storageBytes / 1048576; $gb = $storageBytes / 1073741824; $storageFormatted = $gb >= 1 ? number_format($gb, 2).' GB' : ($mb >= 1 ? number_format($mb, 2).' MB' : number_format($storageBytes, 0).' bytes'); @endphp
{{ $incomingCount }}
XML de Entrada
{{ $outgoingCount }}
XML de Saida
{{ number_format($incomingCount + $outgoingCount, 0) }}
Total Documentos
{{ $storageFormatted }}
Espaco Ocupado

Certificado A1

{{ $activeCertificate ? 'Certificado ativo' : 'Nenhum certificado ativo' }}
@if ($activeCertificate) @can('manage-companies') Baixar .pfx @endcan @endif
@if (session('cert_warning'))
Aviso: {{ session('cert_warning') }}
@endif @if ($activeCertificate)
{{ $activeCertificate->original_name }}
{{ $activeCertificate->serial_number ?: '-' }}
{{ $activeCertificate->valid_from?->format('d/m/Y') ?: '-' }}
@if ($activeCertificate->valid_until) {{ $activeCertificate->valid_until->format('d/m/Y') }} ({{ $activeCertificate->valid_until->isPast() ? 'Vencido' : 'Valido — '.$activeCertificate->valid_until->diffForHumans() }}) @else Validade nao identificada @endif
@else
Nenhum certificado ativo. Envie o certificado abaixo para habilitar a consulta SEFAZ.
@endif {{-- Formulario de upload disponivel para todos os usuarios com acesso a empresa --}}
{{ $activeCertificate ? 'Substituir certificado' : 'Enviar certificado' }}
@if ($errors->any())
{{ $errors->first() }}
@endif
@csrf
@error('certificate_file')
{{ $message }}
@enderror
A senha e armazenada criptografada. @error('certificate_password')
{{ $message }}
@enderror

Ultimos 20 documentos

{{ $recentDocuments->count() }} registro(s)
@forelse ($recentDocuments as $doc) @php $key = $doc->access_key; $keyShort = strlen($key) === 44 ? substr($key, 0, 10).'...'.substr($key, -10) : $key; $hasCiencia = $doc->manifestations ->where('event_code', \App\Models\NfeManifestation::EVENT_CIENCIA_OPERACAO) ->whereIn('response_status_code', ['135', '136', '573']) ->isNotEmpty(); @endphp @empty @endforelse
Chave de acesso Emissao Fornecedor Valor XML Ciencia
{{ $keyShort }} {{ $doc->issued_at?->format('d/m/Y') ?? '-' }}
{{ Str::limit($doc->issuer_name ?? '-', 30) }}
@if ($doc->issuer_cnpj)
{{ $doc->issuer_cnpj }}
@endif
{{ $doc->total_amount ? 'R$ '.number_format((float) $doc->total_amount, 2, ',', '.') : '-' }} @if ($doc->xml_content) Completo @elseif ($doc->raw_summary_xml) Resumo @else Sem XML @endif @if ($hasCiencia) Ciencia @else Pendente @endif
Nenhum documento sincronizado para esta empresa.
@endsection