@extends('layouts.app')

@section('title', 'Autorizar Anulacion de Egresos')

@section('content')
<style>
    .panel {
        background: #fff;
        border: 1px solid #d9dee3;
        border-radius: 6px;
        margin-bottom: 20px;
        overflow: hidden;
    }

    .panel-primary {
        border-color: #374c62;
    }

    .panel-primary > .panel-heading {
        background: #374c62;
        color: #fff;
        padding: 12px 15px;
        font-weight: 700;
        font-size: 15px;
    }

    .panel-body {
        padding: 18px;
    }

    thead th,
    tbody td {
        vertical-align: middle;
        text-align: center;
    }
</style>

<div class="container">
    <div class="row justify-content-center">
        <div class="col-lg-10">
            <div class="panel panel-primary shadow-sm">
                <div class="panel-heading">LISTA DE EGRESOS POR ANULAR</div>

                <div class="panel-body">
                    <div class="table-responsive">
                        <table class="table table-bordered table-hover table-sm" style="font-size: 12px;">
                            <thead>
                                <tr>
                                    <th>ITEM</th>
                                    <th>FECHA</th>
                                    <th>SERIE-NUMERO</th>
                                    <th>CODIGO</th>
                                    <th>MOTIVO DE ANULACION</th>
                                    <th>ACCION</th>
                                </tr>
                            </thead>
                            <tbody>
                                @forelse($items as $item)
                                    <tr>
                                        <td>{{ $loop->iteration }}</td>
                                        <td>{{ \Carbon\Carbon::parse($item->fecha_movimiento)->format('d-m-Y') }}</td>
                                        <td>{{ $item->serie }}-{{ $item->numero }}</td>
                                        <td>{{ $item->codigo }}</td>
                                        <td class="text-start">{{ $item->motivo_anulacion }}</td>
                                        <td>
                                            <a href="{{ route('admin.salida-anular.edit', $item->id) }}" class="btn btn-sm btn-danger">
                                                <i class="fas fa-ban me-1"></i>Autorizar
                                            </a>
                                        </td>
                                    </tr>
                                @empty
                                    <tr>
                                        <td colspan="6">No existen egresos pendientes de anulacion.</td>
                                    </tr>
                                @endforelse
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
@endsection
