678 lines
42 KiB
PHP
Executable File
678 lines
42 KiB
PHP
Executable File
@extends('admin.layouts.netgescon')
|
|
|
|
@section('title', 'Dettaglio Unità Immobiliare')
|
|
|
|
@section('content')
|
|
<div class="container mx-auto px-6 py-8">
|
|
<!-- Header -->
|
|
<div class="mb-8 flex items-center justify-between">
|
|
<div>
|
|
<h1 class="text-3xl font-bold text-gray-900">
|
|
<i class="fas fa-home mr-3 text-blue-600"></i>
|
|
Unità {{ $unita->codice_unita }}
|
|
</h1>
|
|
<p class="text-gray-600 mt-2">
|
|
<i class="fas fa-building mr-2"></i>
|
|
{{ $unita->stabile->denominazione ?? 'Stabile ' . $unita->stabile->id }}
|
|
@if($unita->palazzinaObj)
|
|
- Palazzina {{ $unita->palazzinaObj->codice_palazzina }}
|
|
@endif
|
|
</p>
|
|
</div>
|
|
<div class="flex space-x-3">
|
|
<a href="{{ route('admin.unita-immobiliari.edit', $unita) }}"
|
|
class="netgescon-btn netgescon-btn-primary">
|
|
<i class="fas fa-edit mr-2"></i>
|
|
Modifica
|
|
</a>
|
|
@if($unita->palazzinaObj)
|
|
<a href="{{ route('admin.palazzine.show', $unita->palazzinaObj) }}"
|
|
class="netgescon-btn netgescon-btn-secondary">
|
|
<i class="fas fa-building mr-2"></i>
|
|
Palazzina
|
|
</a>
|
|
@endif
|
|
<a href="{{ route('admin.stabili.show', $unita->stabile) }}"
|
|
class="netgescon-btn netgescon-btn-secondary">
|
|
<i class="fas fa-arrow-left mr-2"></i>
|
|
Stabile
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Statistiche Overview -->
|
|
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6 mb-8">
|
|
<!-- Superficie Totale -->
|
|
<div class="bg-blue-50 border border-blue-200 rounded-lg p-6">
|
|
<div class="flex items-center">
|
|
<div class="p-3 rounded-full bg-blue-500 text-white">
|
|
<i class="fas fa-ruler-combined"></i>
|
|
</div>
|
|
<div class="ml-4">
|
|
<p class="text-sm font-medium text-blue-600">Superficie Totale</p>
|
|
<p class="text-2xl font-bold text-blue-900">{{ $statistiche['superficie_totale'] }} m²</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Millesimi -->
|
|
<div class="bg-green-50 border border-green-200 rounded-lg p-6">
|
|
<div class="flex items-center">
|
|
<div class="p-3 rounded-full bg-green-500 text-white">
|
|
<i class="fas fa-percentage"></i>
|
|
</div>
|
|
<div class="ml-4">
|
|
<p class="text-sm font-medium text-green-600">Millesimi</p>
|
|
<p class="text-2xl font-bold text-green-900">{{ $unita->millesimi_proprieta ?? 0 }}/1000</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Rapporto Percentuale -->
|
|
<div class="bg-yellow-50 border border-yellow-200 rounded-lg p-6">
|
|
<div class="flex items-center">
|
|
<div class="p-3 rounded-full bg-yellow-500 text-white">
|
|
<i class="fas fa-chart-pie"></i>
|
|
</div>
|
|
<div class="ml-4">
|
|
<p class="text-sm font-medium text-yellow-600">Percentuale</p>
|
|
<p class="text-2xl font-bold text-yellow-900">{{ $statistiche['rapporto_millesimi'] }}%</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Valore Stimato -->
|
|
<div class="bg-purple-50 border border-purple-200 rounded-lg p-6">
|
|
<div class="flex items-center">
|
|
<div class="p-3 rounded-full bg-purple-500 text-white">
|
|
<i class="fas fa-euro-sign"></i>
|
|
</div>
|
|
<div class="ml-4">
|
|
<p class="text-sm font-medium text-purple-600">Valore Stimato</p>
|
|
<p class="text-2xl font-bold text-purple-900">€{{ number_format($statistiche['valore_stimato'], 0, ',', '.') }}</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Tabs Container -->
|
|
<div class="bg-white rounded-lg shadow-sm border">
|
|
<!-- Tab Navigation -->
|
|
<div class="border-b border-gray-200 px-6 pt-6">
|
|
<nav class="-mb-px flex space-x-8" aria-label="Tabs" role="tablist">
|
|
<button class="netgescon-tab-btn active"
|
|
data-tab="dati-generali"
|
|
role="tab">
|
|
<i class="fas fa-info-circle mr-2"></i>
|
|
Dati Generali
|
|
</button>
|
|
<button class="netgescon-tab-btn"
|
|
data-tab="posizione"
|
|
role="tab">
|
|
<i class="fas fa-map-marker-alt mr-2"></i>
|
|
Posizione
|
|
</button>
|
|
<button class="netgescon-tab-btn"
|
|
data-tab="caratteristiche"
|
|
role="tab">
|
|
<i class="fas fa-list mr-2"></i>
|
|
Caratteristiche
|
|
</button>
|
|
<button class="netgescon-tab-btn"
|
|
data-tab="unita-vicine"
|
|
role="tab">
|
|
<i class="fas fa-users mr-2"></i>
|
|
Unità Vicine
|
|
</button>
|
|
<button class="netgescon-tab-btn"
|
|
data-tab="economico"
|
|
role="tab">
|
|
<i class="fas fa-calculator mr-2"></i>
|
|
Aspetti Economici
|
|
</button>
|
|
</nav>
|
|
</div>
|
|
|
|
<!-- Tab Content -->
|
|
<div class="p-6">
|
|
<!-- Tab Dati Generali -->
|
|
<div id="dati-generali" class="netgescon-tab-content">
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
|
|
<!-- Identificazione -->
|
|
<div class="space-y-6">
|
|
<h3 class="text-lg font-semibold text-gray-900 border-b pb-2">
|
|
<i class="fas fa-id-card mr-2 text-blue-600"></i>
|
|
Identificazione
|
|
</h3>
|
|
<div class="space-y-3">
|
|
<div class="flex justify-between">
|
|
<span class="font-medium text-gray-700">Codice Unità:</span>
|
|
<span class="text-gray-900 font-mono">{{ $unita->codice_unita }}</span>
|
|
</div>
|
|
<div class="flex justify-between">
|
|
<span class="font-medium text-gray-700">Tipo Unità:</span>
|
|
<span class="text-gray-900">{{ ucfirst(str_replace('_', ' ', $unita->tipo_unita ?? 'abitazione')) }}</span>
|
|
</div>
|
|
<div class="flex justify-between">
|
|
<span class="font-medium text-gray-700">Utilizzo Attuale:</span>
|
|
<span class="text-gray-900">{{ ucfirst(str_replace('_', ' ', $unita->utilizzo_attuale ?? 'abitazione_principale')) }}</span>
|
|
</div>
|
|
<div class="flex justify-between">
|
|
<span class="font-medium text-gray-700">Stato Occupazione:</span>
|
|
<span class="px-2 py-1 rounded-full text-xs font-medium
|
|
@if($unita->stato_occupazione === 'occupata_proprietario') bg-green-100 text-green-800
|
|
@elseif($unita->stato_occupazione === 'libera') bg-blue-100 text-blue-800
|
|
@elseif($unita->stato_occupazione === 'in_vendita') bg-yellow-100 text-yellow-800
|
|
@else bg-gray-100 text-gray-800 @endif">
|
|
{{ ucfirst(str_replace('_', ' ', $unita->stato_occupazione ?? 'libera')) }}
|
|
</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Superfici -->
|
|
<div class="space-y-6">
|
|
<h3 class="text-lg font-semibold text-gray-900 border-b pb-2">
|
|
<i class="fas fa-ruler-combined mr-2 text-green-600"></i>
|
|
Superfici
|
|
</h3>
|
|
<div class="space-y-3">
|
|
<div class="flex justify-between">
|
|
<span class="font-medium text-gray-700">Superficie Commerciale:</span>
|
|
<span class="text-gray-900">{{ $unita->superficie_commerciale ?? '-' }} m²</span>
|
|
</div>
|
|
<div class="flex justify-between">
|
|
<span class="font-medium text-gray-700">Superficie Accessori:</span>
|
|
<span class="text-gray-900">{{ $unita->superficie_accessori ?? '-' }} m²</span>
|
|
</div>
|
|
<div class="flex justify-between">
|
|
<span class="font-medium text-gray-700">Superficie Scoperta:</span>
|
|
<span class="text-gray-900">{{ $unita->superficie_scoperta ?? '-' }} m²</span>
|
|
</div>
|
|
<div class="flex justify-between border-t pt-2">
|
|
<span class="font-bold text-gray-900">Superficie Totale:</span>
|
|
<span class="font-bold text-gray-900">{{ $statistiche['superficie_totale'] }} m²</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@if(isset($dirittiProprieta) || isset($relazioniPerTipo))
|
|
@php
|
|
$dirittiCollection = collect($dirittiProprieta ?? []);
|
|
$blocchiRelazioni = [
|
|
'proprietari' => ['label' => 'Proprietari e comproprietari', 'badge' => 'bg-blue-100 text-blue-800'],
|
|
'inquilini' => ['label' => 'Inquilini / Conduttori', 'badge' => 'bg-green-100 text-green-800'],
|
|
'altri' => ['label' => 'Altri soggetti collegati', 'badge' => 'bg-gray-100 text-gray-700'],
|
|
];
|
|
@endphp
|
|
|
|
<div class="mt-10 grid grid-cols-1 lg:grid-cols-2 gap-8">
|
|
<div class="space-y-4">
|
|
<div class="flex items-center justify-between">
|
|
<h3 class="text-lg font-semibold text-gray-900 flex items-center gap-2">
|
|
<i class="fas fa-user-shield text-blue-600"></i>
|
|
Diritti sull'unità
|
|
</h3>
|
|
<span class="text-xs text-gray-500">{{ $dirittiCollection->count() }} record</span>
|
|
</div>
|
|
|
|
@forelse($dirittiCollection as $diritto)
|
|
<div class="border border-gray-200 rounded-lg p-4">
|
|
<div class="flex items-start justify-between">
|
|
<div>
|
|
<p class="text-sm font-semibold text-gray-900">{{ $diritto['nome'] }}</p>
|
|
<p class="text-xs text-gray-500">{{ $diritto['tipo'] ? ucfirst(str_replace('_', ' ', $diritto['tipo'])) : 'Diritto' }}</p>
|
|
</div>
|
|
@if(!empty($diritto['codice_fiscale']))
|
|
<span class="text-xs font-mono text-gray-500">{{ $diritto['codice_fiscale'] }}</span>
|
|
@endif
|
|
</div>
|
|
<div class="mt-2 flex flex-wrap gap-2 text-xs text-gray-600">
|
|
@if(!empty($diritto['percentuale_label']))
|
|
<span class="px-2 py-0.5 bg-blue-50 border border-blue-100 rounded">Quota {{ $diritto['percentuale_label'] }}%</span>
|
|
@endif
|
|
@if(!empty($diritto['data_inizio']))
|
|
<span class="px-2 py-0.5 bg-gray-100 rounded">Dal {{ $diritto['data_inizio'] }}</span>
|
|
@endif
|
|
@if(!empty($diritto['data_fine']))
|
|
<span class="px-2 py-0.5 bg-red-100 text-red-700 rounded">Fino al {{ $diritto['data_fine'] }}</span>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
@empty
|
|
<div class="p-4 bg-gray-50 border border-gray-200 rounded">
|
|
<p class="text-sm text-gray-600">Nessun diritto registrato per questa unità.</p>
|
|
</div>
|
|
@endforelse
|
|
</div>
|
|
|
|
<div class="space-y-4">
|
|
<div class="flex items-center justify-between">
|
|
<h3 class="text-lg font-semibold text-gray-900 flex items-center gap-2">
|
|
<i class="fas fa-users text-green-600"></i>
|
|
Persone collegate
|
|
</h3>
|
|
</div>
|
|
|
|
@foreach($blocchiRelazioni as $chiave => $config)
|
|
@php($relazioniBlocco = ($relazioniPerTipo[$chiave] ?? collect())->values())
|
|
<div class="border border-gray-200 rounded-lg overflow-hidden">
|
|
<div class="px-4 py-3 border-b bg-gray-50 flex items-center justify-between">
|
|
<h4 class="text-sm font-semibold text-gray-800">{{ $config['label'] }}</h4>
|
|
<span class="px-2 py-0.5 text-xs font-medium rounded {{ $config['badge'] }}">{{ $relazioniBlocco->count() }}</span>
|
|
</div>
|
|
<div class="p-4 space-y-3">
|
|
@forelse($relazioniBlocco as $relazione)
|
|
<div class="border border-gray-100 rounded-md p-3">
|
|
<div class="flex items-start justify-between">
|
|
<div>
|
|
<p class="text-sm font-semibold text-gray-900">{{ $relazione['nome'] }}</p>
|
|
<p class="text-xs text-gray-500">{{ $relazione['tipo'] }}</p>
|
|
</div>
|
|
@if(!empty($relazione['codice_fiscale']))
|
|
<span class="text-xs font-mono text-gray-500">{{ $relazione['codice_fiscale'] }}</span>
|
|
@endif
|
|
</div>
|
|
<div class="mt-2 flex flex-wrap gap-2 text-xs text-gray-600">
|
|
@if(!empty($relazione['quota_label']))
|
|
<span class="px-2 py-0.5 bg-gray-100 rounded">Quota {{ $relazione['quota_label'] }}%</span>
|
|
@endif
|
|
@if(!empty($relazione['data_inizio']))
|
|
<span class="px-2 py-0.5 bg-gray-100 rounded">Dal {{ $relazione['data_inizio'] }}</span>
|
|
@endif
|
|
@if(!empty($relazione['data_fine']))
|
|
<span class="px-2 py-0.5 bg-yellow-100 text-yellow-700 rounded">Fino al {{ $relazione['data_fine'] }}</span>
|
|
@endif
|
|
@if(!empty($relazione['riceve_comunicazioni']))
|
|
<span class="px-2 py-0.5 bg-blue-100 text-blue-700 rounded">Comunicazioni</span>
|
|
@endif
|
|
@if(!empty($relazione['riceve_convocazioni']))
|
|
<span class="px-2 py-0.5 bg-green-100 text-green-700 rounded">Convocazioni</span>
|
|
@endif
|
|
@if(!empty($relazione['vota_assemblea']))
|
|
<span class="px-2 py-0.5 bg-purple-100 text-purple-700 rounded">Vota assemblea</span>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
@empty
|
|
<p class="text-xs text-gray-500">Nessun soggetto collegato.</p>
|
|
@endforelse
|
|
</div>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
</div>
|
|
|
|
@if(isset($relazioniStoriche) && $relazioniStoriche->count())
|
|
<div class="mt-6">
|
|
<details class="bg-gray-50 border border-gray-200 rounded-lg">
|
|
<summary class="px-4 py-3 cursor-pointer text-sm font-medium text-gray-700 flex items-center justify-between">
|
|
<span>Relazioni storiche ({{ $relazioniStoriche->count() }})</span>
|
|
<i class="fas fa-history text-gray-500"></i>
|
|
</summary>
|
|
<div class="px-4 py-3 space-y-3">
|
|
@foreach($relazioniStoriche as $storico)
|
|
<div class="border border-gray-200 rounded-md p-3 bg-white">
|
|
<div class="flex items-start justify-between">
|
|
<div>
|
|
<p class="text-sm font-semibold text-gray-900">{{ $storico['nome'] }}</p>
|
|
<p class="text-xs text-gray-500">{{ $storico['tipo'] }}</p>
|
|
</div>
|
|
@if(!empty($storico['codice_fiscale']))
|
|
<span class="text-xs font-mono text-gray-500">{{ $storico['codice_fiscale'] }}</span>
|
|
@endif
|
|
</div>
|
|
<div class="mt-2 flex flex-wrap gap-2 text-xs text-gray-600">
|
|
@if(!empty($storico['quota_label']))
|
|
<span class="px-2 py-0.5 bg-gray-100 rounded">Quota {{ $storico['quota_label'] }}%</span>
|
|
@endif
|
|
@if(!empty($storico['data_inizio']))
|
|
<span class="px-2 py-0.5 bg-gray-100 rounded">Dal {{ $storico['data_inizio'] }}</span>
|
|
@endif
|
|
@if(!empty($storico['data_fine']))
|
|
<span class="px-2 py-0.5 bg-red-100 text-red-700 rounded">Fino al {{ $storico['data_fine'] }}</span>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
</details>
|
|
</div>
|
|
@endif
|
|
@endif
|
|
</div>
|
|
|
|
<!-- Tab Posizione -->
|
|
<div id="posizione" class="netgescon-tab-content hidden">
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
|
|
<!-- Posizione Fisica -->
|
|
<div class="space-y-6">
|
|
<h3 class="text-lg font-semibold text-gray-900 border-b pb-2">
|
|
<i class="fas fa-map-marker-alt mr-2 text-blue-600"></i>
|
|
Posizione Fisica
|
|
</h3>
|
|
<div class="space-y-3">
|
|
<div class="flex justify-between">
|
|
<span class="font-medium text-gray-700">Palazzina:</span>
|
|
<span class="text-gray-900 font-mono">{{ $unita->palazzina }}</span>
|
|
</div>
|
|
<div class="flex justify-between">
|
|
<span class="font-medium text-gray-700">Scala:</span>
|
|
<span class="text-gray-900 font-mono">{{ $unita->scala }}</span>
|
|
</div>
|
|
<div class="flex justify-between">
|
|
<span class="font-medium text-gray-700">Piano:</span>
|
|
<span class="text-gray-900 font-mono">{{ $unita->piano }}</span>
|
|
</div>
|
|
<div class="flex justify-between">
|
|
<span class="font-medium text-gray-700">Interno:</span>
|
|
<span class="text-gray-900 font-mono">{{ $unita->interno }}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Dati Catastali -->
|
|
<div class="space-y-6">
|
|
<h3 class="text-lg font-semibold text-gray-900 border-b pb-2">
|
|
<i class="fas fa-map mr-2 text-green-600"></i>
|
|
Dati Catastali
|
|
</h3>
|
|
<div class="space-y-3">
|
|
<div class="flex justify-between">
|
|
<span class="font-medium text-gray-700">Foglio:</span>
|
|
<span class="text-gray-900">{{ $unita->foglio ?? '-' }}</span>
|
|
</div>
|
|
<div class="flex justify-between">
|
|
<span class="font-medium text-gray-700">Particella:</span>
|
|
<span class="text-gray-900">{{ $unita->particella ?? '-' }}</span>
|
|
</div>
|
|
<div class="flex justify-between">
|
|
<span class="font-medium text-gray-700">Subalterno:</span>
|
|
<span class="text-gray-900">{{ $unita->subalterno ?? '-' }}</span>
|
|
</div>
|
|
<div class="flex justify-between">
|
|
<span class="font-medium text-gray-700">Categoria:</span>
|
|
<span class="text-gray-900">{{ $unita->categoria_catastale ?? '-' }}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Tab Caratteristiche -->
|
|
<div id="caratteristiche" class="netgescon-tab-content hidden">
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
|
|
<!-- Caratteristiche Fisiche -->
|
|
<div class="space-y-6">
|
|
<h3 class="text-lg font-semibold text-gray-900 border-b pb-2">
|
|
<i class="fas fa-home mr-2 text-purple-600"></i>
|
|
Caratteristiche Fisiche
|
|
</h3>
|
|
<div class="space-y-3">
|
|
<div class="flex justify-between">
|
|
<span class="font-medium text-gray-700">Numero Vani:</span>
|
|
<span class="text-gray-900">{{ $unita->numero_vani ?? '-' }}</span>
|
|
</div>
|
|
<div class="flex justify-between">
|
|
<span class="font-medium text-gray-700">Numero Bagni:</span>
|
|
<span class="text-gray-900">{{ $unita->numero_bagni ?? '-' }}</span>
|
|
</div>
|
|
<div class="flex justify-between">
|
|
<span class="font-medium text-gray-700">Ha Balconi:</span>
|
|
<span class="text-gray-900">{{ $unita->ha_balconi ? 'Sì' : 'No' }}</span>
|
|
</div>
|
|
<div class="flex justify-between">
|
|
<span class="font-medium text-gray-700">Ha Terrazzo:</span>
|
|
<span class="text-gray-900">{{ $unita->ha_terrazzo ? 'Sì' : 'No' }}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Autorizzazioni -->
|
|
<div class="space-y-6">
|
|
<h3 class="text-lg font-semibold text-gray-900 border-b pb-2">
|
|
<i class="fas fa-certificate mr-2 text-orange-600"></i>
|
|
Autorizzazioni
|
|
</h3>
|
|
<div class="space-y-3">
|
|
<div class="flex justify-between">
|
|
<span class="font-medium text-gray-700">CIN:</span>
|
|
<span class="text-gray-900">{{ $unita->cin ?? '-' }}</span>
|
|
</div>
|
|
<div class="flex justify-between">
|
|
<span class="font-medium text-gray-700">Licenza Commerciale:</span>
|
|
<span class="text-gray-900">{{ $unita->licenza_commerciale ?? '-' }}</span>
|
|
</div>
|
|
<div class="flex justify-between">
|
|
<span class="font-medium text-gray-700">Autorizzazione Professionale:</span>
|
|
<span class="text-gray-900">{{ $unita->autorizzazione_professionale ?? '-' }}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Tab Unità Vicine -->
|
|
<div id="unita-vicine" class="netgescon-tab-content hidden">
|
|
<div class="space-y-6">
|
|
<h3 class="text-lg font-semibold text-gray-900 border-b pb-2 mb-6">
|
|
<i class="fas fa-users mr-2 text-blue-600"></i>
|
|
Unità Vicine (per gestione problemi tecnici)
|
|
</h3>
|
|
|
|
<div class="grid grid-cols-1 md:grid-cols-3 gap-6">
|
|
<!-- Unità Sovrastante -->
|
|
<div class="bg-blue-50 border border-blue-200 rounded-lg p-6">
|
|
<h4 class="font-medium text-blue-800 mb-4 flex items-center">
|
|
<i class="fas fa-arrow-up mr-2"></i>
|
|
Unità Sovrastante
|
|
</h4>
|
|
@if($unita_vicine['sovrastante'])
|
|
<div class="space-y-2">
|
|
<p class="font-mono text-sm">{{ $unita_vicine['sovrastante']->codice_unita }}</p>
|
|
<p class="text-xs text-blue-600">Piano {{ $unita_vicine['sovrastante']->piano }}</p>
|
|
<a href="{{ route('admin.unita-immobiliari.show', $unita_vicine['sovrastante']) }}"
|
|
class="inline-flex items-center text-xs text-blue-600 hover:text-blue-800">
|
|
<i class="fas fa-eye mr-1"></i>Visualizza
|
|
</a>
|
|
</div>
|
|
@else
|
|
<p class="text-sm text-gray-500">Nessuna unità sovrastante</p>
|
|
@endif
|
|
</div>
|
|
|
|
<!-- Unità Sottostante -->
|
|
<div class="bg-green-50 border border-green-200 rounded-lg p-6">
|
|
<h4 class="font-medium text-green-800 mb-4 flex items-center">
|
|
<i class="fas fa-arrow-down mr-2"></i>
|
|
Unità Sottostante
|
|
</h4>
|
|
@if($unita_vicine['sottostante'])
|
|
<div class="space-y-2">
|
|
<p class="font-mono text-sm">{{ $unita_vicine['sottostante']->codice_unita }}</p>
|
|
<p class="text-xs text-green-600">Piano {{ $unita_vicine['sottostante']->piano }}</p>
|
|
<a href="{{ route('admin.unita-immobiliari.show', $unita_vicine['sottostante']) }}"
|
|
class="inline-flex items-center text-xs text-green-600 hover:text-green-800">
|
|
<i class="fas fa-eye mr-1"></i>Visualizza
|
|
</a>
|
|
</div>
|
|
@else
|
|
<p class="text-sm text-gray-500">Nessuna unità sottostante</p>
|
|
@endif
|
|
</div>
|
|
|
|
<!-- Unità Laterali -->
|
|
<div class="bg-yellow-50 border border-yellow-200 rounded-lg p-6">
|
|
<h4 class="font-medium text-yellow-800 mb-4 flex items-center">
|
|
<i class="fas fa-arrows-alt-h mr-2"></i>
|
|
Unità Laterali
|
|
</h4>
|
|
@if($unita_vicine['laterali']->count() > 0)
|
|
<div class="space-y-3">
|
|
@foreach($unita_vicine['laterali'] as $laterale)
|
|
<div class="border-b border-yellow-200 pb-2 last:border-b-0">
|
|
<p class="font-mono text-sm">{{ $laterale->codice_unita }}</p>
|
|
<p class="text-xs text-yellow-600">Interno {{ $laterale->interno }}</p>
|
|
<a href="{{ route('admin.unita-immobiliari.show', $laterale) }}"
|
|
class="inline-flex items-center text-xs text-yellow-600 hover:text-yellow-800">
|
|
<i class="fas fa-eye mr-1"></i>Visualizza
|
|
</a>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
@else
|
|
<p class="text-sm text-gray-500">Nessuna unità laterale</p>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Tab Economico -->
|
|
<div id="economico" class="netgescon-tab-content hidden">
|
|
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
|
|
<!-- Tabelle Millesimali per Unità -->
|
|
<div class="space-y-6">
|
|
<h3 class="text-lg font-semibold text-gray-900 border-b pb-2">
|
|
<i class="fas fa-percentage mr-2 text-blue-600"></i>
|
|
Tabelle millesimali assegnate all'unità
|
|
</h3>
|
|
@if(isset($millesimiPerTabella) && $millesimiPerTabella->count())
|
|
<div class="overflow-hidden border border-gray-200 rounded-lg">
|
|
<table class="min-w-full divide-y divide-gray-200">
|
|
<thead class="bg-gray-50">
|
|
<tr>
|
|
<th class="px-4 py-2 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Tabella</th>
|
|
<th class="px-4 py-2 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">Millesimi</th>
|
|
<th class="px-4 py-2 text-right text-xs font-medium text-gray-500 uppercase tracking-wider">Percentuale</th>
|
|
<th class="px-4 py-2"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="bg-white divide-y divide-gray-200">
|
|
@foreach($millesimiPerTabella as $r)
|
|
<tr>
|
|
<td class="px-4 py-2 text-sm text-gray-900">
|
|
<span class="inline-flex items-center space-x-2">
|
|
<span class="px-2 py-0.5 rounded bg-blue-100 text-blue-800 text-xs font-semibold">{{ $r['codice'] }}</span>
|
|
<span class="text-gray-700">{{ $r['nome'] }}</span>
|
|
</span>
|
|
</td>
|
|
<td class="px-4 py-2 text-sm text-right font-mono">{{ number_format($r['millesimi'], 3, ',', '.') }}</td>
|
|
<td class="px-4 py-2 text-sm text-right">{{ number_format($r['percentuale'], 2, ',', '.') }}%</td>
|
|
<td class="px-4 py-2 text-sm text-right">
|
|
@if($r['id'])
|
|
<a href="{{ route('admin.tabelle-millesimali.show', $r['id']) }}" class="text-blue-600 hover:text-blue-800 inline-flex items-center text-xs">
|
|
<i class="fas fa-external-link-alt mr-1"></i>Apri tabella
|
|
</a>
|
|
@endif
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
@else
|
|
<div class="p-4 bg-gray-50 border border-gray-200 rounded">
|
|
<p class="text-sm text-gray-600">Nessuna tabella millesimale assegnata a questa unità.</p>
|
|
</div>
|
|
@endif
|
|
<p class="text-xs text-gray-500">La percentuale è calcolata sul totale della singola tabella.</p>
|
|
</div>
|
|
|
|
<div class="space-y-6">
|
|
<!-- Ripartizioni recenti -->
|
|
<div>
|
|
<h3 class="text-lg font-semibold text-gray-900 border-b pb-2 flex items-center gap-2">
|
|
<i class="fas fa-balance-scale text-indigo-600"></i>
|
|
Ripartizioni recenti (max 50)
|
|
</h3>
|
|
<div class="space-y-3 mt-3">
|
|
@forelse($dettagliRipartizioni ?? [] as $rip)
|
|
<div class="border border-gray-200 rounded-lg p-3 bg-white shadow-sm">
|
|
<div class="flex items-start justify-between">
|
|
<div>
|
|
<p class="text-sm font-semibold text-gray-900">{{ $rip['voce'] }}</p>
|
|
<p class="text-xs text-gray-500">Tabella {{ $rip['tabella'] }} @if($rip['tabella_nome']) — {{ $rip['tabella_nome'] }} @endif</p>
|
|
</div>
|
|
<div class="text-right space-y-1">
|
|
@if($rip['importo_totale'] !== null)
|
|
<span class="inline-block px-2 py-0.5 rounded bg-gray-100 text-xs font-medium text-gray-700">Totale € {{ number_format($rip['importo_totale'], 2, ',', '.') }}</span>
|
|
@endif
|
|
@if($rip['stato'])
|
|
<div class="text-[11px] uppercase text-gray-500">{{ $rip['stato'] }}</div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
<div class="grid grid-cols-2 gap-2 text-xs text-gray-700 mt-2">
|
|
<div>Quota finale: <span class="font-semibold">{{ number_format($rip['quota_finale'] ?? 0, 4, ',', '.') }}</span></div>
|
|
<div class="text-right">% prop./inq.: <span class="font-semibold">{{ number_format($rip['percentuale_applicata'] ?? 0, 2, ',', '.') }} / {{ number_format($rip['percentuale_inquilino'] ?? 0, 2, ',', '.') }}</span></div>
|
|
<div>Importo proprietario: <span class="font-semibold">€ {{ number_format($rip['importo_proprietario'] ?? 0, 2, ',', '.') }}</span></div>
|
|
<div class="text-right">Importo inquilino: <span class="font-semibold">€ {{ number_format($rip['importo_inquilino'] ?? 0, 2, ',', '.') }}</span></div>
|
|
</div>
|
|
</div>
|
|
@empty
|
|
<p class="text-sm text-gray-500">Nessuna ripartizione trovata per questa unità.</p>
|
|
@endforelse
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Valutazioni -->
|
|
<div>
|
|
<h3 class="text-lg font-semibold text-gray-900 border-b pb-2">
|
|
<i class="fas fa-euro-sign mr-2 text-green-600"></i>
|
|
Valutazioni Economiche
|
|
</h3>
|
|
<div class="space-y-3 mt-3">
|
|
<div class="flex justify-between">
|
|
<span class="font-medium text-gray-700">Valore Commerciale:</span>
|
|
<span class="text-gray-900">€{{ number_format($unita->valore_commerciale_stimato ?? 0, 0, ',', '.') }}</span>
|
|
</div>
|
|
<div class="flex justify-between">
|
|
<span class="font-medium text-gray-700">Valore al m²:</span>
|
|
<span class="text-gray-900">
|
|
@if($unita->superficie_commerciale && $unita->valore_commerciale_stimato)
|
|
€{{ number_format($unita->valore_commerciale_stimato / $unita->superficie_commerciale, 0, ',', '.') }}/m²
|
|
@else
|
|
-
|
|
@endif
|
|
</span>
|
|
</div>
|
|
<div class="flex justify-between">
|
|
<span class="font-medium text-gray-700">Rendita Catastale:</span>
|
|
<span class="text-gray-900">€{{ number_format($unita->rendita_catastale ?? 0, 2, ',', '.') }}</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
@push('scripts')
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
// Initialize tabs
|
|
const tabButtons = document.querySelectorAll('.netgescon-tab-btn');
|
|
const tabContents = document.querySelectorAll('.netgescon-tab-content');
|
|
|
|
tabButtons.forEach(button => {
|
|
button.addEventListener('click', function() {
|
|
const targetTab = this.getAttribute('data-tab');
|
|
|
|
// Remove active class from all buttons and contents
|
|
tabButtons.forEach(btn => btn.classList.remove('active'));
|
|
tabContents.forEach(content => content.classList.add('hidden'));
|
|
|
|
// Add active class to clicked button and show corresponding content
|
|
this.classList.add('active');
|
|
document.getElementById(targetTab).classList.remove('hidden');
|
|
});
|
|
});
|
|
});
|
|
</script>
|
|
@endpush
|
|
@endsection
|