@php($legacyCode = request('legacy_code'))

Banche (Legacy → Staging → NetGescon)

@php $bankCount = null; try{ $legacy = $legacyCode; if ($legacy && \Illuminate\Support\Facades\Schema::hasTable('stabili')){ $col = \Illuminate\Support\Facades\Schema::hasColumn('stabili','codice_stabile') ? 'codice_stabile' : (\Illuminate\Support\Facades\Schema::hasColumn('stabili','denominazione') ? 'denominazione' : null); if ($col){ $stab = \Illuminate\Support\Facades\DB::table('stabili')->where($col,$legacy)->first(); if ($stab && \Illuminate\Support\Facades\Schema::hasTable('dati_bancari')){ $bankCount = \Illuminate\Support\Facades\DB::table('dati_bancari')->where('stabile_id', $stab->id)->count(); } } } }catch (\Throwable $e){ $bankCount = null; } @endphp

Importa più conti bancari per ogni stabile. Mappa i campi legacy delle BANCA 1 / BANCA 2 / BANCA 3 (IBAN, Istituto, SWIFT, N. Conto, Intestatario, Cod. Cassa) verso NetGescon. @if(isset($bankCount)) Conti già presenti: {{ $bankCount }} @endif

Legacy selezionato: {{ request('legacy_code') ?: '—' }}
@csrf
@include('admin.gescon-import.partials.staging-panel', [ 'context' => 'banche', 'title' => 'Staging MDB Banche → DB (gescon_import)' ])