84 lines
4.6 KiB
PHP
84 lines
4.6 KiB
PHP
<x-layout title="Historial de Ventas">
|
|
|
|
<x-section-header subtitle="Finanzas" title="Historial de " highlight="Ventas" />
|
|
|
|
<!-- Barra de Herramientas -->
|
|
<div class="w-full flex justify-between items-center mb-6">
|
|
<!-- Buscador simple (opcional visualmente, funcionalidad futura) -->
|
|
<div class="relative w-1/3">
|
|
<input type="text" placeholder="Buscar por N° Venta o Cliente..." class="bg-neutral-800 border border-neutral-700 text-white text-sm rounded-lg focus:ring-neon-lime focus:border-neon-lime block w-full p-2.5">
|
|
</div>
|
|
|
|
<!-- Botón Nueva Venta -->
|
|
<a href="{{ route('sales.create') }}" class="px-5 py-2.5 bg-neon-lime text-neutral-900 font-bold rounded-lg hover:bg-[#b3e600] transition-colors shadow-lg shadow-neon-lime/20 flex items-center gap-2">
|
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"></path></svg>
|
|
Registrar Venta
|
|
</a>
|
|
</div>
|
|
|
|
<!-- Tabla de Ventas -->
|
|
<div class="relative overflow-x-auto shadow-md sm:rounded-lg border border-neutral-800 bg-panel-bg">
|
|
<table class="w-full text-sm text-left text-gray-400">
|
|
<thead class="text-xs text-gray-300 uppercase bg-neutral-800 border-b border-neutral-700">
|
|
<tr>
|
|
<th scope="col" class="px-6 py-3"># Ref</th>
|
|
<th scope="col" class="px-6 py-3">Fecha</th>
|
|
<th scope="col" class="px-6 py-3">Cliente</th>
|
|
<th scope="col" class="px-6 py-3">Método Pago</th>
|
|
<th scope="col" class="px-6 py-3 text-right">Total</th>
|
|
<th scope="col" class="px-6 py-3 text-center">Acciones</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@forelse($sales as $sale)
|
|
<tr class="bg-transparent border-b border-neutral-800 hover:bg-neutral-800/50 transition-colors">
|
|
<td class="px-6 py-4 font-mono text-neon-lime font-bold">
|
|
#{{ str_pad($sale->id, 5, '0', STR_PAD_LEFT) }}
|
|
</td>
|
|
<td class="px-6 py-4">
|
|
<div class="text-white">{{ $sale->created_at->format('d/m/Y') }}</div>
|
|
<div class="text-xs text-gray-600">{{ $sale->created_at->format('H:i') }} hs</div>
|
|
</td>
|
|
<td class="px-6 py-4">
|
|
@if($sale->client)
|
|
<div class="text-white font-medium">{{ $sale->client->name }}</div>
|
|
<div class="text-xs text-gray-500">Cli. Registrado</div>
|
|
@else
|
|
<span class="text-gray-500 italic">Consumidor Final</span>
|
|
@endif
|
|
</td>
|
|
<td class="px-6 py-4">
|
|
<span class="bg-neutral-700 text-gray-300 text-xs font-medium px-2.5 py-0.5 rounded border border-neutral-600">
|
|
{{ $sale->payment_method }}
|
|
</span>
|
|
</td>
|
|
<td class="px-6 py-4 text-right font-bold text-white text-base">
|
|
${{ number_format($sale->total, 2, ',', '.') }}
|
|
</td>
|
|
<td class="px-6 py-4 text-center">
|
|
<button class="text-blue-400 hover:text-blue-300 font-medium text-sm transition-colors">
|
|
Ver Detalle
|
|
</button>
|
|
</td>
|
|
</tr>
|
|
@empty
|
|
<tr>
|
|
<td colspan="6" class="px-6 py-12 text-center">
|
|
<div class="flex flex-col items-center justify-center">
|
|
<svg class="w-12 h-12 text-gray-600 mb-3" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg>
|
|
<p class="text-gray-400 text-lg">No hay ventas registradas aún.</p>
|
|
<p class="text-gray-600 text-sm">Realiza tu primera venta desde el botón verde.</p>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
@endforelse
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<!-- Paginación -->
|
|
<div class="mt-4 w-full flex justify-center">
|
|
{{ $sales->links() }}
|
|
</div>
|
|
|
|
</x-layout> |