@extends('layouts.app')

@section('title', 'Ingreso Anular')

@section('content')
<div class="container py-3">
    <div class="row justify-content-center">
        <div class="col-lg-10">
            <div class="card shadow-sm border-0">
                <div class="card-header bg-dark text-white fw-bold">
                    INGRESOS PENDIENTES DE ANULACION
                </div>
                <div class="card-body">
                    <div class="table-responsive">
                        <table class="table table-bordered table-hover table-sm align-middle">
                            <thead>
                                <tr>
                                    <th class="text-center">ITEM</th>
                                    <th class="text-center">SERIE-NUMERO</th>
                                    <th class="text-center">CODIGO</th>
                                    <th>MOTIVO DE ANULACION</th>
                                    <th class="text-center">ACCION</th>
                                </tr>
                            </thead>
                            <tbody>
                                @forelse($items as $it)
                                    <tr>
                                        <td class="text-center">{{ $loop->iteration }}</td>
                                        <td class="text-center">{{ $it->serie }}-{{ $it->numero }}</td>
                                        <td class="text-center">{{ $it->codigo }}</td>
                                        <td>{{ $it->motivo_anulacion }}</td>
                                        <td class="text-center">
                                            <a href="{{ route('admin.ingreso-anular.edit', $it->id) }}" class="btn btn-sm btn-outline-danger" title="Autorizar anulacion">
                                                <i class="fas fa-ban"></i>
                                            </a>
                                        </td>
                                    </tr>
                                @empty
                                    <tr>
                                        <td colspan="5" class="text-center text-muted">No hay ingresos pendientes de anulacion.</td>
                                    </tr>
                                @endforelse
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection
