227 lines
10 KiB
PHP
Executable File
227 lines
10 KiB
PHP
Executable File
@extends('admin.layouts.netgescon')
|
|
|
|
@section('page-title', 'Piano dei Conti e Tabelle Millesimali')
|
|
|
|
@section('content')
|
|
<div class="space-y-8 netgescon-fade-in">
|
|
<!-- Header -->
|
|
<div class="netgescon-card">
|
|
<div class="flex items-center justify-between">
|
|
<div>
|
|
<h2 class="netgescon-title">
|
|
<i class="fas fa-table text-blue-500 mr-3"></i>
|
|
Piano dei Conti e Tabelle Millesimali
|
|
</h2>
|
|
<p class="netgescon-text mt-2">
|
|
Sistema complesso di gestione contabile e ripartizione millesimale
|
|
</p>
|
|
</div>
|
|
<div class="hidden md:block">
|
|
<a href="{{ route('piano_conti.create') }}" class="netgescon-btn netgescon-btn-primary mr-2">
|
|
<i class="fas fa-plus"></i>
|
|
Nuovo Conto
|
|
</a>
|
|
<a href="{{ route('piano_conti.export', ['stabile_id' => $stabile_id]) }}" class="netgescon-btn netgescon-btn-outline">
|
|
<i class="fas fa-download"></i>
|
|
Esporta CSV
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Statistiche Riassuntive -->
|
|
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
|
|
<!-- Gestioni Totali -->
|
|
<div class="netgescon-stat-card netgescon-stat-blue">
|
|
<div class="flex items-center justify-between">
|
|
<div>
|
|
<p class="netgescon-stat-label">Gestioni Totali</p>
|
|
<p class="netgescon-stat-value">{{ $statistiche['totale_gestioni'] }}</p>
|
|
</div>
|
|
<div class="netgescon-stat-icon netgescon-stat-icon-blue">
|
|
<i class="fas fa-calendar-alt"></i>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Gestioni Attive -->
|
|
<div class="netgescon-stat-card netgescon-stat-green">
|
|
<div class="flex items-center justify-between">
|
|
<div>
|
|
<p class="netgescon-stat-label">Gestioni Attive</p>
|
|
<p class="netgescon-stat-value">{{ $statistiche['gestioni_attive'] }}</p>
|
|
</div>
|
|
<div class="netgescon-stat-icon netgescon-stat-icon-green">
|
|
<i class="fas fa-check-circle"></i>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Tabelle Millesimali -->
|
|
<div class="netgescon-stat-card netgescon-stat-yellow">
|
|
<div class="flex items-center justify-between">
|
|
<div>
|
|
<p class="netgescon-stat-label">Tabelle Millesimali</p>
|
|
<p class="netgescon-stat-value">{{ $statistiche['totale_tabelle'] }}</p>
|
|
</div>
|
|
<div class="netgescon-stat-icon netgescon-stat-icon-yellow">
|
|
<i class="fas fa-table"></i>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Dettagli Millesimi -->
|
|
<div class="netgescon-stat-card netgescon-stat-purple">
|
|
<div class="flex items-center justify-between">
|
|
<div>
|
|
<p class="netgescon-stat-label">Dettagli Millesimi</p>
|
|
<p class="netgescon-stat-value">{{ $statistiche['totale_dettagli'] }}</p>
|
|
</div>
|
|
<div class="netgescon-stat-icon netgescon-stat-icon-purple">
|
|
<i class="fas fa-list-ol"></i>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Sezioni principali -->
|
|
<div class="grid grid-cols-1 lg:grid-cols-2 gap-6">
|
|
<!-- Gestioni Condominiali -->
|
|
<div class="netgescon-card">
|
|
<div class="netgescon-card-header">
|
|
<h3 class="netgescon-card-title">
|
|
<i class="fas fa-building text-blue-500 mr-2"></i>
|
|
Gestioni Condominiali
|
|
</h3>
|
|
</div>
|
|
<div class="netgescon-card-body">
|
|
<div class="overflow-x-auto">
|
|
<table class="netgescon-table">
|
|
<thead>
|
|
<tr>
|
|
<th>Codice</th>
|
|
<th>Tipo</th>
|
|
<th>Periodo</th>
|
|
<th>Stato</th>
|
|
<th>Azioni</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach($gestioni as $gestione)
|
|
<tr>
|
|
<td><span class="font-semibold">{{ $gestione->codice }}</span></td>
|
|
<td>
|
|
<span class="netgescon-badge {{ $gestione->tipo === 'ORDINARIA' ? 'netgescon-badge-blue' : ($gestione->tipo === 'RISCALDAMENTO' ? 'netgescon-badge-yellow' : 'netgescon-badge-purple') }}">
|
|
{{ $gestione->tipo }}
|
|
</span>
|
|
</td>
|
|
<td class="text-sm">
|
|
{{ $gestione->data_inizio->format('d/m/Y') }} -
|
|
{{ $gestione->data_fine->format('d/m/Y') }}
|
|
</td>
|
|
<td>
|
|
<span class="netgescon-badge {{ $gestione->stato === 'ATTIVA' ? 'netgescon-badge-green' : 'netgescon-badge-gray' }}">
|
|
{{ $gestione->stato }}
|
|
</span>
|
|
</td>
|
|
<td>
|
|
<a href="{{ route('piano_conti.report_gestione', $gestione->id) }}"
|
|
class="netgescon-btn-icon netgescon-btn-icon-blue" title="Report">
|
|
<i class="fas fa-chart-bar"></i>
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Tabelle Millesimali -->
|
|
<div class="netgescon-card">
|
|
<div class="netgescon-card-header">
|
|
<h3 class="netgescon-card-title">
|
|
<i class="fas fa-calculator text-purple-500 mr-2"></i>
|
|
Tabelle Millesimali Principali
|
|
</h3>
|
|
</div>
|
|
<div class="netgescon-card-body">
|
|
<div class="overflow-x-auto">
|
|
<table class="netgescon-table">
|
|
<thead>
|
|
<tr>
|
|
<th>Codice</th>
|
|
<th>Denominazione</th>
|
|
<th>Tipo</th>
|
|
<th>Unità</th>
|
|
<th>Totale ‰</th>
|
|
<th>Azioni</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach($tabelle_millesimali->take(10) as $tabella)
|
|
<tr>
|
|
<td><span class="font-semibold">{{ $tabella->codice_tabella ?: $tabella->nome_tabella }}</span></td>
|
|
<td class="text-sm">{{ Str::limit($tabella->denominazione ?: $tabella->nome_tabella, 25) }}</td>
|
|
<td>
|
|
<span class="netgescon-badge netgescon-badge-gray">{{ $tabella->tipo_tabella }}</span>
|
|
</td>
|
|
<td>{{ $tabella->dettagliMillesimi->count() }}</td>
|
|
<td class="font-mono">{{ number_format($tabella->dettagliMillesimi->sum('millesimi'), 2) }}</td>
|
|
<td>
|
|
<a href="{{ route('piano_conti.show_tabella', $tabella->id) }}"
|
|
class="netgescon-btn-icon netgescon-btn-icon-blue" title="Dettagli">
|
|
<i class="fas fa-eye"></i>
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
@if($tabelle_millesimali->count() > 10)
|
|
<div class="text-center mt-4">
|
|
<small class="netgescon-text-muted">
|
|
Mostrando 10 di {{ $tabelle_millesimali->count() }} tabelle totali
|
|
</small>
|
|
</div>
|
|
@endif
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Tabelle per Categoria -->
|
|
<div class="netgescon-card">
|
|
<div class="netgescon-card-header">
|
|
<h3 class="netgescon-card-title">
|
|
<i class="fas fa-layer-group text-indigo-500 mr-2"></i>
|
|
Tabelle per Categoria
|
|
</h3>
|
|
</div>
|
|
<div class="netgescon-card-body">
|
|
<div class="grid grid-cols-1 md:grid-cols-3 gap-4">
|
|
@php
|
|
$tabelle_per_tipo = $tabelle_millesimali->groupBy('tipo_tabella');
|
|
@endphp
|
|
|
|
@foreach($tabelle_per_tipo as $tipo => $gruppo)
|
|
<div class="netgescon-stat-card {{ $tipo === 'proprieta' ? 'netgescon-stat-blue' : ($tipo === 'riscaldamento' ? 'netgescon-stat-yellow' : 'netgescon-stat-purple') }}">
|
|
<div class="flex items-center justify-between">
|
|
<div>
|
|
<p class="netgescon-stat-label">{{ ucfirst($tipo) }}</p>
|
|
<p class="netgescon-stat-value">{{ $gruppo->count() }} tabelle</p>
|
|
<p class="text-xs {{ $tipo === 'proprieta' ? 'text-blue-600' : ($tipo === 'riscaldamento' ? 'text-yellow-600' : 'text-purple-600') }}">
|
|
{{ number_format($gruppo->sum(function($t) { return $t->dettagliMillesimi->sum('millesimi'); }), 0) }} millesimi totali
|
|
</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@endsection
|