@extends('layouts.carpinteria') @section('title', 'Detalle ' . $quote->quote_number) @section('header_title', 'Detalle de Cotización ' . $quote->quote_number) @section('content') @php $sym = $settings->currency_symbol ?? '$'; $clientDisplayName = $customer->name ?? ($quote->client_name ?? 'Cliente general'); $clientRif = $customer->rif ?? ($quote->customer_rif ?? null); $clientPhone = $customer->mobile ?? ($quote->client_phone ?? null); @endphp

{{ $quote->quote_number }} — {{ $clientDisplayName }}

@if($clientRif) RIF: {{ $clientRif }} · @endif Teléfono: {{ $clientPhone ?: 'No registrado' }} · Estado: {{ strtoupper($quote->status) }}
Editar Cotización Volver al listado
@if($quote->notes)

Notas: {{ $quote->notes }}

@endif

Muebles Incluidos ({{ $items->count() }})

@foreach($items as $it) @php $baseMode = $it->base_coating_mode ?? 'requires_coating'; @endphp @endforeach
Mueble Plantilla / Material Base / Recubrimiento Medidas (cm) Distribución Herrajes Láminas Subtotal Total
{{ $it->item_label }} {{ $it->template_name }}
Base: {{ $it->material_name }} ({{ $it->thickness_mm }}mm)
@if(!empty($it->coating_material_name) && $baseMode === 'requires_coating') Recubrimiento: {{ $it->coating_material_name }} @if(!empty($it->coating_coverage_factor)) ({{ $it->coating_coverage_factor }}x) @endif @elseif($baseMode === 'precoated_edges_only') Recubrimiento: Pre-recubierto de fábrica @else Recubrimiento: No aplica / Sin recubrimiento @endif
{{ $it->width_cm }} × {{ $it->height_cm }} × {{ $it->depth_cm }} {{ $it->levels }} niv. · {{ $it->divisions ?? 0 }} div. · {{ $it->doors }} ptas. · {{ $it->drawers }} caj. @php $assignedIds = array_filter([ $it->drawer_hardware_id ?? null, $it->door_hardware_id ?? null, $it->level_hardware_id ?? null, ]); @endphp @if(empty($assignedIds)) Sin herrajes asignados @else
@foreach($assignedIds as $hwId) @php $hw = $hardwareItems[$hwId] ?? null; @endphp @if($hw)
@if(!empty($hw->image_url)) {{ $hw->name }} @else Sin img @endif {{ $hw->name }}
{{ $sym }}{{ number_format($hw->unit_cost, 2) }} / {{ $hw->unit_label }}
@endif @endforeach
@endif
{{ $it->sheets_needed }} {{ $sym }}{{ number_format($it->subtotal, 2) }} {{ $sym }}{{ number_format($it->total_amount, 2) }}
Materiales (base y recubrimiento):{{ $sym }}{{ number_format($quote->materials_cost, 2) }}
Mano de obra ({{ $quote->estimated_hours }} h):{{ $sym }}{{ number_format($quote->labor_cost, 2) }}
Cantos, insumos y herrajes:{{ $sym }}{{ number_format($quote->extras_cost, 2) }}
Utilidad:{{ $sym }}{{ number_format($quote->profit_amount, 2) }}
Total General:{{ $sym }}{{ number_format($quote->total_amount, 2) }}
@endsection