@extends('layouts.app') @section('title', ($titulo ?? 'Faturamento Retido') . ' | Produção') @section('topbar_title', $tituloTopbar ?? 'Produção: Painel de Faturamento Retido') @section('topbar_extra_actions')
Atualizar VIMAN Agora @if (auth()->user()?->hasPermission($permissaoExport ?? 'opme.divergencia-geral.export') || auth()->user()?->ehAdmin()) @else Exportação Bloqueada @endif
@endsection @section('styles') @endsection @section('content') @php $inicioRegistro = $vales->total() === 0 ? 0 : (($vales->currentPage() - 1) * $vales->perPage()) + 1; $fimRegistro = $vales->total() === 0 ? 0 : min($vales->currentPage() * $vales->perPage(), $vales->total()); $janelaInicial = max(1, $vales->currentPage() - 2); $janelaFinal = min($vales->lastPage(), $vales->currentPage() + 2); $paginasVisiveis = $vales->lastPage() > 0 ? array_values(array_unique(array_merge([1], range($janelaInicial, $janelaFinal), [$vales->lastPage()]))) : []; $queryAtual = request()->query(); $regioesResumo = $resumo['por_regiao'] ?? []; $segmentosResumo = array_slice($resumo['por_segmento'] ?? [], 0, 8); $maxValorRegiao = max(array_column($regioesResumo, 'valor') ?: [0]); $maxValorSegmento = max(array_column($segmentosResumo, 'valor') ?: [0]); @endphp {{-- CABEÇALHO DO MÓDULO --}}

{{ $titulo ?? 'Faturamento Retido' }} Produção

Visualização operacional e confronto de vales cirúrgicos sincronizados do ERP VIMAN.

@if (!empty($erroConsulta))
{{ $erroConsulta }}
@endif {{-- CARD DE FILTROS DA CONSULTA --}}
@foreach ($vendedores as $opcaoVendedor) @endforeach
Limpar
@if (!empty($erroResumo))
{{ $erroResumo }}
@endif
Quantidade total
{{ number_format($vales->total(), 0, ',', '.') }}
Valor total
R$ {{ number_format($resumo['valor_total'] ?? 0, 2, ',', '.') }}
Itens sem valor
{{ number_format($resumo['quantidade_sem_valor'] ?? 0, 0, ',', '.') }}
@include('modulos.opme.divergencia-geral.partials.mapa-regional')

Valor por região

Municípios agrupados por Grande Rio, Rio Interior, Grande SP e Interior SP @forelse ($regioesResumo as $regiao)
{{ $regiao['nome'] }} · {{ number_format($regiao['quantidade'], 0, ',', '.') }} itens R$ {{ number_format($regiao['valor'], 2, ',', '.') }}
@empty

Sem dados para os filtros selecionados.

@endforelse

Valor por segmento

Até 8 segmentos com maior valor @forelse ($segmentosResumo as $segmento)
{{ $segmento['nome'] }} · {{ number_format($segmento['quantidade'], 0, ',', '.') }} itens R$ {{ number_format($segmento['valor'], 2, ',', '.') }}
@empty

Sem dados para os filtros selecionados.

@endforelse
{{-- CARD PRINCIPAL COM TABELA E PAGINAÇÃO --}}
Registros de Vales Cirúrgicos

Listagem dos vales e itens correspondentes aos parâmetros informados.

{{ number_format($vales->total(), 0, ',', '.') }} registro(s) encontrado(s)
@if ($vales->total() > 0 && $vales->hasPages())
Exibindo {{ $inicioRegistro }}-{{ $fimRegistro }} de {{ number_format($vales->total(), 0, ',', '.') }} registros
@endif
@foreach ($headings as $heading) @endforeach @forelse ($vales as $vale) @foreach ($vale as $valor) @endforeach @empty @endforelse
{{ $heading }}
{{ $valor !== '' && $valor !== null ? $valor : '-' }}
Nenhum registro encontrado para os filtros informados.
@if ($vales->total() > 0)
Página {{ $vales->currentPage() }} de {{ max($vales->lastPage(), 1) }} • Total de {{ number_format($vales->total(), 0, ',', '.') }} linhas
@if ($vales->hasPages()) @endif
@endif
@endsection