@extends('layouts.app') @section('title', 'Reporte de Ajustes de Precios') @section('content')
Ajustes de precios realizados en el sistema
{{ $printData['company_info']['address'] ?? 'Dirección de la empresa' }}
Tel: {{ $printData['company_info']['phone'] ?? 'Teléfono' }} | Email: {{ $printData['company_info']['email'] ?? 'email@empresa.com' }}
Fecha de Generación: {{ now()->format('d/m/Y H:i:s') }}
Generado por: {{ Auth::user()->name }}
Total de Registros: {{ $data->count() }}
Papel: {{ $printConfig->paper_size_formatted }}
Orientación: {{ $printConfig->orientation_formatted }}
Fuente: {{ $printConfig->font_config['family'] ?? 'Arial' }} {{ $printConfig->font_config['size'] ?? 12 }}pt
| 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 |
||||||||
| 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' }} |