<div>
    @component('common.breadcrumb',['addBtn' => true,
                'permission_create' => 'Company_employee_payment_voucher_create',
                'breadcrumb_show' => $breadcrumb_show]
                )   <!-- componente de breadcrumb -->
        @slot('breadcrumb_title')
            <h3>{{ $componentName }} | {{ $pageTitle }}</h3>
        @endslot
        <li class="breadcrumb-item">Empleado</li>
        <li class="breadcrumb-item active">Desprendibles de Pago
        @slot('buttons_extras')
        @can('Company_employee_psychotechnics_test_create')
            <li>
                <a href="javascript:void(0)" wire:click.prevent="openAddPV()"
                    class="btn btn-square btn-primary txt-white" >
                    Agregar <i class="fa fa-plus"></i>
                </a>
            </li>
        @endcan
        @endslot
    @endcomponent
    @include('common.searchbox')
    <div class="container-fluid">
        <div class="row justify-content-center">
            <div class="col-lg-4 col-md-4 col-sm-12">
                <div class="form-group">
                    <select class="form-select" wire:model="month">
                        <option value="">Todos los Meses</option>
                        @foreach (DataTypeMonth() as $key => $value)
                            <option value="{{ $key }}">{{ $value }}</option>
                        @endforeach
                    </select>
                </div>
            </div>
            <div class="col-lg-4 col-md-4 col-sm-12">
                <div class="form-group">
                    <select class="form-select" wire:model="year">
                        <option value="">Todos los Años</option>
                        @for ($i = $this->min_year; $i <= $this->max_year; $i++)
                            <option value="{{ $i }}">{{ $i }}</option>
                        @endfor
                    </select>
                </div>
            </div>
        </div><!-- row -->
        <div class="row layout-top-spacing">
            <div class="col-sm-12">
                <div class="card">
                    <div class="table-responsive">
                        <table class="table">
                            <thead class="bg-primary">
                                <tr>
                                    <th scope="col">FECHA CREACIÓN</th>
                                    <th scope="col">MES @include('common.orderby', ['column' => 'month'])</th>
                                    <th scope="col">AÑO @include('common.orderby', ['column' => 'year'])</th>
                                    <th scope="col" class="text-center">ACCIONES</th>
                                </tr>
                            </thead>
                            <tbody>
                                @foreach($payment_vouchers_user as $item)
                                    <tr>
                                        <td>{{ $item->created_at }}</td>
                                        <td>{{ DataTypeMonth($item->month) }}</td>
                                        <td>{{ $item->year }}</td>
                                        <td class="text-center">
                                            @can('Company_employee_payment_voucher_view')
                                            <a href="{{ asset('storage/users/'.$user_id.'/payment_vouchers/' . $item->support_document) }}" target="_blank"
                                                class="btn btn-outline-primary" title="Ver">
                                                <i class="fas fa-eye"></i>
                                            </a>
                                            @endcan
                                            @can('Company_employee_payment_voucher_delete')
                                            <a href="javascript:void(0)" onclick="ConfirmCV('{{ $item->id }}','PV')"
                                                class="btn btn-outline-danger " title="Eliminar">
                                                <i class="fas fa-trash"></i>
                                            </a>
                                            @endcan
                                        </td>
                                    </tr>
                                @endforeach
                            </tbody>
                        </table>
                        {{ $payment_vouchers_user->links() }}
                    </div>
                </div>
            </div>
        </div>
        @include('livewire.company.employee.detail.payment-vouchers.form')
    </div>
</div>
@include('common.scriptsCompCV', ['ComponentId' => 'PV'])
