@extends('templates.adminlte') @section('content-header')

Evento

@endsection @section('main-content') @php $eventDate = \Carbon\Carbon::parse($event->event_date, 'America/Mexico_City'); $formatCurrency = fn($amount) => '$' . number_format((float) $amount, 2); $statusLabel = $eventDate->isPast() ? 'Finalizado' : ($eventDate->isToday() ? 'Hoy' : 'Programado'); $roleLabels = [ 1 => 'Producto', 2 => 'Material', 3 => 'Producto paquete', ]; $packageDuration = $event->packages->pluck('duration')->filter()->implode(' · '); $packageUnits = (int) $event->packages->sum(fn($package) => max((int) ($package->pivot->quantity ?? 1), 1)); $packageMeta = $event->is_custom_event ? 'Paquete personalizado' : ($packageUnits > 1 ? $packageUnits . ' paquetes registrados' : 'Paquete registrado'); $packageSummary = $packageDuration !== '' ? $packageMeta . ' • ' . $packageDuration : ($event->is_custom_event ? $packageMeta . ' • ' . $event->products->count() . ' productos programados' : $packageMeta . ' • Duración no registrada'); $discountValue = (float) $event->discount; $discountLabel = 'Descuento aplicado'; $quoteDateLabel = filled($event->date) ? \Carbon\Carbon::parse($event->date, 'America/Mexico_City')->locale('es')->isoFormat('D MMM YYYY') : 'Sin fecha de cotización'; $createdAtLabel = $event->created_at ? $event->created_at->copy()->locale('es')->isoFormat('D MMM YYYY, HH:mm') : 'Sin registro'; $crewCount = $event->employees->count(); $productCount = $event->products->count(); $equipmentCount = $event->equipments->count(); $packageBadgeClass = $event->is_custom_event ? 'border-secondary/30 bg-secondary/10 text-secondary' : 'border-accent/30 bg-accent/10 text-accent'; if ($discountValue > 0 && $discountValue <= 1) { $discountLabel .= ' (' . number_format($discountValue * 100, 0) . '%)'; } if ($statusLabel === 'Hoy') { $statusBadgeClass = 'border-warning/30 bg-warning/10 text-warning'; $statusDotClass = 'bg-warning'; } elseif ($statusLabel === 'Finalizado') { $statusBadgeClass = 'border-primary-600/60 bg-primary-700/70 text-primary-100'; $statusDotClass = 'bg-primary-200'; } else { $statusBadgeClass = 'border-accent/30 bg-accent/10 text-accent'; $statusDotClass = 'bg-accent'; } @endphp
{{ $event->event_code }} {{ $statusLabel }} {{ $event->is_custom_event ? 'Personalizado' : 'Registrado' }}

Detalle Operativo

{{ $event->client_name ?: 'Cliente sin registrar' }}

{{ $event->event_type }}. {{ $event->package_label }}. {{ $event->notes ?: 'Sin observaciones logísticas registradas para este servicio.' }}

calendar_month {{ $event->event_day_label }}
schedule {{ $event->event_time_label }}
location_on {{ $event->event_address ?: 'Ubicación pendiente' }}
call {{ $event->phone ?: 'Sin teléfono' }}

Total evento

{{ $formatCurrency($event->total_amount) }}

Anticipo

{{ $formatCurrency($event->advance_amount) }}

Saldo pendiente

{{ $formatCurrency($event->balance) }}

info

Informacion General

Cliente y logistica

Datos del cliente

Nombre

{{ $event->client_name ?: 'Sin nombre' }}

Telefono

{{ $event->phone ?: 'Sin telefono' }}

Direccion

{{ $event->client_address ?: 'Sin direccion registrada' }}

Operacion del evento

Ubicacion

{{ $event->event_address ?: 'Pendiente' }}

Hora operativa

{{ $event->event_time_label }}

Observaciones

{{ $event->notes ?: 'Sin observaciones logísticas registradas.' }}

Inventario Programado

Productos del evento

@forelse ($event->products as $product) @php $descriptor = collect([ $product->caliber ? $product->caliber . '"' : null, $product->shots ? $product->shots . ' tiros' : null, $product->shape ?: null, $product->unit ?: null, ]) ->filter() ->implode(' · '); $quantity = (int) ($product->pivot->quantity ?? 0); $observations = $product->description ?: ($descriptor !== '' ? $descriptor : 'Sin observaciones registradas.'); @endphp @empty @endforelse
Producto Categoria Prog. Usado Obs.

{{ $product->name }}

{{ $roleLabels[$product->product_role_id] ?? 'Producto' }} {{ $quantity }} {{ $product->unit ?: 'pz' }} -- {{ $observations }}
Este evento no tiene productos programados.
account_balance_wallet

Liquidacion

Cobro pendiente

Subtotal paquete {{ $formatCurrency($event->full_price) }}
Viaticos / traslado {{ $formatCurrency($event->travel_expenses_amount) }}
{{ $discountLabel }} {{ $event->discount_amount > 0 ? '-' . $formatCurrency($event->discount_amount) : $formatCurrency(0) }}
Total final {{ $formatCurrency($event->total_amount) }}
Anticipo pagado {{ $event->advance_amount > 0 ? '-' . $formatCurrency($event->advance_amount) : $formatCurrency(0) }}

Saldo a cobrar

{{ $formatCurrency($event->balance) }}

contactless

Cobrar en evento: {{ $event->balance > 0 ? 'SI' : 'NO' }}

Configuracion Show

workspace_premium

{{ $event->package_label }}

{{ $packageSummary }}

Productos

{{ $productCount }}

Equipo

{{ $crewCount }}

Equipamiento

{{ $equipmentCount }}

Staff Asignado

@forelse ($event->employees as $employee) @php $employeeName = $employee->user->name ?? ($employee->name ?? 'Empleado sin nombre'); $employeePhone = $employee->user->phone ?? ($employee->phone ?? null); $employeePhoto = $employee->photo ?? null; if ($employeePhoto && !preg_match('/^https?:\/\//', $employeePhoto)) { $employeePhoto = asset($employeePhoto); } if (!$employeePhoto) { $employeePhoto = 'https://lh3.googleusercontent.com/aida-public/AB6AXuC90cd4RGzirkrgu-fQUOzz68c6LmczKYRfg42rz5aUDkjfqEGpQ_AEZ4DjCtFE4ibGh-9lHbdCUDHWhlrqfSQnLKNfvxdNosSiHicBkve5D8U1JEwvIN4C0UkHhQwK1qsLtPQ9VFgziurtVGwfza3NajwOejBaAo5n4WWenJRy_59t0WLFsklFWvvcvYbMBL8OJ0dke3bJab3aWJgUeodehmnVUY4dzErxlIFkVp5IudDmOYNhTq8QXLwH4VeVh1pFft_IGAKMUK0'; } @endphp
{{ $employeeName }}

{{ $employeeName }}

{{ $loop->first ? 'Responsable' : 'Staff' }} Nivel: {{ $employee->experienceLevel->name ?? 'Sin nivel' }}
@if ($employeePhone) call @else
call
@endif
@empty
Este evento no tiene staff asignado.
@endforelse

Historial

check

{{ $statusLabel }}

{{ $event->event_datetime_label }}

payments

{{ $event->advance_amount > 0 ? 'Anticipo registrado' : 'Anticipo pendiente' }}

{{ $event->advance_amount > 0 ? $formatCurrency($event->advance_amount) : 'Sin anticipo capturado' }}

description

{{ $event->reminder_send_date ? 'Recordatorio programado' : 'Cotizacion generada' }}

{{ $event->reminder_send_date ? \Carbon\Carbon::parse($event->reminder_send_date, 'America/Mexico_City')->locale('es')->isoFormat('D MMM YYYY, HH:mm') : $quoteDateLabel }}

add

Creado

{{ $createdAtLabel }}

@endsection