@extends('layouts.app') @section('title', 'Faturamento Geral | OPME') @section('topbar_title', '📈 ' . ($titulo ?? 'Faturamento Geral da Empresa')) @section('topbar_extra_actions')
Faturamento Retido Atualizar
@endsection @section('styles') @endsection @section('content')
Faturamento Geral da Empresa
Consulta analítica das operações de faturamento, vendas e devoluções para conciliação contábil e conferência com o relatório TE070.
Filiais Físicas Avaliadas: 01 - ES (Matriz) 06 - SP (Filial) 07 - MG (Filial) 08 - RJ (Filial) • Tabelas VETENT / VETENI no ERP VIMAN
@if ($erroConsulta)
Aviso de Conexão: {{ $erroConsulta }}
@endif
Faturamento Líquido
R$ {{ number_format($kpis['total_faturado'], 2, ',', '.') }}
Receita líquida com deduções
Faturamento Bruto
R$ {{ number_format($kpis['total_bruto'], 2, ',', '.') }}
Total bruto de mercadorias e serviços
Devoluções de Venda
R$ {{ number_format($kpis['total_devolucoes'], 2, ',', '.') }}
Deduções e retornos abatidos
Notas / Itens Faturados
{{ number_format($kpis['total_notas'], 0, ',', '.') }} NFs
{{ number_format($kpis['total_itens'], 0, ',', '.') }} produtos movimentados
Ticket Médio por NF
R$ {{ number_format($kpis['ticket_medio'], 2, ',', '.') }}
Média por nota emitida
Filtros de Pesquisa & Período
Limpar Filtros
@forelse ($faturamento as $item) @php $row = (array) $item; $codEmp = (string) ($row['cod_empresa'] ?? $row['COD_EMPRESA'] ?? ''); $filialNome = (string) ($row['filial'] ?? $row['FILIAL'] ?? ''); $numNf = (string) ($row['num_nota_fiscal'] ?? $row['NUM_NOTA_FISCAL'] ?? ''); $serie = (string) ($row['serie'] ?? $row['SERIE'] ?? ''); $dtEmissao = (string) ($row['dt_emissao'] ?? $row['DT_EMISSAO'] ?? ''); $grupoFat = (string) ($row['grupo_faturamento'] ?? $row['GRUPO_FATURAMENTO'] ?? ''); $cfopItem = (string) ($row['cfop'] ?? $row['CFOP'] ?? ''); $nomeCli = (string) ($row['nome_cliente'] ?? $row['NOME_CLIENTE'] ?? ''); $ufCli = (string) ($row['uf_cliente'] ?? $row['UF_CLIENTE'] ?? ''); $nomeVend = (string) ($row['nome_vendedor'] ?? $row['NOME_VENDEDOR'] ?? ''); $codProd = (string) ($row['cod_produto'] ?? $row['COD_PRODUTO'] ?? ''); $refProd = (string) ($row['referencia_produto'] ?? $row['REFERENCIA_PRODUTO'] ?? ''); $descProd = (string) ($row['descricao_produto'] ?? $row['DESCRICAO_PRODUTO'] ?? ''); $loteInterno = (string) ($row['lote_interno'] ?? $row['LOTE_INTERNO'] ?? ''); $qtdFat = (float) ($row['qtd_faturada'] ?? $row['QTD_FATURADA'] ?? 0); $vlrUnit = (float) ($row['valor_unitario_bruto'] ?? $row['VALOR_UNITARIO_BRUTO'] ?? 0); $vlrBruto = (float) ($row['valor_bruto'] ?? $row['VALOR_BRUTO'] ?? 0); $vlrDesc = (float) ($row['valor_desconto'] ?? $row['VALOR_DESCONTO'] ?? 0); $vlrTotal = (float) ($row['valor_total_item'] ?? $row['VALOR_TOTAL_ITEM'] ?? 0); $vlrFatLiq = (float) ($row['valor_faturamento_liquido'] ?? $row['VALOR_FATURAMENTO_LIQUIDO'] ?? 0); // Badge de Filial $badgeFilialClass = match ($codEmp) { '1' => 'badge-filial-01', '6' => 'badge-filial-06', '7' => 'badge-filial-07', '8' => 'badge-filial-08', default => 'badge-op-outros', }; // Badge de Categoria de Operação $badgeOpClass = match (true) { str_contains($grupoFat, 'DEVOLUÇÃO') => 'badge-op-devolucao', str_contains($grupoFat, 'SERVIÇO') => 'badge-op-servico', str_contains($grupoFat, 'REMESSA') => 'badge-op-remessa', str_contains($grupoFat, 'VENDA') => 'badge-op-venda', default => 'badge-op-outros', }; @endphp @empty @endforelse
Filial NF / Série Emissão Categoria CFOP Cliente / Destinatário UF Vendedor Cód. / Ref. Produto Descrição do Produto Lote Interno Qtd Vlr Unitário Vlr Bruto Desconto Total Item Fat. Líquido
{{ $filialNome }} {{ $numNf }} @if ($serie !== '') / {{ $serie }} @endif {{ $dtEmissao }} {{ $grupoFat }} {{ $cfopItem }} {{ $nomeCli }} {{ $ufCli }} {{ $nomeVend }} {{ $codProd }} @if ($refProd !== '') {{ $refProd }} @endif {{ $descProd }} @if ($loteInterno !== '') {{ Str::limit($loteInterno, 20) }} @else - @endif {{ number_format($qtdFat, 2, ',', '.') }} R$ {{ number_format($vlrUnit, 2, ',', '.') }} R$ {{ number_format($vlrBruto, 2, ',', '.') }} {{ $vlrDesc > 0 ? 'R$ ' . number_format($vlrDesc, 2, ',', '.') : '-' }} R$ {{ number_format($vlrTotal, 2, ',', '.') }} R$ {{ number_format($vlrFatLiq, 2, ',', '.') }}
Nenhum registro de faturamento encontrado
Tente ajustar os filtros de período ou selecionar outra filial operacional.
@if ($faturamento->total() > 0)
Mostrando {{ $faturamento->firstItem() ?? 0 }} a {{ $faturamento->lastItem() ?? 0 }} de {{ number_format($faturamento->total(), 0, ',', '.') }} registros
{{-- Botão Anterior --}} @if ($faturamento->onFirstPage()) « Anterior @else « Anterior @endif {{-- Página atual / total --}} Página {{ $faturamento->currentPage() }} de {{ $faturamento->lastPage() }} {{-- Botão Próximo --}} @if ($faturamento->hasMorePages()) Próximo » @else Próximo » @endif
@endif
@endsection