fix(unita-immobiliare): load in_da_ec payments & clean up UI top bar layout matching ASCII wireframe (task-d095b0e23b)
This commit is contained in:
parent
f341b3edd3
commit
01c387e3ba
|
|
@ -881,26 +881,55 @@ public function getEstrattoContoNominativoDettaglioProperty(): array
|
|||
|
||||
$dettaglioIncassi = [];
|
||||
$totaleIncassato = 0.0;
|
||||
if ($idCond > 0 && DbSchema::connection('gescon_import')->hasTable('incassi')) {
|
||||
$incassiRows = DB::connection('gescon_import')->table('incassi')
|
||||
->where('cod_stabile', $codStabile)
|
||||
->where('id_cond', $idCond)
|
||||
->orderBy('data_pagamento')
|
||||
->get();
|
||||
if ($idCond > 0) {
|
||||
if (DbSchema::connection('gescon_import')->hasTable('in_da_ec')) {
|
||||
$ecRows = DB::connection('gescon_import')->table('in_da_ec')
|
||||
->where('cod_stabile', $codStabile)
|
||||
->where(function ($q) use ($idCond) {
|
||||
$q->where('id_condomino', (string) $idCond)
|
||||
->orWhere('id_condomino', (int) $idCond);
|
||||
})
|
||||
->orderBy('data_pag')
|
||||
->get();
|
||||
|
||||
foreach ($incassiRows as $inc) {
|
||||
$imp = (float) ($inc->importo_euro ?? $inc->importo_pagato_euro ?? 0);
|
||||
$yearRef = (string) ($inc->anno_rif ?? '');
|
||||
$humanYr = $yearRef !== '' ? $this->resolveHumanYearLabel($yearRef, $codStabile) : '—';
|
||||
foreach ($ecRows as $inc) {
|
||||
$imp = (float) ($inc->importo ?? 0);
|
||||
$yearRef = (string) ($inc->legacy_year ?? '');
|
||||
$humanYr = $yearRef !== '' ? $this->resolveHumanYearLabel($yearRef, $codStabile) : '—';
|
||||
$dtPag = ! empty($inc->data_pag) ? date('d/m/Y', strtotime((string) $inc->data_pag)) : '—';
|
||||
|
||||
$dettaglioIncassi[] = [
|
||||
'data_pagamento' => (string) ($inc->data_pagamento ?? '—'),
|
||||
'cod_cassa' => (string) ($inc->cod_cassa ?? '—'),
|
||||
'anno_rif' => $humanYr,
|
||||
'importo_euro' => $imp,
|
||||
'descrizione' => (string) ($inc->descrizione ?? '—'),
|
||||
];
|
||||
$totaleIncassato += $imp;
|
||||
$dettaglioIncassi[] = [
|
||||
'data_pagamento' => $dtPag,
|
||||
'cod_cassa' => (string) ($inc->num_incasso ?? ($inc->protocollo ?? 'EC')),
|
||||
'anno_rif' => $humanYr,
|
||||
'importo_euro' => $imp,
|
||||
'descrizione' => trim((string) ($inc->nome_condomino ?? '')) . ($inc->descrizione_aggintiva ? ' — ' . trim((string) $inc->descrizione_aggintiva) : ''),
|
||||
];
|
||||
$totaleIncassato += $imp;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($dettaglioIncassi) && DbSchema::connection('gescon_import')->hasTable('incassi')) {
|
||||
$incassiRows = DB::connection('gescon_import')->table('incassi')
|
||||
->where('cod_stabile', $codStabile)
|
||||
->where('id_cond', $idCond)
|
||||
->orderBy('data_pagamento')
|
||||
->get();
|
||||
|
||||
foreach ($incassiRows as $inc) {
|
||||
$imp = (float) ($inc->importo_euro ?? $inc->importo_pagato_euro ?? 0);
|
||||
$yearRef = (string) ($inc->anno_rif ?? '');
|
||||
$humanYr = $yearRef !== '' ? $this->resolveHumanYearLabel($yearRef, $codStabile) : '—';
|
||||
|
||||
$dettaglioIncassi[] = [
|
||||
'data_pagamento' => (string) ($inc->data_pagamento ?? '—'),
|
||||
'cod_cassa' => (string) ($inc->cod_cassa ?? '—'),
|
||||
'anno_rif' => $humanYr,
|
||||
'importo_euro' => $imp,
|
||||
'descrizione' => (string) ($inc->descrizione ?? '—'),
|
||||
];
|
||||
$totaleIncassato += $imp;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -60,18 +60,6 @@ class="inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs font-me
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<x-filament::section class="p-4!">
|
||||
@include('filament.components.page-breadcrumbs', [
|
||||
'breadcrumbs' => [
|
||||
['label' => 'Condomini', 'url' => route('admin.dashboards.condomini')],
|
||||
['label' => 'Unità immobiliari', 'url' => \App\Filament\Pages\Condomini\UnitaImmobiliariArchivio::getUrl(panel: 'admin-filament')],
|
||||
['label' => 'Scheda unità'],
|
||||
],
|
||||
'backUrl' => $this->getBackUrl(),
|
||||
'backLabel' => 'Torna indietro',
|
||||
])
|
||||
</x-filament::section>
|
||||
|
||||
@php
|
||||
$unitaOptions = $this->getUnitaOptions();
|
||||
$prevUrl = $this->getPrevUnitaUrl();
|
||||
|
|
@ -83,53 +71,53 @@ class="inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1.5 text-xs font-me
|
|||
];
|
||||
@endphp
|
||||
|
||||
<x-filament::section class="p-4!">
|
||||
<div class="flex flex-wrap items-end justify-between gap-4">
|
||||
<div class="flex items-end gap-2">
|
||||
<div class="flex flex-col items-center gap-1">
|
||||
<span class="text-[10px] text-gray-500">Prec.</span>
|
||||
@if($prevUrl)
|
||||
<a class="fi-btn fi-btn-color-gray fi-btn-size-sm" href="{{ $prevUrl }}">←</a>
|
||||
@else
|
||||
<span class="fi-btn fi-btn-color-gray fi-btn-size-sm opacity-40">←</span>
|
||||
@endif
|
||||
{{-- CONTROLLI COMPATTI SELEZIONE UNITÀ & VISTA --}}
|
||||
<div class="mb-3 flex flex-wrap items-center justify-between gap-3 rounded-xl border border-slate-200 bg-white p-2.5 shadow-xs">
|
||||
<div class="flex flex-wrap items-center gap-2.5">
|
||||
<a href="{{ $this->getBackUrl() }}" class="inline-flex items-center gap-1 rounded-lg border border-slate-200 bg-slate-50 px-2.5 py-1 text-xs font-semibold text-slate-600 transition hover:bg-slate-100 hover:text-slate-900">
|
||||
<span>←</span>
|
||||
<span>Torna indietro</span>
|
||||
</a>
|
||||
<span class="text-slate-300">|</span>
|
||||
|
||||
<div class="flex items-center gap-1.5">
|
||||
@if($prevUrl)
|
||||
<a class="inline-flex items-center justify-center rounded-lg border border-slate-200 bg-slate-50 px-2.5 py-1 text-xs font-semibold text-slate-700 transition hover:bg-slate-100" href="{{ $prevUrl }}">← Prec.</a>
|
||||
@else
|
||||
<span class="inline-flex items-center justify-center rounded-lg border border-slate-200 bg-slate-50 px-2.5 py-1 text-xs font-semibold text-slate-400 opacity-50">← Prec.</span>
|
||||
@endif
|
||||
|
||||
<div class="min-w-64 max-w-xl">
|
||||
{{ $this->getSchema('unitaPicker') }}
|
||||
</div>
|
||||
|
||||
<div class="min-w-72 max-w-xl flex flex-col items-start gap-1">
|
||||
<span class="text-[10px] text-gray-500">Unità</span>
|
||||
<div class="w-full">{{ $this->getSchema('unitaPicker') }}</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col items-center gap-1">
|
||||
<span class="text-[10px] text-gray-500">Succ.</span>
|
||||
@if($nextUrl)
|
||||
<a class="fi-btn fi-btn-color-gray fi-btn-size-sm" href="{{ $nextUrl }}">→</a>
|
||||
@else
|
||||
<span class="fi-btn fi-btn-color-gray fi-btn-size-sm opacity-40">→</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<span class="text-xs font-medium text-gray-500">Vista:</span>
|
||||
<button
|
||||
type="button"
|
||||
wire:click="toggleMostraStorico"
|
||||
class="rounded-lg border px-3 py-2 text-xs font-semibold transition {{ $mostraStorico ? 'border-amber-300 bg-amber-50 text-amber-700 shadow-sm' : 'border-gray-200 bg-white text-gray-700 hover:border-gray-300 hover:bg-gray-50' }}">
|
||||
{{ $mostraStorico ? 'Mostra storico (Attivo)' : 'Solo gestione selezionata' }}
|
||||
</button>
|
||||
<span class="text-xs font-medium text-gray-500 ml-2">Visibilità:</span>
|
||||
@foreach($visibilityOptions as $key => $label)
|
||||
<button
|
||||
type="button"
|
||||
wire:click="setUnitaVisibilita('{{ $key }}')"
|
||||
class="rounded-lg border px-3 py-2 text-xs font-semibold transition {{ $this->unitaVisibilita === $key ? 'border-primary-300 bg-primary-50 text-primary-700 shadow-sm' : 'border-gray-200 bg-white text-gray-700 hover:border-gray-300 hover:bg-gray-50' }}">
|
||||
{{ $label }}
|
||||
</button>
|
||||
@endforeach
|
||||
@if($nextUrl)
|
||||
<a class="inline-flex items-center justify-center rounded-lg border border-slate-200 bg-slate-50 px-2.5 py-1 text-xs font-semibold text-slate-700 transition hover:bg-slate-100" href="{{ $nextUrl }}">Succ. →</a>
|
||||
@else
|
||||
<span class="inline-flex items-center justify-center rounded-lg border border-slate-200 bg-slate-50 px-2.5 py-1 text-xs font-semibold text-slate-400 opacity-50">Succ. →</span>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</x-filament::section>
|
||||
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<span class="text-xs font-medium text-slate-500">Vista:</span>
|
||||
<button
|
||||
type="button"
|
||||
wire:click="toggleMostraStorico"
|
||||
class="rounded-lg border px-2.5 py-1 text-xs font-semibold transition {{ $mostraStorico ? 'border-amber-300 bg-amber-50 text-amber-700 shadow-xs' : 'border-slate-200 bg-slate-50 text-slate-700 hover:bg-slate-100' }}">
|
||||
{{ $mostraStorico ? 'Mostra storico (Attivo)' : 'Solo gestione selezionata' }}
|
||||
</button>
|
||||
<span class="text-xs font-medium text-slate-500 ml-1">Visibilità:</span>
|
||||
@foreach($visibilityOptions as $key => $label)
|
||||
<button
|
||||
type="button"
|
||||
wire:click="setUnitaVisibilita('{{ $key }}')"
|
||||
class="rounded-lg border px-2.5 py-1 text-xs font-semibold transition {{ $this->unitaVisibilita === $key ? 'border-indigo-300 bg-indigo-50 text-indigo-700 shadow-xs' : 'border-slate-200 bg-slate-50 text-slate-700 hover:bg-slate-100' }}">
|
||||
{{ $label }}
|
||||
</button>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if(!$unita)
|
||||
<div class="rounded-xl border border-dashed border-gray-200 bg-white p-6 text-center text-gray-500">Nessuna unità immobiliare trovata.</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user