netgescon-day0/resources/views/admin/bilanci/index.blade.php

239 lines
16 KiB
PHP
Executable File

@extends('admin.layouts.app')
@section('title', '
{{ __(\'Gestione Bilanci e Consuntivi\') }}
')
@section('content')
<div class="py-5">
<div class="container-fluid mx-auto sm:px-4 lg:px-8 space-y-6">
<!-- Statistiche -->
<div class="grid row md:grid-cols-4 gap-6">
<div class="bg-white dark:bg-dark overflow-hidden shadow-sm rounded">
<div class="p-6">
<div class="d-flex align-items-center">
<div class="d-flex-shrink-0">
<div class="w-8 h-8 bg-warning rounded-full d-flex align-items-center justify-content-center">
<svg class="w-5 h-5 text-white" fill="currentColor" viewBox="0 0 20 20">
<path d="M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z"></path>
</svg>
</div>
</div>
<div class="ml-5 w-0 d-flex-1">
<dl>
<dt class="text-sm font-medium text-muted dark:text-gray-400 truncate">Bilanci Aperti</dt>
<dd class="text-lg font-medium text-gray-900 dark:text-gray-100">{{ $stats['bilanci_aperti'] }}</dd>
</dl>
</div>
</div>
</div>
</div>
<div class="bg-white dark:bg-dark overflow-hidden shadow-sm rounded">
<div class="p-6">
<div class="d-flex align-items-center">
<div class="d-flex-shrink-0">
<div class="w-8 h-8 bg-success rounded-full d-flex align-items-center justify-content-center">
<svg class="w-5 h-5 text-white" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z" clip-rule="evenodd"></path>
</svg>
</div>
</div>
<div class="ml-5 w-0 d-flex-1">
<dl>
<dt class="text-sm font-medium text-muted dark:text-gray-400 truncate">Bilanci Approvati</dt>
<dd class="text-lg font-medium text-gray-900 dark:text-gray-100">{{ $stats['bilanci_approvati'] }}</dd>
</dl>
</div>
</div>
</div>
</div>
<div class="bg-white dark:bg-dark overflow-hidden shadow-sm rounded">
<div class="p-6">
<div class="d-flex align-items-center">
<div class="d-flex-shrink-0">
<div class="w-8 h-8 bg-danger rounded-full d-flex align-items-center justify-content-center">
<svg class="w-5 h-5 text-white" fill="currentColor" viewBox="0 0 20 20">
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm1-12a1 1 0 10-2 0v4a1 1 0 00.293.707l2.828 2.829a1 1 0 101.415-1.415L11 9.586V6z" clip-rule="evenodd"></path>
</svg>
</div>
</div>
<div class="ml-5 w-0 d-flex-1">
<dl>
<dt class="text-sm font-medium text-muted dark:text-gray-400 truncate">Conguagli da Pagare</dt>
<dd class="text-lg font-medium text-gray-900 dark:text-gray-100">{{ $stats['conguagli_da_pagare'] }}</dd>
</dl>
</div>
</div>
</div>
</div>
<div class="bg-white dark:bg-dark overflow-hidden shadow-sm rounded">
<div class="p-6">
<div class="d-flex align-items-center">
<div class="d-flex-shrink-0">
<div class="w-8 h-8 bg-primary rounded-full d-flex align-items-center justify-content-center">
<svg class="w-5 h-5 text-white" fill="currentColor" viewBox="0 0 20 20">
<path d="M8.433 7.418c.155-.103.346-.196.567-.267v1.698a2.305 2.305 0 01-.567-.267C8.07 8.34 8 8.114 8 8c0-.114.07-.34.433-.582zM11 12.849v-1.698c.22.071.412.164.567.267.364.243.433.468.433.582 0 .114-.07.34-.433.582a2.305 2.305 0 01-.567.267z"></path>
<path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm1-13a1 1 0 10-2 0v.092a4.535 4.535 0 00-1.676.662C6.602 6.234 6 7.009 6 8c0 .99.602 1.765 1.324 2.246.48.32 1.054.545 1.676.662v1.941c-.391-.127-.68-.317-.843-.504a1 1 0 10-1.51 1.31c.562.649 1.413 1.076 2.353 1.253V15a1 1 0 102 0v-.092a4.535 4.535 0 001.676-.662C13.398 13.766 14 12.991 14 12c0-.99-.602-1.765-1.324-2.246A4.535 4.535 0 0011 9.092V7.151c.391.127.68.317.843.504a1 1 0 101.511-1.31c-.563-.649-1.413-1.076-2.354-1.253V5z" clip-rule="evenodd"></path>
</svg>
</div>
</div>
<div class="ml-5 w-0 d-flex-1">
<dl>
<dt class="text-sm font-medium text-muted dark:text-gray-400 truncate">Totale Avanzi</dt>
<dd class="text-lg font-medium text-gray-900 dark:text-gray-100"> {{ number_format($stats['totale_avanzi'], 2, ',', '.') }}</dd>
</dl>
</div>
</div>
</div>
</div>
</div>
<!-- Azioni Rapide -->
<div class="bg-white dark:bg-dark overflow-hidden shadow-sm rounded">
<div class="p-6">
<h3 class="text-lg font-medium text-gray-900 dark:text-gray-100 mb-4">Azioni Rapide</h3>
<div class="grid row md:grid-cols-5 gap-4">
<a href="{{ route('admin.bilanci.create') }}"
class="bg-primary text-white fw-bold py-3 px-3 rounded text-center transition duration-200">
Nuovo Bilancio
</a>
<a href="{{ route('admin.bilanci.quadrature') }}"
class="bg-success hover:bg-green-700 text-white fw-bold py-3 px-3 rounded text-center transition duration-200">
Quadrature
</a>
<a href="{{ route('admin.bilanci.conguagli') }}"
class="bg-indigo-500 hover:bg-indigo-700 text-white fw-bold py-3 px-3 rounded text-center transition duration-200">
Conguagli
</a>
<a href="{{ route('admin.bilanci.rimborsi') }}"
class="bg-purple-500 hover:bg-purple-700 text-white fw-bold py-3 px-3 rounded text-center transition duration-200">
Rimborsi
</a>
<a href="{{ route('admin.bilanci.automazioni') }}"
class="bg-warning hover:bg-yellow-700 text-white fw-bold py-3 px-3 rounded text-center transition duration-200">
Automazioni
</a>
</div>
</div>
</div>
<!-- Lista Bilanci -->
<div class="bg-white dark:bg-dark overflow-hidden shadow-sm rounded">
<div class="p-6">
<div class="d-flex justify-content-between align-items-center mb-4">
<h3 class="text-lg font-medium text-gray-900 dark:text-gray-100">Bilanci e Consuntivi</h3>
</div>
<div class="overflow-x-auto">
<table class="table bg-white dark:bg-dark border border-gray-200 ">
<thead class="bg-light dark:bg-gray-700">
<tr>
<th class="px-4 py-3 border-b border-gray-200 dark:border-gray-600 text-left text-xs font-medium text-muted dark:text-gray-300 uppercase tracking-wider">
Anno/Tipo
</th>
<th class="px-4 py-3 border-b border-gray-200 dark:border-gray-600 text-left text-xs font-medium text-muted dark:text-gray-300 uppercase tracking-wider">
Stabile
</th>
<th class="px-4 py-3 border-b border-gray-200 dark:border-gray-600 text-left text-xs font-medium text-muted dark:text-gray-300 uppercase tracking-wider">
Periodo
</th>
<th class="px-4 py-3 border-b border-gray-200 dark:border-gray-600 text-left text-xs font-medium text-muted dark:text-gray-300 uppercase tracking-wider">
Risultato
</th>
<th class="px-4 py-3 border-b border-gray-200 dark:border-gray-600 text-left text-xs font-medium text-muted dark:text-gray-300 uppercase tracking-wider">
Stato
</th>
<th class="px-4 py-3 border-b border-gray-200 dark:border-gray-600 text-left text-xs font-medium text-muted dark:text-gray-300 uppercase tracking-wider">
Versione
</th>
<th class="px-4 py-3 border-b border-gray-200 dark:border-gray-600 text-left text-xs font-medium text-muted dark:text-gray-300 uppercase tracking-wider">
Azioni
</th>
</tr>
</thead>
<tbody class="bg-white dark:bg-dark table-bordered dark:divide-gray-700">
@forelse($bilanci as $bilancio)
<tr class="hover:bg-light dark:hover:bg-gray-700">
<td class="px-4 py-3 text-nowrap text-sm text-gray-900 dark:text-gray-100">
<div>
<div class="font-medium">{{ $bilancio->anno_esercizio }}</div>
<div class="text-muted dark:text-gray-400">{{ ucfirst($bilancio->tipo_gestione) }}</div>
</div>
</td>
<td class="px-4 py-3 text-nowrap text-sm text-gray-900 dark:text-gray-100">
{{ $bilancio->stabile->denominazione }}
</td>
<td class="px-4 py-3 text-nowrap text-sm text-gray-900 dark:text-gray-100">
<div>
<div>{{ $bilancio->data_inizio_esercizio->format('d/m/Y') }}</div>
<div class="text-muted dark:text-gray-400">{{ $bilancio->data_fine_esercizio->format('d/m/Y') }}</div>
</div>
</td>
<td class="px-4 py-3 text-nowrap text-sm text-gray-900 dark:text-gray-100">
<div>
<div class="font-medium {{ $bilancio->risultato_gestione >= 0 ? 'text-success' : 'text-danger' }}">
{{ $bilancio->risultato_gestione >= 0 ? 'Avanzo' : 'Disavanzo' }}
</div>
<div class="text-sm"> {{ number_format(abs($bilancio->risultato_gestione), 2, ',', '.') }}</div>
</div>
</td>
<td class="px-4 py-3 text-nowrap text-sm text-gray-900 dark:text-gray-100">
<span class="inline-d-flex align-items-center px-2.5 py-0.5 rounded-full text-xs font-medium
@switch($bilancio->stato)
@case('bozza') bg-gray-100 text-dark dark:bg-dark dark:text-gray-100 @break
@case('provvisorio') bg-yellow-100 text-yellow-800 dark:bg-yellow-800 dark:text-yellow-100 @break
@case('definitivo') bg-blue-100 text-blue-800 dark:bg-blue-800 dark:text-blue-100 @break
@case('approvato') bg-green-100 text-green-800 dark:bg-green-800 dark:text-green-100 @break
@case('chiuso') bg-purple-100 text-purple-800 dark:bg-purple-800 dark:text-purple-100 @break
@endswitch">
{{ ucfirst($bilancio->stato) }}
</span>
</td>
<td class="px-4 py-3 text-nowrap text-sm text-gray-900 dark:text-gray-100">
v{{ $bilancio->versione }}
</td>
<td class="px-4 py-3 text-nowrap text-sm font-medium gap-2">
<a href="{{ route('admin.bilanci.show', $bilancio) }}"
class="text-primary hover:text-blue-900 dark:text-blue-400 dark:hover:text-blue-300">
Visualizza
</a>
@if(in_array($bilancio->stato, ['bozza', 'provvisorio']))
<a href="{{ route('admin.bilanci.edit', $bilancio) }}"
class="text-indigo-600 hover:text-indigo-900 dark:text-indigo-400 dark:hover:text-indigo-300">
Modifica
</a>
@endif
<a href="{{ route('admin.bilanci.storico', $bilancio) }}"
class="text-success hover:text-green-900 dark:text-green-400 dark:hover:text-green-300">
Storico
</a>
</td>
</tr>
@empty
<tr>
<td colspan="7" class="px-4 py-3 text-center text-muted dark:text-gray-400">
Nessun bilancio trovato
</td>
</tr>
@endforelse
</tbody>
</table>
</div>
<!-- Paginazione -->
<div class="mt-6">
{{ $bilanci->links() }}
</div>
</div>
</div>
</div>
</div>
@endsection