@extends('layouts.app', ['title' => 'Proyecto · '.$project->name]) @section('header_actions') Proyectos @endsection @section('content') @if($project->logo_path)
Logo {{ $project->name }}
{{ $project->name }}
Logotipo activo. Se usa en tarjetas de vinculación y en la Portada de contratos. Recomendado para portada: 1600 x 1200 px (4:3), PNG/JPG/SVG con fondo blanco o transparente.
INE depositario: {{ $project->depositario_ine_front_path ? 'frente cargado' : 'frente pendiente' }} · {{ $project->depositario_ine_back_path ? 'reverso cargado' : 'reverso pendiente' }}
@endif @php $manzanas = $project->manzanaList ?? collect(); $allLotes = $manzanas->flatMap(fn ($m) => $m->loteList ?? collect()); $totalLotes = $allLotes->count(); $disponibles = $allLotes->where('estado', 'Disponible')->count(); $apartados = $allLotes->where('estado', 'Apartado')->count(); $vendidos = $allLotes->where('estado', 'Vendido')->count(); $valorTotal = (float) $allLotes->sum(fn ($l) => (float) ($l->precio ?? 0)); $estadoBadge = fn ($e) => $e === 'Vendido' ? 'blue' : ($e === 'Apartado' ? 'amber' : 'green'); @endphp
Proyectos {{ $project->name }} Manzanas y lotes
{{ $project->name }}
{{ $project->location ?: 'Sin ubicación' }}{{ $project->depositario_nombre ? ' · Dep.: '.$project->depositario_nombre : '' }}
{{ $manzanas->count() }}
Manzanas
{{ $totalLotes }}
Lotes
${{ number_format($valorTotal,0) }}
Valor de lotes
{{ $disponibles }}
Disponibles
{{ $apartados }}
Apartados
{{ $vendidos }}
Vendidos
{{ $totalLotes ? round(($vendidos / $totalLotes) * 100) : 0 }}%
Avance de venta
@forelse($manzanas as $manzana)
Manzana {{ $manzana->nombre }}
{{ $manzana->loteList->count() }} lote(s){{ $manzana->notas ? ' · '.$manzana->notas : '' }}
@csrf @method('DELETE')
@if($manzana->loteList->count())
@foreach($manzana->loteList as $lote) @endforeach
Lote Medidas Uso Precio Estado Acciones
{{ $lote->numero }}@if($lote->notas)
{{ $lote->notas }}
@endif
{{ $lote->superficie_m2 ? number_format((float) $lote->superficie_m2, 2).' m²' : '—' }} @if($lote->frente || $lote->fondo)
{{ $lote->frente ?: '—' }} × {{ $lote->fondo ?: '—' }} m{{ $lote->orientacion ? ' · '.$lote->orientacion : '' }}
@endif
{{ $lote->uso_suelo ?: '—' }} ${{ number_format((float) $lote->precio, 2) }} {{ $lote->estado }}
@csrf @method('DELETE')
@else
Esta manzana aún no tiene lotes.
@endif
@empty
Este proyecto no tiene manzanas. Crea la primera manzana y luego agrega sus lotes.
@endforelse @endsection @php $maxManzanasProyecto = max(1, min(26, (int) ($project->manzanas ?? 1))); $letrasPermitidas = collect(range('A', chr(ord('A') + $maxManzanasProyecto - 1))); $letrasUsadas = $manzanas->pluck('letra')->filter()->map(fn($l) => mb_strtoupper((string) $l))->values(); $letrasDisponibles = $letrasPermitidas->reject(fn($l) => $letrasUsadas->contains($l))->values(); @endphp @section('modals') @foreach($manzanas as $manzana) @foreach($manzana->loteList as $lote) @endforeach @endforeach @endsection @push('scripts') @endpush