@php $p = $preventivo; $s = $p->stabile; $a = $amministratore; $fmtMoney = fn ($value) => '€ ' . number_format((float) $value, 2, ',', '.'); $logo1 = (string) data_get($a?->impostazioni, 'documento.logo_1', ''); $logo2 = (string) data_get($a?->impostazioni, 'documento.logo_2', ''); $cappello = trim((string) data_get($a?->impostazioni, 'documento.cappello', '')); $datiFiscali = trim((string) data_get($a?->impostazioni, 'documento.dati_fiscali', '')); $piede = trim((string) data_get($a?->impostazioni, 'documento.piede', '')); $firma = trim((string) data_get($a?->impostazioni, 'documento.firma', '')); $dataLettera = optional($p->data_creazione)->format('d/m/Y') ?: now()->format('d/m/Y'); $oggetto = 'Preventivo gestione ' . strtoupper((string) $p->tipo_gestione) . ' - anno ' . (string) $p->anno_gestione; @endphp
@if($logo1 !== '') Logo @endif @if($logo2 !== '') Logo @endif
{{ $dataLettera }}
@if($cappello !== '')
{{ $cappello }}
@else
{{ $a?->denominazione_studio ?? 'Studio' }}
{{ trim(($a?->indirizzo_studio ?? '') . ' ' . ($a?->cap_studio ?? '') . ' ' . ($a?->citta_studio ?? '') . ' ' . ($a?->provincia_studio ?? '')) }}
@if($a?->telefono_studio) Tel. {{ $a->telefono_studio }} @endif @if($a?->email_studio) · {{ $a->email_studio }} @endif @if($a?->pec_studio) · PEC {{ $a->pec_studio }} @endif
@if($a?->partita_iva) P.IVA {{ $a->partita_iva }} @endif @if($a?->codice_fiscale_studio) · CF {{ $a->codice_fiscale_studio }} @endif
@endif @if($datiFiscali !== '')
{{ $datiFiscali }}
@endif
Spett.le
Condominio {{ $s?->denominazione }}
{{ trim(($s?->indirizzo ?? '') . ' ' . ($s?->cap ?? '') . ' ' . ($s?->citta ?? '') . ' ' . ($s?->provincia ?? '')) }}
Oggetto: {{ $oggetto }}

In allegato/di seguito si trasmette il preventivo per la gestione indicata in oggetto.

@foreach($p->voci as $voce) @endforeach
Codice Descrizione Ripartizione Importo
{{ $voce->codice }} {{ $voce->descrizione }} @if($voce->tabellaMillesimale) Tabella: {{ $voce->tabellaMillesimale->nome_tabella ?? $voce->tabellaMillesimale->nome ?? '—' }} @else — @endif {{ $fmtMoney($voce->importo_preventivato) }}
Totale voci: {{ $fmtMoney($this->subtotaleVoci) }}
@if($this->totaleCompensi > 0)
Compenso base: {{ $fmtMoney($this->compensoBase) }}
@if($this->cassaPercento > 0)
Cassa ({{ number_format($this->cassaPercento, 2, ',', '.') }}%): {{ $fmtMoney($this->compensoBase * ($this->cassaPercento/100)) }}
@endif @if($this->ivaPercento > 0) @php $cassa = $this->compensoBase * ($this->cassaPercento/100); $imponibile = $this->compensoBase + $cassa; $iva = $imponibile * ($this->ivaPercento/100); @endphp
IVA ({{ number_format($this->ivaPercento, 2, ',', '.') }}%): {{ $fmtMoney($iva) }}
@endif
Totale compensi: {{ $fmtMoney($this->totaleCompensi) }}
Totale complessivo: {{ $fmtMoney($this->totaleComplessivo) }}
@endif
@if(!empty($p->note))
Note
{{ $p->note }}
@endif
Cordiali saluti.
@if($firma !== '')
{{ $firma }}
@else
{{ $a?->denominazione_studio ?? '' }}
@endif