@extends('layouts.app') @section('title', 'Perdas de Produtos (VIMAN) | OPME') @section('topbar_title', '🗑️ ' . ($titulo ?? 'Perdas de Produtos (VIMAN)')) @section('topbar_extra_actions')
Faturamento Retido Estoque Externo Atualizar
@endsection @section('styles') @endsection @section('content') @php $inicioRegistro = $itens->total() === 0 ? 0 : (($itens->currentPage() - 1) * $itens->perPage()) + 1; $fimRegistro = $itens->total() === 0 ? 0 : min($itens->currentPage() * $itens->perPage(), $itens->total()); $janelaInicial = max(1, $itens->currentPage() - 2); $janelaFinal = min($itens->lastPage(), $itens->currentPage() + 2); $paginasVisiveis = $itens->lastPage() > 0 ? array_values(array_unique(array_merge([1], range($janelaInicial, $janelaFinal), [$itens->lastPage()]))) : []; $queryAtual = request()->query(); @endphp
Perdas de Produtos (VIMAN) ERP VIMAN OFICIAL
Consulta gerencial e analítica das baixas por perda, descarte e avaria registradas no ERP VIMAN, discriminadas por Lote do Fabricante com a respectiva Data de Validade e motivo do Estoque de Separação.
@if ($erroConsulta)
{{ $erroConsulta }}
@endif {{-- KPI CARDS --}}
Total de Lotes Baixados
{{ number_format($kpis['total_registros'], 0, ',', '.') }}
Qtd. na Página (Itens)
{{ number_format($kpis['pagina_qtde'], 0, ',', '.') }} un
Valor Total na Página
R$ {{ number_format($kpis['pagina_valor'], 2, ',', '.') }}
Com Validade Apurada
{{ $kpis['pagina_com_validade'] }} / {{ count($itens) }}
{{-- FILTROS --}}
Limpar
{{-- TABELA DE RESULTADOS --}}
@if ($itens->total() > 0 && $itens->hasPages())
Exibindo {{ $inicioRegistro }}-{{ $fimRegistro }} de {{ number_format($itens->total(), 0, ',', '.') }} registros
@endif
@forelse ($itens as $item) @php $motivoClass = str_contains($item['estoque_separacao'] ?? '', 'AVARIAD') ? 'motivo-avaria' : ''; $temValidade = filled($item['data_validade_lote'] ?? null); @endphp @empty @endforelse
Filial Tipo Tópico Grupo Lote Fabricante Tipo de Saída Referência Descrição do Produto Dt. Emissão Nº Nota Tipo de Operação Data de Validade Qtd. Valor Unit. (R$) Valor Total (R$) Marca Estoque de Separação
{{ $item['filial'] ?? 'ES' }} {{ $item['tipo'] ?? '—' }} {{ $item['topico'] ?? '—' }} {{ $item['grupo'] ?? '—' }} {{ $item['lote_fabricante'] ?? '—' }} {{ $item['tipo_saida'] ?? '—' }} {{ $item['referencia'] ?? '—' }} {{ $item['descricao'] ?? '—' }} {{ $item['dt_emissao'] ?? '—' }} {{ $item['numero_nota'] ?? '—' }} {{ $item['tipo_operacao'] ?? '—' }} @if ($temValidade) {{ $item['data_validade_lote'] }} @else Sem Validade @endif {{ number_format((float) ($item['quantidade'] ?? 0), 0, ',', '.') }} R$ {{ number_format((float) ($item['valor_unitario'] ?? 0), 2, ',', '.') }} R$ {{ number_format((float) ($item['valor_total'] ?? 0), 2, ',', '.') }} {{ $item['marca'] ?? '—' }} {{ $item['estoque_separacao'] ?? '6-MATERIAL VENCIDO' }}
Nenhum registro de perda encontrado no período selecionado. Tente ajustar os filtros de emissão, filial ou lote do fabricante.
@if ($itens->total() > 0)
Página {{ $itens->currentPage() }} de {{ max($itens->lastPage(), 1) }} • Total de {{ number_format($itens->total(), 0, ',', '.') }} registros
@if ($itens->hasPages()) @endif
@endif
@endsection