This commit is contained in:
Juan Felipe Duarte
2025-07-31 15:19:22 -07:00
parent ca5fbd454a
commit c7586cf6cd
13 changed files with 215 additions and 34 deletions
+3 -2
View File
@@ -112,7 +112,7 @@
<li class="flex align-center flex-col">
<h4 @click="selected !== 0 ? selected = 0 : selected = null" class="cursor-pointer px-5 py-3 bg-[#b221fd] text-white text-center inline-block hover:bg-[#7a02b8] hover:shadow rounded-lg">
@if (auth()->user()->rol->nombre == 'super' || auth()->user()->rol->nombre == 'administrador' || auth()->user()->rol->nombre == 'editor')
Admin
@else
Subvendedor
@@ -124,6 +124,7 @@
@if (auth()->user()->subvendedor)
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('roles') }}">Gestión Roles</a>
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('usuarios') }}">Gestión Usuarios</a>
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('usuarios') }}">Log Comisiones</a>
@if ( auth()->user()->rol->nombre != 'super')
<a class="block cursor-pointer text-center hover:bg-[#d1d3e1] border-b w-full px-3 py-1" href="{{ route('tarifas') }}">Gestión Tarifas</a>
@endif
@@ -346,4 +347,4 @@
</form>
</div>
</div>
</div>
</div>
@@ -0,0 +1,55 @@
<div class="p-6 max-w-7xl mx-auto">
<!-- Encabezado -->
<div class="flex items-center justify-between mb-6">
<h2 class="text-2xl font-semibold text-gray-800">Log comisiones</h2>
</div>
<!-- Input de búsqueda -->
{{-- <div class="mb-4">
<input type="text" wire:model.debounce.300ms="search" placeholder="" class="w-full px-4 py-2 border border-gray-300 rounded-xl shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-400 focus:border-transparent transition" />
</div> --}}
<!-- Tabla de datos -->
<div class="overflow-hidden rounded-xl shadow-md border border-gray-200 bg-white">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-50">
<tr>
<th class="px-6 py-3 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">Compra</th>
<th class="px-6 py-3 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">Valor</th>
<th class="px-6 py-3 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">Utilidad</th>
<th class="px-6 py-3 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">Vendedor</th>
<th class="px-6 py-3 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">Servicio</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-100">
@forelse($consultaLogs as $log)
<tr class="hover:bg-gray-50 transition">
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-700">{{ \Carbon\Carbon::parse($log?->historial?->created_at ?? now())->format('y/m/d h:i a') }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-gray-900">{{ $log?->historial?->valor ?? 'N/A' }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-700">{{ $log?->historial?->utilidad ?? 'N/A' }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-700">{{ $log?->user?->name ?? 'N/A' }} - {{ $log?->user?->email ?? 'N/A' }}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-700">
@if (!empty($log?->historial?->promocion_id))
{{ $log?->historial?->promocion?->nombre ?? 'Sin promoción' }}
@elseif(!empty($log?->historial?->tarifa_id))
@if (empty($log?->historial?->tarifa?->servicio?->por_tiempo))
{{ $log?->historial?->tarifa?->pantallas ?? 'N/A' }} P. de
@endif
{{ $log?->historial?->tarifa?->servicio?->nombre ?? 'Sin nombre' }} - {{ $log?->historial?->tarifa?->dias ?? 'N/A' }} d.
@endif
</td>
</tr>
@empty
<tr>
<td colspan="5" class="px-6 py-4 text-center text-sm text-gray-500">No se encontraron resultados.</td>
</tr>
@endforelse
</tbody>
</table>
</div>
<!-- Paginación -->
<div class="mt-4">
{{-- {{ $productos->links() }} --}}
</div>
</div>
@@ -0,0 +1,3 @@
<x-app-layout>
<livewire:show-log-comisiones />
</x-app-layout>
+2 -2
View File
@@ -1,3 +1,3 @@
<x-app-layout>
<livewire:show-logs />
</x-app-layout>
<livewire:show-logs />
</x-app-layout>