@php $stats = $this->riscaldamentoDashboardStats; $annoGestioneAttivo = \App\Support\AnnoGestioneContext::resolveActiveAnno(auth()->user()); $fatturePerGestione = $this->riscaldamentoFatturePerGestione; $feEstratteSummary = $this->riscaldamentoFeEstratteSummary; $feSelezioneSummary = $this->riscaldamentoFeSelezioneSummary; $feEstratteRows = $this->riscaldamentoFeEstratteRows; $lettureCondomini = $this->riscaldamentoLettureCondomini; $lettureGenerali = $this->riscaldamentoLettureGenerali; $uiReadingForm = $this->riscaldamentoUiReadingForm; $uiServiceOptions = $this->riscaldamentoUiServiceOptions; $uiUnitOptions = $this->riscaldamentoUiUnitOptions; $tariffeRows = $this->riscaldamentoTariffeRows; $legacyArchive = $this->riscaldamentoLegacyArchiveAvailability; $legacyExtraRows = $this->riscaldamentoAltreVociLegacy; $legacyOpsSummary = $this->riscaldamentoLegacyOperazioniSummary; $legacyOpsRows = $this->riscaldamentoLegacyOperazioniRows; $riscaldamentoContratto = $this->riscaldamentoContrattoStabile; $riscaldamentoRipartoNominativi = $this->riscaldamentoRipartoNominativiLegacy; $campagnaStats = $this->riscaldamentoCampagnaStats; $campagnaRows = $this->riscaldamentoCampagnaRows; @endphp

Servizi / Beni comuni - RISCALDAMENTO

Cruscotto operativo per utenze, beni comuni, locali condivisi e contatori riscaldamento dello stabile. Qui convivono contratti, servizi ad uso comune, rimborsi spesa, contatori generali e contatori particolari con storico e tariffe.

Anno gestione attivo: {{ $annoGestioneAttivo }}
@if($riscaldamentoTab === 'dashboard')
Totale fatture riscaldamento (import registrato)
EUR {{ number_format((float) ($stats['totale_fatture'] ?? 0), 2, ',', '.') }}
Controllo legacy operazioni (R%)
EUR {{ number_format((float) ($stats['totale_operazioni_ac12_legacy'] ?? 0), 2, ',', '.') }}
Delta fatture registrate - legacy R%: {{ number_format((float) ($stats['delta_operazioni_vs_fatture'] ?? 0), 2, ',', '.') }}
Letture condomini registrate
{{ number_format((int) ($stats['totale_letture'] ?? 0), 0, ',', '.') }}
con riferimento acquisizione: {{ number_format((int) ($stats['totale_letture_con_riferimento'] ?? 0), 0, ',', '.') }}
Consumi e tariffe
{{ number_format((float) ($stats['totale_consumi_mc'] ?? 0), 3, ',', '.') }} mc
snapshot tariffe: {{ number_format((int) ($stats['totale_tariffe'] ?? 0), 0, ',', '.') }}
Copertura archivio legacy ACEA
Tabella contratti_ACEA: {{ ($legacyArchive['contratti_acea'] ?? false) ? 'presente' : 'non presente' }}
Tabella Tariffe_ACEA_Standard: {{ ($legacyArchive['tariffe_acea_standard'] ?? false) ? 'presente' : 'non presente' }}
{{ $legacyArchive['note'] ?? '' }}
Contratto servizio RISCALDAMENTO (stabile -> fornitore)
Allinea/crea contratto con Acea Ato2
Servizio: {{ $riscaldamentoContratto['servizio_nome'] ?: 'non configurato' }}
Fornitore: {{ $riscaldamentoContratto['fornitore_nome'] ?: 'non assegnato' }}
Codice utenza: {{ $riscaldamentoContratto['codice_utenza'] ?: '—' }}
Codice cliente: {{ $riscaldamentoContratto['codice_cliente'] ?: '—' }}
Codice contratto: {{ $riscaldamentoContratto['codice_contratto'] ?: '—' }}
Matricola contatore: {{ $riscaldamentoContratto['matricola'] ?: '—' }}
@if(!($riscaldamentoContratto['fornitore_nome'] ?? null) && ($riscaldamentoContratto['suggerito_fornitore'] ?? null))
Suggerito in anagrafica fornitori: {{ $riscaldamentoContratto['suggerito_fornitore'] }}
@endif
@endif @if($riscaldamentoTab === 'fatture')
Periodo Esercizio Riscaldamento (Personalizzato per Stabile)
Salva e allinea fatture
Impostando queste date, le FE dello stabile verranno filtrate per questo intervallo temporale anziché per l'anno solare, e verranno collegate alla gestione ordinaria corretta.
Dati estratti dalle fatture FE riscaldamento
Qui vedi consumo, contratto, cliente, matricola, CBILL e riepilogo letture letti dalle FE riscaldamento, con i collegamenti operativi verso scheda FE, ticket generale, contratti e archivio letture.
FE estratte
{{ number_format((int) ($feEstratteSummary['fatture'] ?? 0), 0, ',', '.') }}
Periodi letti
{{ number_format((int) ($feEstratteSummary['periodi'] ?? 0), 0, ',', '.') }}
Totale mc FE
{{ number_format((float) ($feEstratteSummary['totale_mc'] ?? 0), 3, ',', '.') }} mc
Totale spesa FE
{{ number_format((float) ($feEstratteSummary['totale_spesa'] ?? 0), 2, ',', '.') }} EUR
Finestra autolettura
{{ number_format((int) ($feEstratteSummary['con_finestra'] ?? 0), 0, ',', '.') }}
ultima FE {{ !empty($feEstratteSummary['ultima_data']) ? \Carbon\Carbon::parse($feEstratteSummary['ultima_data'])->format('d/m/Y') : '—' }}
Selezione per ripartizione: {{ number_format((int) ($feSelezioneSummary['fatture'] ?? 0), 0, ',', '.') }} FE {{ number_format((float) ($feSelezioneSummary['totale_mc'] ?? 0), 3, ',', '.') }} mc {{ number_format((float) ($feSelezioneSummary['totale_spesa'] ?? 0), 2, ',', '.') }} EUR
Stampa riepilogo PDF riepilogo
Le FE mostrate sono filtrate per anno gestione e fornitore riscaldamento dello stabile. Se il PDF non espone matricola o utenza, usa la selezione manuale per separare le fatture del contatore corretto prima della ripartizione.
@forelse($feEstratteRows as $row) @empty @endforelse
Sel. Fattura Servizio / codici Periodo FE Mc Spesa Azioni
{{ $row['numero_fattura'] ?: ('FE #' . $row['fattura_id']) }}
{{ $row['data_fattura'] ?: '—' }}
@if(!empty($row['legacy_n_spe']))
Legacy: Reg. #{{ $row['legacy_id'] }} · Prot. {{ $row['legacy_n_spe'] }}
@endif
@if($row['registrata_stato'] === 'pagato') Pagata il {{ $row['registrata_data_pagamento'] }} @elseif($row['registrata_stato'] === 'da_pagare') Debito (€ {{ number_format($row['registrata_netto_da_pagare'], 2, ',', '.') }}) @elseif(!empty($row['legacy_id'])) Registrata in Prima Nota @else Da registrare @endif
{{ $row['servizio'] ?: 'Riscaldamento' }}
Matr. {{ $row['matricola'] ?: '—' }} · Utenza {{ $row['codice_utenza'] ?: '—' }} · Cliente {{ $row['codice_cliente'] ?: '—' }} · Contratto {{ $row['codice_contratto'] ?: '—' }} · CBILL {{ $row['cbill_display'] ?: '—' }} @if(!empty($row['sia'])) · SIA {{ $row['sia'] }} @endif
Voce pre-assegnata fornitore: {{ $row['voce_spesa_default_name'] }}
@if(!empty($row['periodicita_fatturazione']) || !empty($row['numero_componenti']) || !empty($row['numero_unita_abitative']))
{{ $row['periodicita_fatturazione'] ?: 'periodicita n/d' }} @if(!empty($row['numero_componenti'])) · comp. {{ $row['numero_componenti'] }} @endif @if(!empty($row['numero_unita_abitative'])) · unita {{ $row['numero_unita_abitative'] }} @endif
@endif @if(!($row['identificativi_noti'] ?? false))
Identificativi non leggibili dal PDF: usare la selezione FE per il contatore corretto.
@endif
{{ $row['periodo_label'] ?: '—' }}
periodi {{ number_format((int) ($row['periodi_count'] ?? 0), 0, ',', '.') }} · riepiloghi {{ number_format((int) ($row['letture_count'] ?? 0), 0, ',', '.') }}
@if(!empty($row['letture_preview']))
{{ implode(' | ', $row['letture_preview']) }}
@endif
{{ number_format((float) ($row['totale_mc'] ?? 0), 3, ',', '.') }} {{ number_format((float) ($row['totale_spesa'] ?? 0), 2, ',', '.') }}
Nessuna FE riscaldamento estratta nello storico attivo.
Estrazione dati riscaldamento dalle FE pregresse
Rilegge le fatture elettroniche gia' presenti per lo stabile e la gestione selezionata, aggiorna consumo, letture e tariffe senza creare doppioni.
Estrai dati dalle FE pregresse
Dopo la creazione della regola servizio, l'import FE continua gia' in automatico sul nuovo scarico; qui recuperi il pregresso.
Fatture registrate divise per gestione
@forelse($fatturePerGestione as $row) @empty @endforelse @if(count($fatturePerGestione) > 0) @endif
Gestione Numero fatture FE Manuali Totale EUR Mc FE Contratti / contatori
{{ strtoupper((string) ($row['gestione'] ?? 'non definita')) }} {{ number_format((int) ($row['fatture_count'] ?? 0), 0, ',', '.') }} {{ number_format((int) ($row['fe_count'] ?? 0), 0, ',', '.') }} {{ number_format((int) ($row['manual_count'] ?? 0), 0, ',', '.') }} {{ number_format((float) ($row['totale_fatture'] ?? 0), 2, ',', '.') }} {{ number_format((float) ($row['totale_mc'] ?? 0), 3, ',', '.') }}
Contratti: {{ !empty($row['contratti']) ? implode(', ', $row['contratti']) : '—' }}
Matricole: {{ !empty($row['matricole']) ? implode(', ', $row['matricole']) : '—' }}
@if(!empty($row['cbill_codes']))
CBILL: {{ implode(', ', $row['cbill_codes']) }}
@endif
Nessuna fattura riscaldamento trovata per lo stabile selezionato.
Totale {{ number_format((int) collect($fatturePerGestione)->sum('fatture_count'), 0, ',', '.') }} {{ number_format((int) collect($fatturePerGestione)->sum('fe_count'), 0, ',', '.') }} {{ number_format((int) collect($fatturePerGestione)->sum('manual_count'), 0, ',', '.') }} {{ number_format((float) collect($fatturePerGestione)->sum('totale_fatture'), 2, ',', '.') }}
Archivio legacy operazioni Riscaldamento (R%)
@if(!empty($legacyOpsSummary['scope_note']))
{{ $legacyOpsSummary['scope_note'] }}
@endif
Righe: {{ number_format((int) ($legacyOpsSummary['righe'] ?? 0), 0, ',', '.') }}
Totale Riscaldamento: {{ number_format((float) ($legacyOpsSummary['totale'] ?? 0), 2, ',', '.') }}
@forelse($legacyOpsRows as $row) @empty @endforelse
Data op. Voce Doc legacy Fornitore Descrizione Importo Match fattura locale
{{ $row['data_operazione'] ? \Carbon\Carbon::parse($row['data_operazione'])->format('d/m/Y') : '—' }} @if(!empty($row['n_spe']))
Prot. {{ $row['n_spe'] }}
@endif
{{ $row['cod_spe'] ?: '—' }} {{ $row['num_fat'] ?: '—' }}
{{ $row['dt_fat'] ? \Carbon\Carbon::parse($row['dt_fat'])->format('d/m/Y') : '—' }}
{{ $row['fornitore_legacy'] ?: ('cod. ' . ($row['cod_for'] ?: '—')) }} {{ $row['benef'] ?: '—' }} {{ number_format((float) ($row['importo'] ?? 0), 2, ',', '.') }} @if(($row['matched_fattura_id'] ?? null)) OK {{ strtoupper((string) ($row['match_type'] ?? '')) }}
ID {{ $row['matched_fattura_id'] }} @if($row['matched_fe_id']) / FE {{ $row['matched_fe_id'] }} @endif
@else DA COLLEGARE @endif
Nessuna operazione di Riscaldamento trovata in archivio legacy.
@if(false)
Altre voci AC (escluse AC1/AC2) - archivio legacy
@forelse($legacyExtraRows as $row) @empty @endforelse
Voce Totale EUR
{{ $row['cod_spe'] }} {{ number_format((float) ($row['totale'] ?? 0), 2, ',', '.') }}
Nessuna voce AC diversa da AC1 trovata.
@endif
@endif @if($riscaldamentoTab === 'letture')
Campagna letture riscaldamento per unità
Vista operativa ordinabile e modificabile riga per riga: puoi salvare una riga o tutte insieme, inviare il link pubblico e aprire il ticket riscaldamento della singola unità.
Prepara / aggiorna campagna letture
Unità
{{ $campagnaStats['totale'] }}
Fatte
{{ $campagnaStats['completate'] }}
Pendenti
{{ $campagnaStats['pendenti'] }}
Sollecitate
{{ $campagnaStats['sollecitate'] }}
@forelse($campagnaRows as $row) @empty @endforelse
Unità Nominativo Email Lettura precedente Stato Richiesta Inserimento rapido Azioni
{{ $row['unit_label'] }} {{ $row['nominativo'] }} {{ $row['email'] ?: '—' }} {{ $row['previous_reading'] !== null ? number_format((float) $row['previous_reading'], 3, ',', '.') : '—' }} @if($row['status'] === 'fatta') Fatta @elseif($row['status'] === 'sollecito') Sollecito @elseif($row['status'] === 'richiesta') Richiesta inviata @else Da inviare @endif {{ $row['requested_at'] ?: '—' }} @if($row['deadline_at'])
Scadenza {{ $row['deadline_at'] }}
@endif
Apri link Ticket riscaldamento @if($row['request_id'] && $row['status'] !== 'fatta') @endif
Nessuna unità disponibile per la campagna letture.
Importazione Letture Contatori Elettronici (CSV)
@error('riscaldamentoReadingsFile') {{ $message }} @enderror
Tracciato supportato: #ID,Modulo n°,Contatore n°,Nome,Cognome,Indirizzo,Interno,Lettura... (la colonna #ID verrà abbinata con riscaldamento_gateway_device_id o in alternativa con l'interno).
Base nominativi riparto RISCALDAMENTO (legacy) per inserimento letture manuali
Fonte letture manuali PDF: /home/michele/netgescon/netgescon-laravel/Miki-Bug-workspace/RISCALDAMENTO-Acea/06 - 2024 VIA_A_DORIA_36.0.RIPARTO.2.pdf
@forelse($riscaldamentoRipartoNominativi as $row) @empty @endforelse @if(count($riscaldamentoRipartoNominativi) > 0) @endif
Scala Interno Nominativo Ruolo Lettura iniziale Consumo mc Quota EUR (riparto)
{{ $row['scala'] ?: '—' }} {{ $row['interno'] ?: '—' }} {{ $row['nominativo'] ?: '—' }} {{ $row['ruolo'] ?: '—' }} {{ isset($row['lettura_iniziale']) && $row['lettura_iniziale'] !== null ? number_format((float) $row['lettura_iniziale'], 3, ',', '.') : '—' }} {{ isset($row['consumo_mc']) && $row['consumo_mc'] !== null ? number_format((float) $row['consumo_mc'], 3, ',', '.') : '—' }} {{ number_format((float) ($row['quota_euro'] ?? 0), 2, ',', '.') }}
Nominativi riparto legacy non disponibili.
Totali {{ number_format((float) collect($riscaldamentoRipartoNominativi)->sum(fn($r) => (float) ($r['consumo_mc'] ?? 0)), 3, ',', '.') }} {{ number_format((float) collect($riscaldamentoRipartoNominativi)->sum(fn($r) => (float) ($r['quota_euro'] ?? 0)), 2, ',', '.') }}
Letture contatori UI (con data ricezione e riferimento)
CRUD rapido inline per le letture UI correnti; l'archivio completo resta disponibile per foto, riassegnazioni e storico esteso.
{{ $this->riscaldamentoUiEditingId ? 'Modifica lettura UI' : 'Inserimento rapido lettura UI' }}
@if($this->riscaldamentoUiEditingId) @endif
@if($this->riscaldamentoUiEditingId) @endif
@forelse($lettureCondomini as $row) @empty @endforelse
Data ricezione Servizio Unità Canale Riferimento / immagine Periodo Lettura/consumo Azioni
{{ $row['data_ricezione'] ?: '—' }} {{ $row['servizio'] ?: '—' }}
Matr. {{ $row['matricola'] ?: '—' }}
{{ trim((string) ($row['unita'] ?? '')) !== '' ? $row['unita'] : '—' }} {{ strtoupper((string) ($row['canale'] ?? '—')) }} {{ $row['riferimento'] ?: '—' }} {{ $row['periodo'] ?: '—' }} @if(isset($row['consumo_valore']) && $row['consumo_valore'] !== null) {{ number_format((float) $row['consumo_valore'], 3, ',', '.') }} {{ $row['consumo_unita'] ?: 'mc' }} @else — @endif
Nessuna lettura disponibile.
@endif @if($riscaldamentoTab === 'generale')
Letture del contatore generale
Storico operativo del solo contatore generale: letture manuali, stime, finestre Acea e agganci alle FE riscaldamento.
@forelse($lettureGenerali as $row) @empty @endforelse
Data ricezione Servizio / codici Canale / protocollo Periodo / finestra Lettura Consumo Azioni
{{ $row['data_ricezione'] ?: '—' }}
{{ $row['servizio'] ?: 'Riscaldamento' }}
Matr. {{ $row['matricola'] ?: '—' }} · Utenza {{ $row['codice_utenza'] ?: '—' }}
Cliente {{ $row['codice_cliente'] ?: '—' }} · Contratto {{ $row['codice_contratto'] ?: '—' }}
{{ strtoupper((string) ($row['canale'] ?? '—')) }}
{{ $row['protocollo'] ?: '—' }} · {{ $row['workflow'] ?: '—' }}
{{ $row['reader'] ?: '—' }}
{{ $row['periodo'] ?: '—' }}
@if(!empty($row['window_label']))
Finestra {{ $row['window_label'] }}
@endif @if(!empty($row['visit_date']))
Passaggio Acea {{ \Carbon\Carbon::parse($row['visit_date'])->format('d/m/Y') }}
@endif @if(!empty($row['fattura_label']))
Origine FE {{ $row['fattura_label'] }}
@endif
{{ isset($row['lettura_fine']) && $row['lettura_fine'] !== null ? number_format((float) $row['lettura_fine'], 3, ',', '.') . ' mc' : '—' }} {{ isset($row['consumo_valore']) && $row['consumo_valore'] !== null ? number_format((float) $row['consumo_valore'], 3, ',', '.') . ' ' . ($row['consumo_unita'] ?: 'mc') : '—' }}
Ticket Archivio @if(!empty($row['fattura_url'])) FE @endif
Nessuna lettura generale disponibile per l'anno attivo.
@endif @if($riscaldamentoTab === 'tariffe')
Rendiconto Spese & Bilancio Riscaldamento
@php($groupedRows = collect($tariffeRows)->groupBy('tabella')) @forelse($groupedRows as $tabellaName => $rows) @foreach($rows as $row) @endforeach @empty @endforelse @if(count($tariffeRows) > 0) @php($totScostamento = collect($tariffeRows)->sum('scostamento')) @endif
Codice Descrizione Voce Tabella Millesimale Preventivo (Default) Consuntivo (Registrato) Scostamento (Delta)
Tabella Millesimale: {{ $tabellaName }}
{{ $row['codice'] }} {{ $row['descrizione'] }} {{ $row['tabella'] }} € {{ number_format($row['preventivo'], 2, ',', '.') }} € {{ number_format($row['consuntivo'], 2, ',', '.') }} {{ $row['scostamento'] > 0 ? '+' : '' }}€ {{ number_format($row['scostamento'], 2, ',', '.') }}
Nessuna voce di spesa riscaldamento configurata per lo stabile.
Totale € {{ number_format(collect($tariffeRows)->sum('preventivo'), 2, ',', '.') }} € {{ number_format(collect($tariffeRows)->sum('consuntivo'), 2, ',', '.') }} {{ $totScostamento > 0 ? '+' : '' }}€ {{ number_format($totScostamento, 2, ',', '.') }}
@endif @if($riscaldamentoTab === 'servizi')
Servizi / Utenze (anagrafica completa)
{{ $this->table }}
@endif
@if($showSendEmailModal)

Invia riepilogo contatori via email

@endif