121 lines
7.2 KiB
PHP
Executable File
121 lines
7.2 KiB
PHP
Executable File
<x-filament-panels::page>
|
|
<div class="mx-auto max-w-7xl space-y-4">
|
|
<x-filament.components.page-breadcrumbs
|
|
:breadcrumbs="[
|
|
['label' => 'Contabilità', 'url' => null],
|
|
['label' => 'Casse e banche', 'url' => null],
|
|
]"
|
|
/>
|
|
|
|
@php
|
|
$stabile = $this->getActiveStabile();
|
|
$totale = $this->getTotaleDisponibilita();
|
|
@endphp
|
|
|
|
@if(! $stabile)
|
|
<x-filament::section>
|
|
<div class="text-sm text-gray-600">Seleziona uno stabile per vedere conti e disponibilità.</div>
|
|
</x-filament::section>
|
|
@else
|
|
<x-filament::section>
|
|
<div class="flex flex-wrap items-start justify-between gap-3">
|
|
<div class="space-y-1">
|
|
<div class="text-sm text-gray-500">Stabile attivo</div>
|
|
<div class="text-lg font-semibold text-gray-900">
|
|
{{ $stabile->codice_operatore ?? $stabile->codice_stabile ?? '—' }} — {{ $stabile->denominazione ?? 'Stabile' }}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="text-right">
|
|
<div class="text-sm text-gray-500">Totale disponibilità</div>
|
|
<div class="text-lg font-semibold text-gray-900">
|
|
@if($totale !== null)
|
|
€ {{ number_format((float) $totale, 2, ',', '.') }}
|
|
@else
|
|
—
|
|
@endif
|
|
</div>
|
|
<div class="text-xs text-gray-500">Applica filtri tabella per periodo/gestione.</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mt-4 grid grid-cols-1 gap-3 md:grid-cols-3">
|
|
<div class="rounded-lg border bg-white p-3">
|
|
<div class="text-xs text-gray-500">IBAN principale (scheda stabile)</div>
|
|
<div class="mt-1 text-sm font-medium text-gray-900 truncate">{{ $stabile->iban_principale ?? '—' }}</div>
|
|
</div>
|
|
<div class="rounded-lg border bg-white p-3">
|
|
<div class="text-xs text-gray-500">IBAN secondario (scheda stabile)</div>
|
|
<div class="mt-1 text-sm font-medium text-gray-900 truncate">{{ $stabile->iban_secondario ?? '—' }}</div>
|
|
</div>
|
|
<div class="rounded-lg border bg-white p-3">
|
|
<div class="text-xs text-gray-500">IBAN condominio (scheda stabile)</div>
|
|
<div class="mt-1 text-sm font-medium text-gray-900 truncate">{{ $stabile->iban_condominio ?? '—' }}</div>
|
|
</div>
|
|
</div>
|
|
</x-filament::section>
|
|
|
|
<x-filament::section>
|
|
<x-slot name="heading">Conti disponibili</x-slot>
|
|
<x-slot name="description">Elenco conti dello stabile con saldo calcolato (filtrabile per periodo/gestione).</x-slot>
|
|
|
|
{{ $this->table }}
|
|
</x-filament::section>
|
|
|
|
<x-filament::section class="mt-4">
|
|
<x-slot name="heading">
|
|
<div class="flex items-center justify-between">
|
|
<span>Riconoscimento & Quadratura Spese Bancarie (Codici Interbancari)</span>
|
|
<div class="flex items-center gap-2">
|
|
<button type="button"
|
|
wire:click="riconciliaSpeseBancarieAutomaticamente"
|
|
class="inline-flex items-center justify-center rounded-md border border-emerald-300 bg-emerald-600 px-3 py-1.5 text-xs font-semibold text-white hover:bg-emerald-500 shadow-sm focus:outline-none transition-all">
|
|
Registrazione Automatica Spese & CBILL
|
|
</button>
|
|
<button type="button"
|
|
wire:click="saveInterbankMappings"
|
|
class="inline-flex items-center justify-center rounded-md border border-cyan-300 bg-cyan-600 px-3 py-1.5 text-xs font-semibold text-white hover:bg-cyan-500 shadow-sm focus:outline-none transition-all">
|
|
Salva Configurazione
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</x-slot>
|
|
|
|
<x-slot name="description">
|
|
Mappa i codici interbancari letti dagli estratti conto alle voci del piano dei conti dello stabile per consentire la contabilizzazione automatica della prima nota e la quadratura con bollettini PagoPA/CBILL.
|
|
</x-slot>
|
|
|
|
<div class="grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-6">
|
|
@php
|
|
$options = $this->getPianoContiOptions();
|
|
$standardCodes = [
|
|
'198' => ['label' => 'Canone Conto / Costo Fisso (198)', 'desc' => 'Canoni di tenuta conto mensili / annuali.'],
|
|
'219' => ['label' => 'Imposta di Bollo (219)', 'desc' => 'Addebiti per imposta di bollo trimestrale o annuale.'],
|
|
'048' => ['label' => 'Spese / Commissioni (048)', 'desc' => 'Commissioni su bonifici o operazioni singole.'],
|
|
'208' => ['label' => 'Interessi Passivi (208)', 'desc' => 'Oneri e interessi passivi addebitati.'],
|
|
'012' => ['label' => 'Bollettini CBILL / PagoPA (012)', 'desc' => 'Addebiti CBILL. Saranno auto-abbinati per fornitore e importo.'],
|
|
'F24' => ['label' => 'Deleghe F24 (RA)', 'desc' => 'Versamenti F24 delle Ritenute d\'Acconto.'],
|
|
];
|
|
@endphp
|
|
|
|
@foreach($standardCodes as $code => $info)
|
|
<div class="rounded-lg border border-gray-200 dark:border-gray-800 p-3 bg-gray-50/50 dark:bg-gray-900/50 space-y-2">
|
|
<div class="text-xs font-semibold text-gray-900 dark:text-gray-100">{{ $info['label'] }}</div>
|
|
<div class="text-[10px] text-gray-500 dark:text-gray-400 min-h-[30px] leading-relaxed">{{ $info['desc'] }}</div>
|
|
<div class="mt-2">
|
|
<select wire:model.live="interbankMappings.{{ $code }}"
|
|
class="w-full text-xs rounded-md border-gray-300 dark:border-gray-700 bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 shadow-sm focus:border-cyan-500 focus:ring-cyan-500">
|
|
<option value="">-- Non configurata --</option>
|
|
@foreach($options as $val => $lbl)
|
|
<option value="{{ $val }}">{{ $lbl }}</option>
|
|
@endforeach
|
|
</select>
|
|
</div>
|
|
</div>
|
|
@endforeach
|
|
</div>
|
|
</x-filament::section>
|
|
@endif
|
|
</div>
|
|
</x-filament-panels::page>
|