@extends('layouts.app') @section('title', 'Reporte de Ajustes de Precios') @section('content')

Reporte de Ajustes de Precios

Ajustes de precios realizados en el sistema

Volver
@if($printData['company_info'])

{{ $printData['company_info']['name'] ?? 'Mi Empresa' }}

{{ $printData['company_info']['address'] ?? 'Dirección de la empresa' }}

Tel: {{ $printData['company_info']['phone'] ?? 'Teléfono' }} | Email: {{ $printData['company_info']['email'] ?? 'email@empresa.com' }}


@endif
Información del Reporte

Fecha de Generación: {{ now()->format('d/m/Y H:i:s') }}

Generado por: {{ Auth::user()->name }}

Total de Registros: {{ $data->count() }}

Configuración de Impresión

Papel: {{ $printConfig->paper_size_formatted }}

Orientación: {{ $printConfig->orientation_formatted }}

Fuente: {{ $printConfig->font_config['family'] ?? 'Arial' }} {{ $printConfig->font_config['size'] ?? 12 }}pt

Lista de Ajustes de Precios
@forelse($data as $adjustment) @empty @endforelse
ID Fecha Usuario Estado Total Productos Total Cambios Pregunta Matemática Respuesta Observaciones
{{ $adjustment->id }} {{ $adjustment->created_at->format('d/m/Y H:i') }} {{ $adjustment->user->name ?? 'N/A' }}
{{ $adjustment->user->email ?? '' }}
@php $status = $adjustment->status ?? 'pendiente'; $badgeClass = match($status) { 'completado' => 'bg-success', 'en_progreso' => 'bg-info', 'pendiente' => 'bg-warning', 'cancelado' => 'bg-danger', default => 'bg-secondary' }; @endphp {{ ucfirst($status) }} {{ $adjustment->total_products ?? 0 }}
productos
{{ $adjustment->total_price_changes ?? 0 }}
cambios
@if($adjustment->math_question) {{ $adjustment->math_question }} @else - @endif @if($adjustment->math_answer) {{ $adjustment->math_answer }} @else - @endif @if($adjustment->observations) {{ Str::limit($adjustment->observations, 50) }} @else Sin observaciones @endif

No hay ajustes de precios registrados

@if($data->count() > 0)
Detalle de Productos por Ajuste
@foreach($data as $adjustment) @if($adjustment->details && $adjustment->details->count() > 0)
Ajuste #{{ $adjustment->id }} {{ $adjustment->details->count() }} productos {{ $adjustment->created_at->format('d/m/Y H:i') }}
@foreach($adjustment->details as $detail) @endforeach
Producto Código Precio Básico Precio Intermedio Precio Premium Cambios
{{ $detail->product->name ?? 'Producto eliminado' }} {{ $detail->product->code ?? 'N/A' }} @php $basicoBefore = $detail->prices_before['unit_1_con_impuesto_1'] ?? 0; $basicoAfter = $detail->prices_after['unit_1_con_impuesto_1'] ?? 0; $basicoChange = $basicoAfter - $basicoBefore; $basicoClass = $basicoChange > 0 ? 'text-success' : ($basicoChange < 0 ? 'text-danger' : 'text-muted'); @endphp
Antes: ${{ number_format($basicoBefore, 2) }}
Después: ${{ number_format($basicoAfter, 2) }}
@php $intermedioBefore = $detail->prices_before['unit_1_con_impuesto_2'] ?? 0; $intermedioAfter = $detail->prices_after['unit_1_con_impuesto_2'] ?? 0; $intermedioChange = $intermedioAfter - $intermedioBefore; $intermedioClass = $intermedioChange > 0 ? 'text-success' : ($intermedioChange < 0 ? 'text-danger' : 'text-muted'); @endphp
Antes: ${{ number_format($intermedioBefore, 2) }}
Después: ${{ number_format($intermedioAfter, 2) }}
@php $premiumBefore = $detail->prices_before['unit_1_con_impuesto_3'] ?? 0; $premiumAfter = $detail->prices_after['unit_1_con_impuesto_3'] ?? 0; $premiumChange = $premiumAfter - $premiumBefore; $premiumClass = $premiumChange > 0 ? 'text-success' : ($premiumChange < 0 ? 'text-danger' : 'text-muted'); @endphp
Antes: ${{ number_format($premiumBefore, 2) }}
Después: ${{ number_format($premiumAfter, 2) }}
{{ $detail->price_changes_summary ?? 'Sin cambios' }}
@endif @endforeach
@endif @if($data->count() > 0)
Total Ajustes
{{ $data->count() }}
Completados
{{ $data->where('status', 'completado')->count() }}
Total Productos
{{ $data->sum('total_products') }}
Total Cambios
{{ $data->sum('total_price_changes') }}
@endif

Reporte generado el {{ now()->format('d/m/Y H:i:s') }} por {{ Auth::user()->name }} | Página 1 de 1
@endsection @push('styles') @endpush