feat(tickets): add PDF and Excel export endpoints
This commit is contained in:
78
resources/views/pdf/adminapp/tickets.blade.php
Normal file
78
resources/views/pdf/adminapp/tickets.blade.php
Normal file
@@ -0,0 +1,78 @@
|
||||
<!doctype html>
|
||||
<html lang="es">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<style>
|
||||
@page { margin: 28px 34px 58px; }
|
||||
body { color: #17211b; font-family: DejaVu Sans, sans-serif; font-size: 8px; margin: 0; }
|
||||
h1 { font-size: 21px; margin: 0 0 3px; }
|
||||
.subtitle { color: #66736b; margin: 0 0 15px; }
|
||||
.summary { background: #eef5f1; border-left: 4px solid #198754; margin-bottom: 14px; padding: 8px 11px; }
|
||||
.summary strong { font-size: 12px; }
|
||||
table { border-collapse: collapse; table-layout: fixed; width: 100%; }
|
||||
thead { display: table-header-group; }
|
||||
tr { page-break-inside: avoid; }
|
||||
th { background: #26382e; color: #fff; font-size: 7px; letter-spacing: .25px; padding: 6px 5px; text-align: left; text-transform: uppercase; }
|
||||
td { border-bottom: 1px solid #dfe7e2; overflow-wrap: break-word; padding: 6px 5px; vertical-align: top; }
|
||||
tbody tr:nth-child(even) { background: #f7f9f8; }
|
||||
.number { text-align: right; }
|
||||
.ticket-id { font-size: 6.8px; word-break: break-all; }
|
||||
.empty { color: #66736b; padding: 24px; text-align: center; }
|
||||
.order { width: 7%; }
|
||||
.category { width: 9%; }
|
||||
.product { width: 10%; }
|
||||
.type { width: 9%; }
|
||||
.amount { width: 8%; }
|
||||
.client { width: 14%; }
|
||||
.identifier { width: 17%; }
|
||||
.date { width: 10%; }
|
||||
.status { width: 7%; }
|
||||
.scanner { width: 9%; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Listado de tickets</h1>
|
||||
<p class="subtitle">{{ $tenant->nombre }} · Generado el {{ $generatedAt->copy()->timezone($timeZone)->format('d/m/Y H:i') }}</p>
|
||||
|
||||
<div class="summary">
|
||||
Tickets incluidos: <strong>{{ $tickets->count() }}</strong>
|
||||
·
|
||||
Escaneados: <strong>{{ $tickets->where('status', 'Usado')->count() }}</strong>
|
||||
</div>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="order">N° de orden</th>
|
||||
<th class="category">Categoría</th>
|
||||
<th class="product">Producto</th>
|
||||
<th class="type">Tipo</th>
|
||||
<th class="amount number">Importe</th>
|
||||
<th class="client">Cliente</th>
|
||||
<th class="identifier">ID</th>
|
||||
<th class="date">Fecha</th>
|
||||
<th class="status">Estado</th>
|
||||
<th class="scanner">Escaneado por</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@forelse ($tickets as $ticket)
|
||||
<tr>
|
||||
<td>{{ $ticket['order_number'] === null ? '-' : '#'.$ticket['order_number'] }}</td>
|
||||
<td>{{ $ticket['category'] }}</td>
|
||||
<td>{{ $ticket['product'] }}</td>
|
||||
<td>{{ $ticket['type'] }}</td>
|
||||
<td class="number">{{ $ticket['amount'] === null ? '-' : '$'.number_format($ticket['amount'], 2, ',', '.') }}</td>
|
||||
<td>{{ $ticket['client'] }}</td>
|
||||
<td class="ticket-id">{{ $ticket['ticket'] }}</td>
|
||||
<td>{{ $ticket['date']?->copy()->timezone($timeZone)->format('d/m/Y H:i') ?? '-' }}</td>
|
||||
<td>{{ $ticket['status'] }}</td>
|
||||
<td>{{ $ticket['scanned_by'] }}</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr><td class="empty" colspan="10">No hay tickets para los criterios seleccionados.</td></tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user