@extends('layouts.app') @section('content') @php $count = 0; function formatCurrency(?float $amount): string { $formatter = new NumberFormatter('es_MX', NumberFormatter::CURRENCY); $formatter->setAttribute(NumberFormatter::MIN_FRACTION_DIGITS, 2); $formatter->setAttribute(NumberFormatter::MAX_FRACTION_DIGITS, 2); return $formatter->format($amount ?? 0); } function checkDateStatus($date) { $targetDate = new DateTime($date); $currentDate = new DateTime(); $difference = $currentDate->diff($targetDate); if ($currentDate >= $targetDate) { return 'text-danger'; } $daysRemaining = $difference->days; if ($daysRemaining <= 7) { return 'text-warning'; } return 'text-success'; } @endphp
Cotizaciones
@foreach ($quotes as $i => $quote) @php $count += $quote->value; @endphp @endforeach
@csrf
# Cliente/Cliente potencial Servicio Inicio Fin estimada Válido hasta Prioridad Estado Valor
{{ $i + 1 }} {{ $quote->model->name ?? '-' }} {{ $quote->service->name ?? '-' }} {{ \Carbon\Carbon::parse($quote->start_date)->translatedFormat('d-m-Y') }} {{ \Carbon\Carbon::parse($quote->end_date)->translatedFormat('d-m-Y') }} {{ \Carbon\Carbon::parse($quote->valid_until)->translatedFormat('d-m-Y') }} {{ $quote->priority->label() }} {{ $quote->status->label() }} {{ formatCurrency($quote->value) }} @if (!$quote->file) Sin archivo PDF @else Archivo PDF @endif
@endsection